Solved Help playing other audio while XBMC is running
#1
Hi all,

Basically, I'm trying to connect my multiple XBMC instances to my doorbell. So far I've got it to pause whatever is playing and show a notification saying someone is at the door. This is all well and good if I'm watching TV/Movie, but if I'm listening to music, the TV is turned off so I don't see a notification. I'd also like to be able to play a doorbell sound through all of my XBMC instances but I can't seem to find any way to play sound while XBMC is running, I've tried mplayer, aplay etc but they just don't output any audio. I cant use XBMC to play the sound because then I'd lose my (paused) place in whatever I'm watching/listening to.

Any thoughts on how to accomplish this?

Also, as an extra thought, It would be kind of nice to be able to display an image from my front door webcam.

I'm running Frodo 12.2 (as a session) on Ubuntu server 12.04 (With added lubuntu-desktop)

Thanks.
Reply
#2
Nevermind guys, After a little more google-fu I found the solution (courtesy of k3ilbasa) and used a dmix alsa shared output. For reference if anyone else is looking, here's how I did it.

I created /etc/asound.conf as follows

Code:
pcm.!default            { type                  plug;
                          slave.pcm             "dmix0"; }
ctl.!default            { type hw; card 0; device 0; }

pcm.dsp0                { type                  plug;
                          slave.pcm             "dmix0"; }
ctl.dsp0                { type hw; card 0; device 0; }
ctl.mixer0              { type hw; card 0; device 0; }

pcm.dmix0               { type                  dmix;
                          ipc_key               13759;

                          slave.pcm             "hw:0,0";
                          slave.channels        2;

                          slave.rate            48000;
                          slave.period_size     4096;
                          slave.buffer_size     16384;

                          slave.period_time     84000;
                          slave.buffer_time     340000;

                          # Map only the first two channels
                          bindings.0            0;
                          bindings.1            1; }

Card and device numbers come from running (may require sudo)
Code:
aplay -l

If the above required sudo, then you'll probably want to add your user to the audio group
Code:
usermod -a -G audio <username>

In my case, this worked on every other boot because the audio the sound cards were detected in a different order on each boot. To fix this I added the following to the end of /etc/modprobe.d/alsa-base.conf

Code:
options snd_cmipci index=0
options snd_hda_intel index=1
options snd_usb_audio index=2

In my case snd_cmipci was the device I wanted to be loaded as card 0, yours will probably be different.

Now my doorbell is awesome and even when I'm listening to unreasonably loud music in any part of the house, I don't miss visitors.
Reply

Logout Mark Read Team Forum Stats Members Help
Help playing other audio while XBMC is running0