[LINUX] Simultaneous playback of xbmc and mplayer - alsa dmix problem ?
#1
I have following problem: I would like to have simultaneous audio output:
from XBMC and from another player.
Reason: xbmc plays music, while the other program delivers sound notifications (like: you have a mail, etc.)

I have following soundcard definition in my ~/.asoundrc:

pcm.test {
type dmix
ipc_key 1123
slave {
pcm "hw:0"
rate 44100
}
}


Using alsa dmix, I'm able to simulate the desired behaviour with mplayer:

[konsole1]> mplayer -ao alsa:device=test /tmp/test1.mp3
[konsole2]> mplayer -ao alsa:device=test /tmp/test2.mp3


With this, two files (test1.mp3 and test2.mp3) are played at the same time.

I configured XBMC to use the above definition of pcm.test:

<audiooutput>
<ac3passthrough>false</ac3passthrough>
<audiodevice>alsa:device=test</audiodevice>
<customdevice></customdevice>
<custompassthrough></custompassthrough>
<downmixmultichannel>true</downmixmultichannel>
<dtspassthrough>true</dtspassthrough>
<mode>0</mode>
<passthroughdevice>iec958</passthroughdevice>
<sep1></sep1>
<sep2></sep2>
<sep3></sep3>
</audiooutput>

Now I do following: in konsole1, I'm launching mplayer, and in another konsole window, I'm launching xbmc:

[konsole1]> mplayer -ao alsa:device=test /tmp/test1.mp3
[konsole2]> xbmc


Unfortunatelly, XBMC shows following:

ALSA lib pcm_dmix.c:1010:(snd_pcm_dmix_open) unable to open slave

And of course, no audio playback is possible from xbmc (failed to initialize audio, when tried).
What is the issue here ? Something wrong with my XBMC configuration? Or is XBMC somehow using the soundcard directly - disallowing simultaneous output?
Reply
#2
Actually, the configuration was wrong. I changed it to:
<audiodevice>custom</audiodevice>
<customdevice>test</customdevice>

Now I got simultaneous playback. But strangely, the
"ALSA lib pcm_dmix.c:1010Sadsnd_pcm_dmix_open) unable to open slave"
message still appears.

I figured out why. XBMC, tries to play the "navigation sounds" (clicks) to system's default soundcard device, and not to my customdevice (test). Why is that, isn't this a bug ?
Reply
#3
Quote:Why is that, isn't this a bug ?
It has been like that for a number of versions now. I have no clue but assume it is not easily fixed since it has not been addressed

it doesnt work if you rename test => default or redirect default to test in the asoundrc? That is how most people re-direct the nav sounds.
Reply

Logout Mark Read Team Forum Stats Members Help
[LINUX] Simultaneous playback of xbmc and mplayer - alsa dmix problem ?0