Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Audio only works one program at a time
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
zeinguteiw
n00b
n00b


Joined: 05 Dec 2016
Posts: 4

PostPosted: Wed Dec 14, 2016 4:42 am    Post subject: [Solved] Audio only works one program at a time Reply with quote

I got my audio working on a fresh install, but only one program can be playing audio at once. Even within programs, for example, if I play a youtube video in firefox I can hear sound fine, but if I open up another tab and try watching another youtube video no sound comes out. My system worked fine on Ubuntu, how can I get different audio streams to mix and not cause issues?

Also, another example, if I play a youtube video with firefox and then try to play a video with mplayer I get the following error:
[AO_ALSA] Playback open error: Device or resource busy
DVB card number must be between 1 and 4


Last edited by zeinguteiw on Thu Dec 15, 2016 5:39 am; edited 1 time in total
Back to top
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 541
Location: Germany

PostPosted: Wed Dec 14, 2016 8:50 am    Post subject: Reply with quote

Most of the cards now allow only 1 playback at a time. There are some cards that allow more than one, but looks like it is not your case. So, if you want to have multiple applications using audio, then you have to enable "dmix" for ALSA, or install some server like pulseaudio or Jack. On my system I have Intel HDA card (snd_hda_intel driver). To enable dmix I've placed following into my /etc/asound.conf

Quote:


ctl.!default {
type hw
card 1
}
pcm.!default{
type asym
playback.pcm {
type plug
slave.pcm "dmix:CARD=1,RATE=48000"
}
}


My "HDA Intel PCH" is listed as card 1 by "aplay -l", that is why asound.conf references it. In your case it might be different card, so adjust the configuration accordingly.
Back to top
View user's profile Send private message
zeinguteiw
n00b
n00b


Joined: 05 Dec 2016
Posts: 4

PostPosted: Thu Dec 15, 2016 5:38 am    Post subject: Reply with quote

Yes, thank you, that is what I ended up doing. I realized this is mentioned on the ALSA wiki page: https://wiki.gentoo.org/wiki/ALSA#Soundcard_only_available_for_one_application
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Mon Dec 26, 2016 7:06 pm    Post subject: Reply with quote

v_andal wrote:
Most of the cards now allow only 1 playback at a time. There are some cards that allow more than one, but looks like it is not your case. So, if you want to have multiple applications using audio, then you have to enable "dmix" for ALSA, or install some server like pulseaudio or Jack. On my system I have Intel HDA card (snd_hda_intel driver). To enable dmix I've placed following into my /etc/asound.conf

Quote:


ctl.!default {
type hw
card 1
}
pcm.!default{
type asym
playback.pcm {
type plug
slave.pcm "dmix:CARD=1,RATE=48000"
}
}


My "HDA Intel PCH" is listed as card 1 by "aplay -l", that is why asound.conf references it. In your case it might be different card, so adjust the configuration accordingly.


Might try this out once I grow tired of pulseaudio,

*subscribing*

Thanks
_________________
https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Back to top
View user's profile Send private message
geol
n00b
n00b


Joined: 18 Dec 2018
Posts: 11

PostPosted: Tue May 19, 2020 7:44 am    Post subject: Reply with quote

Hi I encountered exactly the same issue. I will try your solutions tomorrow and will let you know if it works for me. Thanks.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6098
Location: Dallas area

PostPosted: Tue May 19, 2020 10:02 am    Post subject: Reply with quote

The only problem with multiple sources and alsa by way of slave, is that it doesn't sound as nice (clear,sharp,etc), since the rate is limited to 48000 which triggers on software mixing. IIRC.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
geol
n00b
n00b


Joined: 18 Dec 2018
Posts: 11

PostPosted: Tue May 19, 2020 2:34 pm    Post subject: Reply with quote

Anon-E-moose wrote:
The only problem with multiple sources and alsa by way of slave, is that it doesn't sound as nice (clear,sharp,etc), since the rate is limited to 48000 which triggers on software mixing. IIRC.


Thanks for the reminder! I can confirm that the solution does work.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum