MandrivaThis Forum is for the discussion of Mandriva (Mandrake) 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.
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.
im quite new to using linux properly as my main OS.
My problem is that if i open a program that uses sound, it plays, thats fine
the problem comes when i want 2 programs to play sound. (it doesnt matter when they play, only the first program will play sound).
thanks for any help.
**im not sure but is to do with the sound engine im using**
Well this would probably be because you are using OSS, which blocks /dev/dsp (the sound output device) when an applications uses it. I'd try to get ALSA working, since it is alot better and supports software mixing. You should read up on http://www.alsa-project.org/ and get it working as is appropriate with your distro. Although some programs designed for OSS still don't work perfectly with ALSA, but you can emulate OSS and use it as if it were OSS or attempt to use an ALSA wrapper to get it working with software mixing, which may not work well in some cases.
bobbens is right. i was writing this and then noticed bobbens already posted
The problem is that the first program is hogging the device files that the programs use for output.
I think the easiest way to achieve what you want is to use ALSA as the sound driver and then set every program that you are using to use the ALSA dmix plugin. This includes arts, the KDE sound server, esd (GNOME?) and every other program.
The dmix plugin mixes the audio sources of each program in software.
If the program doesn't support ALSA but it supports Open Sound System you can configure ALSA to emulate OSS and then that can use the dmix plugin too.
The way i did it was create the file ~/.asoundrc
Here is parts of mine relevant to what you want to do.
[HTML]
# ~/.asoundrc
# make default output use dmix to mix everything in software
pcm.!default {
type plug
slave.pcm "dmix"
}
# oss to use dmix
pcm.dsp0 {
type plug
slave.pcm "dmix"
}
# not sure if this is used
ctl.mixer0 {
type hw
card 0
}
# end
[/HTML]
For OSS emulation to work with dmix you have to run a wrapper called aoss before the actual program. eg.
aoss ./audacity
After you set up ~/.asoundrc like that you shouldn't need to configure anything if the program uses ALSA anyway. It works OK here for most apps apart from some problems with quake based games but YMMV.
I think this also needs a recent version of ALSA to work, i'm using 1.0.10
from what i read at the alsa site, the .asoundrc dmix plugin has become obsolete as of the latest versions, so there is no need to create a .asoundrc anymore. And with the latest version i have noticed that sometimes when you open an OSS program when an ALSA applications is blocking the sound it will automatically run aoss as a wrapper, altough it could be me seeing things. Altough the other way around it doesnt work, if you run an oss application it will block sound output.
EDIT: damn well maybe i am wrong, i was trying to find where i read something about dmix being obsolete, yet i find http://alsa.opensrc.org/OSS+and+dmix which is talking about a very up to date version of alsa...
EDIT EDIT aka EDIT #2: well read this: http://alsa.opensrc.org/DmixPlugin talks about latest version 1.0.9rc2 and up not needing dmix plugin anymore, yet the link above talks about version 1.0.10, man this is confusing :X, altough i know that without a .asoundrc it works for me, so i'm guessing this one is right... Maybe i don't see imaginary things after all .
I think if you want two or more apps that use OSS and also mix the sound with apps that use ALSA, you still need a .asoundrc
If i remove my config file and run 2 OSS apps under the the ALSA emulation, one app still blocks the sound.
When i copy my config back i can run two or more OSS apps and many ALSA apps and all the sound is mixed using dmix.
I can still use ALSA apps without a config file though.
It took me a while to figure this out, but it was useful learning about the .asoundrc anyway. I'm amazed at the stuff you can do with ladspa plugins and jack in that file.
I think if you want two or more apps that use OSS and also mix the sound with apps that use ALSA, you still need a .asoundrc
If i remove my config file and run 2 OSS apps under the the ALSA emulation, one app still blocks the sound.
When i copy my config back i can run two or more OSS apps and many ALSA apps and all the sound is mixed using dmix.
I can still use ALSA apps without a config file though.
It took me a while to figure this out, but it was useful learning about the .asoundrc anyway. I'm amazed at the stuff you can do with ladspa plugins and jack in that file.
Best
how about one OSS and one ALSA? i can get that working without .asoundrc, but i don't use enough OSS applications to actually have a case where i need to run two at the same time, well maybe with SDL, of course i'm still tryin gto figure out how to get SDL working better (like be able to change workspaces when fullscreen SDL is activated, and get it using ALSA), besides that i don't run into too many situations where i need multiple sound applications. Many things i stil have to look into...
That works for me too without .asoundrc
I only need that setup when using two or more OSS apps, which is quite frequent for me.
Quote:
of course i'm still tryin gto figure out how to get SDL working better (like be able to change workspaces when fullscreen SDL is activated, and get it using ALSA)
Not too sure about SDL and changing workspaces, but you can change what sound driver SDL uses with an environment variable.
the problem is that i get a slight lag when using that. I remembered trying that a while ago and having the same problem, and since only SDL things i do are games, it's really annoying to have a half a second lag on everything you do, which makes it useless pretty much...
thanks but could you put in a form that i might be able to understand.
sorry but im not sure what to do.
*basicaly what to type and press*
thanks
What distro (ie: Fedora Core, Debian, Ubuntu, Mandriva...) are you using, and what window manager (ie: gnome, kde, fluxbox, blackbox...) do you use? You should try to find out how to get ALSA working in what you use, there is probably alot of documentation at your distro's website.
im using mandiriva 2006, KDE *want to change tho:P* and i found how to change KDE sound system, athough, the problem remains
Edit**
yay, ok, i got it to work, ive also lernt alot so i dont mind, soz to waste your time.
Well ur prob wondering how i fixed it. *god i was staring at it*
on Kmix i went to switches, and for some reson, the "mix" switches were off.
im using mandiriva 2006, KDE *want to change tho:P* and i found how to change KDE sound system, athough, the problem remains
I remember a long time ago when i tried kde, i had alot of problems trying to get ALSA working in KDE and ended up ditching it because it was annoying and am using really small lightwight programs that are easier to config. I really can't help you as i don't know nor mandriva nor kde at all. Try looking around http://mandrivausers.org or http://www.kde.org/ . You might be able to find some way to get ALSA working. I'm surprised no one using mandriva here at LQ has answered this.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.