[SOLVED] only one application can use sound

You have a problem with Salix? Post here and we'll do what we can to help.
User avatar
witek
Posts: 233
Joined: 16. Nov 2009, 13:41
Location: Poland.Łódź

[SOLVED] only one application can use sound

Post by witek »

I realized that only one application can use sound, ie. VLC blocks mplayer or flash plugin and vice-versa. is there a way to make several applications use sound device?
Last edited by witek on 5. May 2012, 15:57, edited 1 time in total.
User avatar
gapan
Salix Wizard
Posts: 6368
Joined: 6. Jun 2009, 17:40

Re: only one application can use sound

Post by gapan »

That's because one of those applications is configured to use OSS. If you use ALSA for all applications, you won't have any problems like that.
Image
Image
User avatar
witek
Posts: 233
Joined: 16. Nov 2009, 13:41
Location: Poland.Łódź

Re: only one application can use sound

Post by witek »

I set both VLC and SMplayer to use ALSA, and still the same: only one can use audio.
In another distro with pulseaudio many application can use audio simultaneously.
By the way, how to make flash plugin use ALSA?
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: only one application can use sound

Post by thenktor »

gapan wrote:If you use ALSA for all applications, you won't have any problems like that.
As long as no application is configured to use the sound hardware directly (e.g. "hw:0,1").
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: only one application can use sound

Post by thenktor »

witek wrote:I set both VLC and SMplayer to use ALSA, and still the same:
Which audio output devices did you configure in these apps?
witek wrote:By the way, how to make flash plugin use ALSA?
Should be default I guess.
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
User avatar
witek
Posts: 233
Joined: 16. Nov 2009, 13:41
Location: Poland.Łódź

Re: only one application can use sound

Post by witek »

I configured ALSA and default device, however in the file .asoundrc I have something like this in order to have sound in flash at all. What can I change?:

Code: Select all

pcm.!default {
 type hw
 card 1
}

ctl.!default {
 type hw
 card 1
}
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: only one application can use sound

Post by thenktor »

You have configured your ALSA default device to use your sound hardware directly and as most sound hardware it is not able to mix different signal sources. Therefore ALSA uses dmix (a software mixer) as default, so different sources can be played at the same time with every hardware.

Here is a example:

Code: Select all

pcm.!default {
        type dmix
        ipc_key 1001
        slave {
                pcm "hw:0,0" # for ICE1724's analog output
                format S32_LE
                period_size 1024
                buffer_size 4096
                rate 44100 # see cat /proc/asound/card0/pcm0p/sub0/hw_params
        }
}
(note: format or rate probably can be removed or have to be changed)

PS: no idea why your flash needs some ALSA extra config to work
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
User avatar
aurlaent
Donor
Posts: 106
Joined: 1. Feb 2012, 19:46
Location: Sydney, Australia

Re: only one application can use sound

Post by aurlaent »

If there is more than one sound device, I find that ALSA sometimes detects them in a different order.
I have to use the same sort of ALSA config to get flash to stop trying to play sound through my webcam.
Alex
Posts: 25
Joined: 10. Jan 2012, 16:39

Re: only one application can use sound

Post by Alex »

thenktor wrote:
gapan wrote:If you use ALSA for all applications, you won't have any problems like that.
As long as no application is configured to use the sound hardware directly (e.g. "hw:0,1").
Thanks!
I hated Skype because of being not able to listen to music while speaking with somebody. Now I'm able :)
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: only one application can use sound

Post by thenktor »

aurlaent wrote:If there is more than one sound device, I find that ALSA sometimes detects them in a different order.
I have to use the same sort of ALSA config to get flash to stop trying to play sound through my webcam.
It's possible to define the order. Search the ALSA wiki how to do it ;)
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
Post Reply