XMBC, Lucid and PulseAudio

After I have upgraded our media PC to Ubuntu 10.4 (Lucid Lynx) audio stopped working in XBMC. Upgrading to the latest XBMC ubuntu packages from PPA didn’t help. After some experimenting, I have figured out that pulseaudio had to be started. I have the XBMC session file (/usr/share/xsessions/XBMC.desktop), and it turned out that it simply starts xbmc-standalone, which in turn starts pulse-session. But only if it exists. On Lucid it does not.

Fortunately we can use pulseaudio –start instead. So I just modified the startup script and now it works fine.


For the records /usr/bin/xbmc-standalone before:
#!/bin/sh
if which pulse-session; then
pulse-session xbmc --standalone "$@"
else
xbmc --standalone "$@"
fi

And after:
if which pulseaudio; then
pulseaudio --start
fi
xbmc --standalone "$@"