Software audio mixing (simultaneous audio streams) in Slackware?
If you have a "proper" sound card like a Sound Blaster X-Fi, like I do in my desktop, then you have hardware mixing support. This means that when simultaneous audio streams are used, they are actually played simultaneously -- and the hardware itself provides this functionality.
If you have audio functionality integrated in the chipset, chances are hardware mixing is not supported, or at least not implemented in the drivers you will see in GNU/Linux. Thus this must be done in software instead. The latter is the case for my laptop, which has a: Code:
Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03) My question is, what do I need to do in order to allow for software mixing as the device clearly does not have hardware mixing supported? I.e. I want to be able to play audio with xmms simultaneously while I play audio from e.g. mplayer, or Firefox/flash. I see that the dmix plugin for ALSA is supposedly able to provide this, but what configuration do I need? I've tried all of the examples at http://alsa.opensrc.org/Dmix in my ~/.asoundrc and /etc/alsa.conf. The error I receive when I try to play simultaneous audio streams is as follows: (From mplayer when xmms has hooked the audio device) Code:
[AO OSS] audio_setup: Can't open audio device /dev/dsp: Device or resource busy |
Just verify that you REALLY are using ALSA in your software instead of the so common default OSS...
|
Quote:
[AO_ALSA] alsa-lib: pcm_hw.c:1293:(snd_pcm_hw_open) open '/dev/snd/pcmC0D0p' failed (-16): Device or resource busy I.e. mplayer attempts to use ALSA, in fact it tries all of the most common interfaces to play sound, all of them failing. XMMS is also set up to use ALSA as output. However, I obviously want this to work with OSS as well as ALSA, i.e. software mixing. If you look at the dmix tutorial, this should be perfectly possible, although it doesn't work for me. |
Can you post your dmix settings?
|
You could try the OSS4Front drivers.
http://slackbuilds.org/repository/13.37/system/oss/ In the current versions of Slackware, ALSA should have software mixing enabled by default. As long as all your programs are outputting through ALSA, no further configuration should be needed. That is not to say, of course, that it will work for everyone. |
Quote:
To be short, it seems that if a single app uses OSS on those kind of setup, nothing work after (even if it's ALSA)... It's not an ALSA bug it's 100% a OSS bug. Of course, again, it might be another thing that I missed. Good luck ! Edit: Oh, i didn't find any configuration for that for the Flash player, but I guess that it uses ALSA, I don't know for mplayer as I use VLC, but my VLC was using OSS too... You might find some app, not allowing you to change the audio interface, and if they're using OSS in a hardcoded way, you might be stuck with those apps... |
Quote:
|
Alright, I didn't know this detail. Anyway it's a bug in the OSS emulation layer and not in the straight ALSA interface.
|
It might be an idea to look into JACK for software audio mixing - might not be exactly what you need but it works well - there IS flash support available from libflashsupport-jack.
|
I think you guys are mistaken.
I don't think the main issue is that ALSA's OSS emulation is at fault, or that OSS is the issue at all. I get similar errors when I use other programs that also supposedly use ALSA: From xmms when Firefox/flash has hooked the audio device: Code:
Message: device: hw:0,0 Code:
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave My alsa.conf follows: Code:
pcm.!default { |
Quote:
I am - right now - listening to audio with Goggles Music Manager, streaming a video in Firefox, and started to play a movie with both kaffeine and parole (just to see if it would work ;) ) everything has sound at the same time. On my girlfriend's pc, she runs firefox, seamonkey and chrome at the same time, all playing flash based games in facebook, while listening to Juk, everything has sound. And yes it's quite annoying :) Code:
00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia (Intel HDA) |
Quote:
|
I went through some of these issues when I was trying to get dmix working on my notebook as well. It looks like your alsa.conf is set up properly in its barest form, so I'm curious... are you able to get sound mixing working with two different instances of mplayer?
|
Next time you get that error run 'lsof | grep dsp' and I'm willing to bet you'll see some application grabbing the emulated OSS /dev/dsp device.
Adam |
Both OSSv42 and jack-audio-connection-kit will do software mixing on slackware.
OSSv42: volume control and mixing is done via ossxmix (a bundled utility), device testing and information can be checked using osstest and ossinfo (both are terminal apps). Comprehensive wiki on OSSv42 jack: mixing of audio streams is done via qjackctl Recommended to read and perform pre/post install steps outlined in the README. |
All times are GMT -5. The time now is 03:06 AM. |