PDA

View Full Version : Multiple Sound Cards - Working under XBMC?


Swifty
2009-04-28, 21:25
Hi all,

I am currently considering moving my XBMC and TV Server box to Ubuntu so that I can try out the new implementation of VDR within XBMC.

I currently have two (different) soundcards in my box running Windows XP, I have a small program that clones the audio from the main card and reproduces at the second soundcard.
I have this set to toggle on / off via a button on my remote, which allows me to enable/disable audio to a speaker hooked up in another room of the house.

I'd like to know if this is still going to be possible under Ubuntu.. so;

a) Can Ubuntu / XBMC provide the same audio out of two different cards?
b) Can I independenty disable/mute one of the cards via a remote button ?

Thanks!

fasteddy
2009-04-28, 22:27
a) Yes! You'd create a .asoundrc to do this. For example:

pcm.!default {
type plug
slave.pcm "dup"
}

pcm.dup {
type copy
slave.pcm "hw:0,0"
slave.pcm "hw:1,0"
slave.pcm "hw:0,0"
}


b) I suppose you could write a script that would interface with amixer. For example
if [ "`/usr/bin/amixer -c 1 sget 'Master',0 | grep off`" ]
then
/usr/bin/amixer -q -c 1 sset 'Master',0 unmute
else
/usr/bin/amixer -q -c 1 'Master',0 mute
fi should (if I am not mistaken, which is often the case) mute/unmute the second sound card. Then you'd just need to assign that as a script to one of your remote keys.

Swifty
2009-04-28, 22:41
Hi fasteddy,

Thanks so much for your reply, I'll definatley be bookmarking this for once I have Ubuntu installed.
Such detailed and concise answers are usually hard to come by with my strange questions so your help is _very_ much appreciated!