LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Software audio mixing (simultaneous audio streams) in Slackware? (https://www.linuxquestions.org/questions/slackware-14/software-audio-mixing-simultaneous-audio-streams-in-slackware-879618/)

malloc 05-11-2011 03:45 PM

I have now attempted to let two instances of mplayer execute and try to use the audio device. The test fails, the second instance is unable to open the device, from the console output I can see it tries both ALSA as well as OSS, to no avail:

Code:

Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
[AO OSS] audio_setup: Can't open audio device /dev/dsp: Device or resource busy
[AO_ALSA] alsa-lib: pcm_hw.c:1293:(snd_pcm_hw_open) open '/dev/snd/pcmC0D0p' failed (-16): Device or resource busy
[AO_ALSA] alsa-lib: pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
[AO_ALSA] Playback open error: Device or resource busy
[AO ESD] esd_open_sound failed: Connection timed out
[AO SDL] Samplerate: 44100Hz Channels: Stereo Format s16le
[AO_ALSA] alsa-lib: pcm_hw.c:1293:(snd_pcm_hw_open) open '/dev/snd/pcmC0D0p' failed (-16): Device or resource busy
[AO_ALSA] alsa-lib: pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
[AO SDL] Unable to open audio: No available audio device


T3slider 05-11-2011 08:23 PM

Use
Code:

mplayer -ao alsa
I believe mplayer by default tries to use OSS, and alsa-oss will lock the device. You can also set this in mplayer's config file to avoid passing it explicitly.

malloc 05-11-2011 08:44 PM

Quote:

Originally Posted by T3slider (Post 4353826)
Use
Code:

mplayer -ao alsa
I believe mplayer by default tries to use OSS, and alsa-oss will lock the device. You can also set this in mplayer's config file to avoid passing it explicitly.

Great, thanks, that actually worked -- sorry that I didn't realize that myself, that is actually quite trivial. So in other words software mixing does indeed work with ALSA.

Now I only need to know how to make OSS programs work with software mixing.

dimm0k 05-11-2011 09:22 PM

Great to hear you have software mixing working! I suggested running two instances of mplayer to actually test it, as it is the easiest to work and switch to ALSA. That and that's what I used to test when I was trying to figure things out. I hope you realize that xmms can be made to use ALSA as well, so I'm curious as to what programs you use that use OSS specifically?

T3slider 05-11-2011 09:25 PM

Quote:

Originally Posted by malloc (Post 4353842)
Now I only need to know how to make OSS programs work with software mixing.

It won't unless you run it through a sound server (like phonon or arts or pulse or esd etc.). You should set everything you can to output via ALSA explicitly. If you have an app that will ONLY use OSS then you can start sound from one app that uses ALSA, then start the OSS app and it shouldn't lock the sound device. However, if it is the first app to output sound and it uses OSS then you're out of luck unless it can be routed through a sound server.


All times are GMT -5. The time now is 03:28 PM.