Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
05-09-2011, 05:24 AM
|
#1
|
Member
Registered: Jul 2010
Posts: 111
Rep:
|
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)
Which uses the snd-hda-intel driver.
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
[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
|
|
|
05-09-2011, 05:27 AM
|
#2
|
Member
Registered: Apr 2010
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 609
|
Just verify that you REALLY are using ALSA in your software instead of the so common default OSS...
Last edited by NoStressHQ; 05-09-2011 at 06:12 AM.
Reason: My rubbish english was fixed :)
|
|
|
05-09-2011, 09:42 AM
|
#3
|
Member
Registered: Jul 2010
Posts: 111
Original Poster
Rep:
|
Quote:
Originally Posted by NoStressHQ
Just verify that you REALLY are using ALSA in your software instead of the so common default OSS...
|
You can see from the log i posted in my original post that:
[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.
|
|
|
05-09-2011, 09:48 AM
|
#4
|
Member
Registered: May 2008
Location: Brooklyn ZOO
Distribution: Slackware64 14.2
Posts: 581
Rep:
|
Can you post your dmix settings?
|
|
|
05-09-2011, 10:15 AM
|
#5
|
LQ Guru
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,352
|
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.
Last edited by dugan; 05-09-2011 at 10:23 AM.
|
|
|
05-09-2011, 10:43 AM
|
#6
|
Member
Registered: Apr 2010
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 609
|
Quote:
Originally Posted by malloc
You can see from the log i posted in my original post that:
[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.
|
I see from your log that it uses OSS... I had the exact same problem last week strongly believing that XMMS were using ALSA and not the old buggy OSS BUT it used OSS to my surprise... I might be wrong but it's a common problem on laptop with Intel audio cards... The log displays several errors when the callstack is returning error, the first one is OSS that failed, then ALSA propagates the error (it seems ALSA can be a layer on top of OSS too, I don't really know the inside work, but that's what the log suggests...).
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...
Last edited by NoStressHQ; 05-09-2011 at 10:47 AM.
|
|
|
05-09-2011, 11:02 AM
|
#7
|
LQ Guru
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,352
|
Quote:
Originally Posted by NoStressHQ
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.
|
On most distributions (including Slackware), OSS is an emulation layer provided by ALSA, so yes it's an ALSA bug.
|
|
|
05-09-2011, 11:29 AM
|
#8
|
Member
Registered: Apr 2010
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 609
|
Alright, I didn't know this detail. Anyway it's a bug in the OSS emulation layer and not in the straight ALSA interface.
|
|
|
05-09-2011, 12:10 PM
|
#9
|
Member
Registered: Aug 2006
Location: London
Distribution: Slackware
Posts: 132
Rep:
|
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.
|
|
|
05-09-2011, 01:28 PM
|
#10
|
Member
Registered: Jul 2010
Posts: 111
Original Poster
Rep:
|
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
** WARNING **: alsa_setup(): Failed to open pcm device (hw:0,0): Device or resource busy
From Firefox/flash when xmms has hooked the audio device:
Code:
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
As you can see, the ALSA API function call alsa_setup() and snd_pcm_dmix_open() seems to fail.
My alsa.conf follows:
Code:
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.dsp0 {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 8192
#periods 128
rate 44100
}
bindings {
0 0
1 1
}
}
ctl.mixer0 {
type hw
card 0
}
|
|
|
05-09-2011, 01:49 PM
|
#11
|
Senior Member
Registered: Mar 2005
Location: USA
Distribution: Slackware
Posts: 1,133
|
Quote:
Originally Posted by malloc
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:
|
Perhaps the issue is with xmms and mpalyer attempting to lock/block the device?
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)
00:1b.0 Audio device: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller
This is without any .asoundrc or alsa.conf. What ever alsa setup as default works.
|
|
|
05-09-2011, 02:13 PM
|
#12
|
Senior Member
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810
|
Quote:
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.
|
This works for me too and I have Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02) installed. I have to tell XMMS to specifically use ALSA and I get both Youtube and XMMS mixed output. I only get the one volume control though and cannot independently affect volumes of XMMS and Youtube. Maybe playing with Jack or something would fix that. I have always simply ran one or the other at once and just accepted this limitation as being default. It would be interesting if you come up with a good solution.
|
|
|
05-09-2011, 02:29 PM
|
#13
|
Member
Registered: May 2008
Location: Brooklyn ZOO
Distribution: Slackware64 14.2
Posts: 581
Rep:
|
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?
|
|
|
05-09-2011, 04:02 PM
|
#14
|
Senior Member
Registered: May 2006
Posts: 3,091
|
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
|
|
|
05-09-2011, 06:18 PM
|
#15
|
Member
Registered: Jun 2010
Posts: 116
Rep:
|
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 12:20 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|