Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
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.
|
|
04-01-2006, 04:47 PM
|
#1
|
Member
Registered: Sep 2005
Distribution: Debian
Posts: 304
Rep:
|
How to make alsa play two sounds at the same time?
Hi, is it possible to make alsa respond to two or more programs at the same time?
Like, i'm listening to some music on xmms and if i want to see a video on mplayer, when i start a video, it doesn't play anything until i close xmms. If i use arts as output audio driver it works, i can open as many programs as i want and they will work at the same time. But, arts is a little buggy (makes mplayer slow, and when i stop xmms it takes about 2 or 3 seconds to REALLY stop).
|
|
|
04-01-2006, 05:58 PM
|
#2
|
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870
|
maybe try esound or jack instead of arts??
|
|
|
04-02-2006, 11:23 PM
|
#3
|
Member
Registered: Sep 2005
Distribution: Debian
Posts: 304
Original Poster
Rep:
|
esound and jack did not worked for me. Well, xmms and mplayer couldn't play anything.
How does esound and jack work? I have to make something like alsaconf or they are already configured?
|
|
|
04-02-2006, 11:52 PM
|
#4
|
Senior Member
Registered: Jun 2004
Posts: 2,553
Rep:
|
alsa can do this directly
have to use dmix plugin
it is possible to write a HUGE file as ~/.asoundrc for this but here is as simple as i can think right now.
save this as ~/.asoundrc and see if it works
Code:
pcm.dsp0 {
type plug
slave.pcm "dmix"
}
pcm.!default {
type plug
slave.pcm "dmix"
}
|
|
|
04-03-2006, 12:05 AM
|
#5
|
Member
Registered: Sep 2005
Distribution: Debian
Posts: 304
Original Poster
Rep:
|
well, i have a good and a bad news.
The good one is that you solved and old problem which i had reported here but didn't found any solution. Well, when i boot up my computer it usually takes about 1 minute to get my sound working (after everything is loaded). Doing what you told me stopped this.
The bad one. The sound was horrible, like lagged and noisy (sorry, can't describe, my english is horrible).
Thanks for the help!
|
|
|
04-07-2006, 11:42 AM
|
#6
|
Member
Registered: Sep 2005
Distribution: Debian
Posts: 304
Original Poster
Rep:
|
can somebody help me to make it work? It would be great if i don't have to wait 1 minute after boot to play a sound.
|
|
|
04-07-2006, 12:26 PM
|
#7
|
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870
|
what part of the startup is taking a minute?? please be as specific as possible...
the way i see it, you have two separate issues:
1) your weird startup time thing
2) your installation of a sound server and/or your configuration of alsa to achieve multi-sound...
|
|
|
04-07-2006, 12:35 PM
|
#8
|
Member
Registered: Sep 2005
Distribution: Debian
Posts: 304
Original Poster
Rep:
|
Sorry, i will be as much specific as i can.
I always had an weird problem on Debian, after boot (when everything is up, including KDE) if i open something that play any kind of sound it says my sound card is in use.
Like if i try to play a mp3 with xmms, it says my sound card is in use and keeps there on 00:00. After one minute (about), it starts playing.
I´ve tried the tip that foo_bar_foo have talked. Well it worked, as soon as kde opened, i could play a song on xmms and watch a video o mplayer. The problem is that it was lagged and really noisy. I could not fix it.
So, i was wondering if there is another way to do this.
|
|
|
04-07-2006, 12:48 PM
|
#9
|
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870
|
so when you apt-get esound and then you tell xmms to use esound instead of alsa or oss it doesn't work?? what kinda error does it give??
|
|
|
04-08-2006, 07:28 PM
|
#10
|
Member
Registered: Sep 2005
Distribution: Debian
Posts: 304
Original Poster
Rep:
|
It gives this error...
Code:
Please, verify if:
Your sound card is correctely configured.
You selected the right output plugin.
Any other program is blocking your sound card.
Asking again, after doing apt-get install esound, i don't have to run anything right? esound autoconfs itself?
|
|
|
04-08-2006, 07:37 PM
|
#11
|
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870
|
well, on slackware i didn't have to do anyting after installing esound...
i was able to use it right away... i don't use xmms, i use audacious, but it's kinda the same crap... i did recompile audacious in order for it to recognize i had esound... but i'm pretty sure debian's xmms would have already been compiled with esound support, as esound is part of the official debian repositories and stuff...
when you get that error you aren't running arts or anything, right??
i actually got rid of esound after a few minutes of usage, as i realized alsa was letting me play several sounds at once by itself... i installed alsa like yesterday or the day before...
|
|
|
04-09-2006, 01:43 AM
|
#12
|
Senior Member
Registered: Jun 2004
Posts: 2,553
Rep:
|
sorry it took so long to get back
first in the KDE controll make sure you uncheck
"enable the sound system"
restart KDE
then set your apps to use alsa as output never arts
if that doesn't help trade the ~/.asoundrc with this one (mine -- very messy)
i have given it to people here before and it has helped
Code:
pcm.jackplug {
type plug
slave { pcm "jack" }
}
pcm.jack {
type jack
playback_ports {
0 alsa_pcm:playback_1
1 alsa_pcm:playback_2
}
capture_ports {
0 alsa_pcm:capture_1
1 alsa_pcm:capture_2
}
}
pcm.dsp {
type plug
# slave.pcm "dmixer"
slave.pcm "duplex"
}
pcm.dsp0 {
type plug
# slave.pcm "dmixer"
slave.pcm "duplex"
}
# this makes native ALSA apps default to using dmix
pcm.!default {
type plug
# slave.pcm "dmixer"
slave.pcm "duplex"
}
ctl.!default {
type hw
card 0
}
pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
# period_time 0 # set to 0 lets period size and buffer size do everything
period_time 2 # this is the general standard even though often is set to 0
# period_time 84000
# period_size 512
period_size 1024 # oss period frames this is the one shown as hardware
# period_size 2048
# period_size 4096 # not great to go over this
# buffer_time 340000
# buffer_size 16384 # this is the one shown as hardware but causes huge mess
# buffer_size 8192
# buffer_size 4096
buffer_size 2052 # this is the one i use
rate 44100 # can let card decide this on it's own this one is what hardware says
# rate 48000
}
bindings {
0 0
1 1
}
}
ctl.dmixer {
type hw
card 0
}
ctl.mixin {
type hw
card 0
}
pcm.duplex{
type asym
playback.pcm "dmixer"
capture.pcm "mixin"
}
pcm.mixin {
type dsnoop
ipc_key 5978293 # must be unique for all dmix plugins!!!!
ipc_key_add_uid yes
slave {
pcm "hw:0,0"
channels 2
# period_size 1024
period_size 1026
# buffer_size 4096
buffer_size 2052
rate 44100
# periods 0
period_time 2
}
bindings {
0 0
0 1
}
}
|
|
|
04-09-2006, 12:57 PM
|
#13
|
Member
Registered: Sep 2005
Distribution: Debian
Posts: 304
Original Poster
Rep:
|
Quote:
Originally Posted by win32sux
well, on slackware i didn't have to do anyting after installing esound...
i was able to use it right away... i don't use xmms, i use audacious, but it's kinda the same crap... i did recompile audacious in order for it to recognize i had esound... but i'm pretty sure debian's xmms would have already been compiled with esound support, as esound is part of the official debian repositories and stuff...
when you get that error you aren't running arts or anything, right??
i actually got rid of esound after a few minutes of usage, as i realized alsa was letting me play several sounds at once by itself... i installed alsa like yesterday or the day before...
|
Can tou tell the steps you did on slack to make it work? I installed xmms (have esound) and installed esound, but when i try to open fuhquake, xmms stops working and fuhquake doesn't have any sound.
foo_bar_foo
Thanks, i'll try it as soon as i get home.
|
|
|
All times are GMT -5. The time now is 06:16 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
|
|