Kodi Community Forum

Full Version: Issues with suspend Tvheadend
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Someone might trouble like me to proper put my xbmc-server (runnin a LinuxMint 17) into suspend mode. While the server goes into suspend mode, there is no Live TV after the server resumes (Error: Tvheadend: No input detected etc). It took me some time to fix this problem, this is why i want to share my solution with u, so that anybody who stumbles into this kind of mess can fix it easly.

Basicly the problem is - while ur pc is going into suspend and resume - that the kernel module (DVB Card) and tvheadend service has to be terminated and reloaded proper. To do so we have to create 3 Scripts in /etc/pm/sleep.d/ (sudo nano etc.)

1. Script /etc/pm/sleep.d/10_suspend_xbmc.sh
Code:
#!/bin/sh

# This is a script which will stop xbmc on suspend and restart xbmc when resume
case "$1" in
        suspend)
        # Stop Xbmc
        kill -9 `pidof xbmc.bin`
;;
        resume)
  # Restart Network and Samba - remove comment if xbmc has no internet connection after resume
        #restart network-manager
        #sleep 15
        #service smbd restart
        #sleep 5
   # Start Xbmc - replace USERNAME with ur Name
        export DISPLAY=:0
        su -c- USERNAME /usr/bin/xbmc
;;
esac

2. Script /etc/pm/sleep.d/50_suspend_xbmc.sh
Code:
#!/bin/sh

case "$1" in
        suspend)
        # Stop Tvheadend
        sleep 1
        service tvheadend stop
        sleep 1
;;
        resume)
        # Start Tvheadend
        sleep1
        /etc/init.d/tvheadend start
;;
esac

3. Script /etc/pm/sleep.d/99_suspend_xbmc.sh
Code:
#!/bin/sh

case "$1" in
        suspend)
        # unload DVB-Card kernel module - ur kernel module may differ, fill the correct one for u in
        modprobe -r cx23885
;;
        resume)
        # load DVB-Card kernel module
        modprobe cx23885
;;
esac

Now make them executable (sudo chmod +x). Thats it - Hopefully it will help Blush

Disclaimer: Im not a native english speaker and no expert on linux Angel
Using Mint 17.1 Mate 64 bit:

Same problem here, in 32 bit system I just wrote
Code:
sudo invoke-rc.d tvheadend restart
and everything worked. At my new 64 bit system, nothing helps. Following this guide disabled suspend all together, so had to remove it and suspend now works. When removed only 10_suspend_xbmc.sh suspend works. And yes, I did change the correct usernane (hopefully)

This is output of lspci
Code:
01:09.2 Multimedia controller: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder [MPEG Port] (rev 05)
01:09.4 Multimedia controller: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder [IR Port] (rev 05)

EDIT: When trying to open channel in Xbmc tvheadend log says:
Code:
Dec 19 08:37:03.810 subscription: "127.0.0.1 [ janiporo | XBMC Media Center ]" subscribing on "FOX", weight: 150, adapter: "Conexant CX22702 DVB-T", network: "Digita Finland", mux: "Digita Finland: 562,000 kHz", provider: "Fox International Channels Oy", service: "FOX", quality: 100

Any ideas?
Nevermind, I installed tvheadend from correct repo and now everything works out of the box.