Enabling suspend/resume with XBMC in Ubuntu 9.10

Had issues after upgrading to Karmic with suspend/resume on my media box (Shuttle SN78S) where the system would suspend and then immediately resume (xbmc forum thread). After ruling out the nvidia blob as the culprit (my usual suspect), I did a bit more digging and found people able to make it work by disabling usb autosuspend but that didn’t make a difference at all for me. I did find some older documentation pointing to an oddity with the ehci driver and acpi wakeup causing this issue so I disabled it (via /proc/acpi/wakeup) and was able to suspend successfully. Wakeup via WOL succeeded as well, but not being able to resume via remote is a showstopper for me so I poked a bit more and enabled wakeup only for the USB device my remote sensor was attached to and voila!

To determine the USB device:

root@host:~#lsusb
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 1784:0008 TopSeed Technology Corp.
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

In this case it’s easy as my remote sensor is the only device attached and it’s on bus 004.


root@host:~#cat /proc/acpi/wakeup |grep ^USB
USB0 S3 disabled pci:0000:00:02.0
USB1 S3 enabled pci:0000:00:04.0
USBB S3 disabled pci:0000:00:04.1
USB2 S3 disabled pci:0000:00:02.1

Now I have both the USB1 and USBB devices that show up on 04, but USB1 is the first so that was the one I enabled via:
echo "USB1" > /proc/acpi/wakeup

To make it persistent I added the following to /etc/rc.local (the ethtool command enables WOL and isn’t needed unless you want to wake your machine over the network):

# Enable wakeup for the remote
status=`cat /proc/acpi/wakeup | grep "USB1" | awk {'print $3}'`
if [ "$status" = "disabled" ]; then
echo "USB1" > /proc/acpi/wakeup
fi

/usr/sbin/ethtool -s eth0 wol g > /dev/null

The only other step I took was to work around the standard lirc borkage by disabling lirc and unloading the modules. This requires two files:
/etc/pm/config.d/01lirc_module

SUSPEND_MODULES="lirc_mceusb lirc_dev"

/etc/pm/sleep.d/10-lirc (must be executable, requires installing curl – apt-get install curl)

#!/bin/sh
# Disconnect XBMC from lirc and stop the daemon

case "$1" in
hibernate|suspend)
service lirc stop
;;
thaw|resume)
service lirc start
;;
*) exit $NA
;;
esac

As of 9.11 alpha 2, XBMC uses ConsoleKit in the Karmic packages so you need to make sure your session gets auth’d properly or you’ll end up with permission denied messages in the xbmc logs when it tries to suspend. If you’re using GDM or KDM it should Just Work. In my case I’m just starting x on tty1 for my xbmc user so I had to update my .xsession file to launch xbmc like so:
ck-launch-session /usr/bin/xbmc --standalone

Edit: As of 9.11 alpha2, XBMC takes care of connecting/disconnecting from the LIRC daemon so no need to do it in the lirc script. Also added info about the new ConsoleKit integration in alpha2.

Updated Gaim Edgy packages

I upgraded the Gaim packages in my Edgy repo to the latest (beta 4) release today. Because I stupidly didn’t sync with the upstream Ubuntu packages, you’ll have to remove the gaim-otr plugin and re-install. The plugins I have are gaim-otr, gaim-encryption and gaim-libnotify. I’m prolly gonna go ahead and do a quick Xchat-gnome package cause the new version has a few sweet features like themable icons and irc command tab completion.

Note: I’ve removed all the launchpad and automatic bug reporting patches from all my packages. I don’t want any spurious bug reports going upstream to the Ubuntu folks.

Package updates

I’ve added a few more packages to my dapper repo and updated a few others. I added an updated nautilus-sendto deb (with Gajim goodness), plus a few other misc Gaim beta plugins. There’s also updated Mugshot packages, libXft and cairo with David Turner’s subpixel rendering patches, Vim 7 (from Meethune) and svn2cl.

Basically, this has become my dumping ground for stuff I’m running. I suppose I really should create packages for pyshout as well…

Updates, Ubuntu packages

Updated the python-shoutcast tarball to fix an issue with the DEBUG variable. Go grab it now… All the cool kids are doing it… ;)

I’ve also put up some Gaim beta3 debs for Dapper. I compiled these with Bonjour support (via Avahi libs). There’s also a handful of plugins, which I’ll be adding to in the coming days… Enjoy!

New host

Finally got setup on a proper hosting service I think I’ll be able to live with for a while. My requirements never seemed all that exotic, but I couldn’t ever find anything I felt all that comfortable with. Until now.

Thanks to Xen, I now have a fully functional VPS running Dapper. I decided to try out VPSLand because they are cheap, and folks seemed to be pretty happy with em.

So far I’m quite happy with the level of service. My one support request was taken care of promptly and correctly. My server was setup just as advertised, but I am gonna move up from my current 96 MB plan to 192 MB. I figured it wasn’t gonna be enough, but I didn’t wanna commit any more cash than I had to just to try it out…