LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 12-30-2005, 11:46 AM   #1
xstyr
LQ Newbie
 
Registered: Dec 2005
Posts: 5

Rep: Reputation: 0
Question one proggram sound prob


hello

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**
 
Old 12-30-2005, 12:33 PM   #2
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Rep: Reputation: 30
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.
 
Old 12-30-2005, 01:12 PM   #3
pokey
LQ Newbie
 
Registered: Jul 2003
Location: London, UK.
Distribution: Gentoo, (K)Ubuntu
Posts: 14

Rep: Reputation: 0
Hi xstyr

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

Hope this helps
 
Old 12-30-2005, 01:14 PM   #4
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Rep: Reputation: 30
Quote:
Originally Posted by pokey
The way i did it was create the file ~/.asoundrc
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 .

Last edited by bobbens; 12-30-2005 at 01:24 PM.
 
Old 12-31-2005, 07:58 AM   #5
pokey
LQ Newbie
 
Registered: Jul 2003
Location: London, UK.
Distribution: Gentoo, (K)Ubuntu
Posts: 14

Rep: Reputation: 0
Hi again.

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
 
Old 12-31-2005, 08:25 AM   #6
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Rep: Reputation: 30
Quote:
Originally Posted by pokey
Hi again.

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...
 
Old 12-31-2005, 10:39 AM   #7
pokey
LQ Newbie
 
Registered: Jul 2003
Location: London, UK.
Distribution: Gentoo, (K)Ubuntu
Posts: 14

Rep: Reputation: 0
Quote:
how about one OSS and one ALSA?
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.

SDL_AUDIODRIVER=alsa ./someprogram
 
Old 12-31-2005, 10:45 AM   #8
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Rep: Reputation: 30
Quote:
Originally Posted by pokey
SDL_AUDIODRIVER=alsa ./someprogram
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...
 
Old 01-01-2006, 06:44 AM   #9
xstyr
LQ Newbie
 
Registered: Dec 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Hi again

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
 
Old 01-01-2006, 09:31 AM   #10
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Rep: Reputation: 30
Quote:
Originally Posted by xstyr
Hi again

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.
 
Old 01-01-2006, 11:02 AM   #11
xstyr
LQ Newbie
 
Registered: Dec 2005
Posts: 5

Original Poster
Rep: Reputation: 0
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.

*if only i wasn't blind enough to miss it*


thanks alot tho!

Last edited by xstyr; 01-01-2006 at 11:13 AM.
 
Old 01-01-2006, 11:07 AM   #12
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Rep: Reputation: 30
Quote:
Originally Posted by xstyr
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Another NEWBIE with a sound prob.... wwpusa Slackware 2 10-19-2003 08:42 PM
D.S.L. Sound Prob Fonke0412 Linux - Hardware 3 09-27-2003 06:10 PM
Xmms Sound Prob Type O Negative Slackware 2 05-23-2003 03:45 PM
Yet another sound prob (AC97 VIA) skip1 Linux - Hardware 11 03-12-2003 05:22 PM
Another Sound prob. Farmchild Linux - Hardware 2 10-07-2002 10:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 09:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration