[LINUX] How to fix Suspend/Hibernate with DVB-t USB stick on Karmic Koala
#1
The Problem:

XBMC PVR branch on Ubuntu 9.10 (Karmic Koala), with vdr and a USB-connected dvb-t stick doesn't suspend or hibernate correctly (it hangs) and therefore cannot be resumed.

The Cause:

The dvb module/driver prevents suspend or hibernate.

The Solution:

Somehow offload the dvb module before suspend or hibernate, and then reload on resume.
Unfortunately it is not as simple as this, as the dvb module is used by the dvb-t USB stick, which is used by vdr, which in turn is used by XBMC.

The steps involved are:

On hibernate/suspend:

1. Stop XBMC
2. Stop vdr
3. Offload the dvb module

On wake up/resume, do the reverse:

1. Reload the dvb module
2. Start vdr
3. Start XBMC

NOTE: Only do this if suspend or hibernate, and wake up/resume works without the dvb-t USB stick, but doesn't work with the dvb-t stick.

Step One:

Open a terminal, and type (or copy/paste) the following:

Code:
gksudo gedit /etc/pm/sleep.d/50_dvb_usb_dib0700_quirk

Press <enter> type your password (if prompted to do so) and press <enter>. A gedit window will open up.

Step Two:

Type the following in the gedit window (or copy/paste):

Code:
#!/bin/sh

case "$1" in
hibernate|suspend)
  killall xbmc
  /etc/init.d/vdr stop
  modprobe -r dvb_usb_dib0700
  ;;
thaw|resume)
  modprobe dvb_usb_dib0700
  /etc/init.d/vdr start
  xbmc
  ;;
*) exit $NA
  ;;
esac

Save the file and close the gedit window.

Step Three:

Make the script created above executable:

Open a terminal, and type (or copy/paste) the following:

Code:
sudo chmod +x /etc/pm/sleep.d/50_dvb_usb_dib0700_quirk

Press <enter> type your password (if prompted to do so) and press <enter>

Close all windows, reboot (I think this is optional, but to be safe I do this anyway) and all should be good.

I hope this helps others, as I spent a few hours trying to sort this out.
Anti-Fascist◾Artist◾Atheist◾Barefoot◾Cis-male◾Cyclist◾Gay◾Geeky◾Introverted◾Likes weird stuff◾Living with depression & anxiety◾Naturist◾Pierced◾Socialist◾He/him
Reply
#2
Hi

In my case both dvb-s,analog-tv and lirc drivers are not working with hibernate so here is my script I'm using (part of it I've found on this forum). I'm not stoping xbmc (to resume it faster) but from time to time after resume it "eats" one CPU core (100% load on one core - I don't know how to debug it).

BTW to stop xbmc it is better to use: service xbmc-live stop (if you are using xbmc live)


Code:
#!/bin/sh

# This script uses curl. Install curl using the following command from your terminal apt-get install curl
# This script will restart lirc drivers, Lirc, and XBMC's lirc interperater upon resume.

case "$1" in  
    suspend|hibernate)
       /etc/init.d/vdr stop
       /etc/init.d/lirc stop
       rmmod mantis
       rmmod ivtv
       ;;
        resume|thaw)
           curl "http://user:[email protected]:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Stop"
           modprobe mantis
           modprobe ivtv
           /etc/init.d/lirc start
           /etc/init.d/vdr start
           #remove the comment if the computer automatically sleeps after resume
           #irw & sleep 1; killall irw
       sleep 2
           curl "http://user:[email protected]:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start"
           echo "lirc resume script completed!!!" >>/tmp/script.log
           ;;
esac

PS. Replace user:password with yours.

Regards
Janusz
Reply
#3
thanks. this helped me a lot. My system suspend stopped working after adding a DVB tuner. Had to stop tvheadend and modprobe dvb module before sleep Smile
Reply
#4
If someone wants to extend my script for VLC with current XBMC support, please go ahead: https://bugs.launchpad.net/ubuntu/+sourc...ug/1354668
Reply

Logout Mark Read Team Forum Stats Members Help
[LINUX] How to fix Suspend/Hibernate with DVB-t USB stick on Karmic Koala0