[SOLVED] only one application can use sound

You have a problem with Salix? Post here and we'll do what we can to help.

[SOLVED] only one application can use sound

Postby witek » 3. May 2012, 14:19

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
witek
 
Posts: 207
Joined: 16. Nov 2009, 13:41
Location: Poland.Łódź

Re: only one application can use sound

Postby gapan » 3. May 2012, 14:48

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
User avatar
gapan
Salix Wizard
 
Posts: 3481
Joined: 6. Jun 2009, 17:40

Re: only one application can use sound

Postby witek » 3. May 2012, 16:02

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
witek
 
Posts: 207
Joined: 16. Nov 2009, 13:41
Location: Poland.Łódź

Re: only one application can use sound

Postby thenktor » 3. May 2012, 16:05

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)
last.fm (my last.fm profile)
User avatar
thenktor
Salix Wizard
 
Posts: 2393
Joined: 6. Jun 2009, 14:47
Location: Franconia

Re: only one application can use sound

Postby thenktor » 3. May 2012, 16:14

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)
last.fm (my last.fm profile)
User avatar
thenktor
Salix Wizard
 
Posts: 2393
Joined: 6. Jun 2009, 14:47
Location: Franconia

Re: only one application can use sound

Postby witek » 3. May 2012, 16:19

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
witek
 
Posts: 207
Joined: 16. Nov 2009, 13:41
Location: Poland.Łódź

Re: only one application can use sound

Postby thenktor » 4. May 2012, 12:06

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)
last.fm (my last.fm profile)
User avatar
thenktor
Salix Wizard
 
Posts: 2393
Joined: 6. Jun 2009, 14:47
Location: Franconia

Re: only one application can use sound

Postby aurlaent » 4. May 2012, 21:29

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.
User avatar
aurlaent
 
Posts: 48
Joined: 1. Feb 2012, 19:46
Location: Sydney, Australia

Re: only one application can use sound

Postby Alex » 5. May 2012, 06:15

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 :)
Alex
 
Posts: 25
Joined: 10. Jan 2012, 16:39

Re: only one application can use sound

Postby thenktor » 5. May 2012, 10:00

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)
last.fm (my last.fm profile)
User avatar
thenktor
Salix Wizard
 
Posts: 2393
Joined: 6. Jun 2009, 14:47
Location: Franconia

Next

Return to Problems