ALSA Audio XBMC Login

Hello all,

Just found how to allow XBMC / kodi to use ALSA for audio (not Pulse). This does not affect normal login (unity) but enables things like audio passthrough on XBMC sessions.

*This assumes your user is the default “ubuntu”
**this only works if only one user is on xbmc (probably best to have an xbmc user)

  1. create the fire in your home xbmc_custom_session_starter
nano ~/xbmc_custom_session_starter

and write the following to the file

#!/bin/bash
# Kill PulseAudio
echo autospawn = no > ~/.config/pulse/client.conf
killall pulseaudio
# Start Kodi
xbmc-standalone
# Start Pulse Audio
rm ~/.config/pulse/client.conf
pulseaudio --start
  1. enable execution of that file
chmod +x ~/xbmc_custom_session_starter
  1. create a new xesssion option
sudo nano /usr/share/xsessions/XBMC_Custom.desktop

and write the following to it

[Desktop Entry]
Name=Kodi (ALSA)
Comment=kodi (alsa)
Exec=/home/ubuntu/xbmc_custom_session_starter
TryExec=/home/ubuntu/xbmc_custom_session_starter
Type=Application
  1. reboot and you will have a new session option in ldm

I found most of this info around the internet so i cant claim the credit :)

Hope this helps someone !

Thanks for this tip, it really helps. Now the multichannel audio passthrough works like a charm :)

BTW
I’ve replaced “killall pulseaudio” with “pulseaudio -k”. Don’t know if it is exactly same, but killall seems too rude to me ;)