2014-11-26, 21:25
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
2. Script /etc/pm/sleep.d/50_suspend_xbmc.sh
3. Script /etc/pm/sleep.d/99_suspend_xbmc.sh
Now make them executable (sudo chmod +x). Thats it - Hopefully it will help
Disclaimer: Im not a native english speaker and no expert on linux
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
Disclaimer: Im not a native english speaker and no expert on linux