LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   No 2 programs can play sound at the same time? (https://www.linuxquestions.org/questions/linux-newbie-8/no-2-programs-can-play-sound-at-the-same-time-4175579397/)

dwnthk 05-10-2016 03:07 AM

No 2 programs can play sound at the same time?
 
Hi there,

Sometimes I watch movies, listen musics/radio, and tts (text-to-speech) books at the same time.

But I found whichever program I start making sound, no other programs can make a sound anymore.

Did I miss some setting?

HMW 05-10-2016 04:28 AM

Quote:

Originally Posted by dwnthk (Post 5543042)
Sometimes I watch movies, listen musics/radio, and tts (text-to-speech) books at the same time.

:eek:

Congratulations! You just won the gold medal in the olympics for multitaskers.

Jokes aside, sorry, can't help you. A Slackware guru will most likely pop in soon and help you out.

Best regards,
HMW

dwnthk 05-10-2016 04:42 AM

Quote:

Originally Posted by HMW (Post 5543068)
:eek:

Congratulations! You just won the gold medal in the olympics for multitaskers.

Jokes aside, sorry, can't help you. A Slackware guru will most likely pop in soon and help you out.

Best regards,
HMW

That's why I always got a bad grade in school... :banghead:
But I just can't help myself from doing this...

Hasek39 05-10-2016 05:43 AM

If your profile's distribution is Slackware 14.1, I think that you use ALSA. Can you please post /etc/asound.conf? If there are no such file show "cat /proc/asound/modules" and output of "aplay -L".

P.S. Maybe the solution will be to create or edit /etc/asound.conf with something like
Code:

defaults.ctl.card 1
defaults.pcm.card 1

But I can't be sure until you post output of previous commands and files.

zhjim 05-10-2016 06:48 AM

If recently nothing happened ALSA will always only give control over the sound device to one program. It just by design.

You could try pulseaudio. This is a wrapper over alsa. It takes control over the sound card and other programs give their output to pulseaudio.

Hasek39 05-10-2016 07:07 AM

Quote:

Originally Posted by zhjim (Post 5543130)
If recently nothing happened ALSA will always only give control over the sound device to one program. It just by design.

You could try pulseaudio. This is a wrapper over alsa. It takes control over the sound card and other programs give their output to pulseaudio.

You aren't right. The fact that ALSA plays sound from only one program by default doesn't mean that you can't configure it to work with two or more programs at the same time at all. And there is, of course, no matter to switch to PulseAudio only because of it.

zhjim 05-10-2016 07:23 AM

Always thought it was ALSA that gave only one prog the reign. But it was with OSS. Learned something new.

Two links I read up on.

http://alsa.opensrc.org/AlsaSharing
https://wiki.archlinux.org/index.php...hitecture#Dmix

dwnthk 05-10-2016 08:23 PM

Quote:

Originally Posted by zhjim (Post 5543148)
Always thought it was ALSA that gave only one prog the reign. But it was with OSS. Learned something new.

Two links I read up on.

http://alsa.opensrc.org/AlsaSharing
https://wiki.archlinux.org/index.php...hitecture#Dmix


It is ok if only one program can make sound at a time.
Thanks guys.

aragorn2101 05-11-2016 04:09 AM

Hey, I have alsa and I have no problem playing movies on vlc and watching video in firefox or playing music with amarok at the same time. From what I have read somewhere, alsa takes the sound from each source and mixes them.

In fact, I once tried pulseaudio and I had that one sound per program issue. Whenever I would open vlc, any other program already playing would lose access to speakers. But with alsa it works fine.

I might be wrong, but maybe it has something to do with gstreamer and the gst plugins. I noticed that without the plugins there are less support for programs like amarok.

You could try to install the gstreamers and the gst plugins (good, bad, ugly). Just check which ones already come with Slackware.

dwnthk 05-11-2016 05:06 AM

Quote:

Originally Posted by aragorn2101 (Post 5543684)
Hey, I have alsa and I have no problem playing movies on vlc and watching video in firefox or playing music with amarok at the same time. From what I have read somewhere, alsa takes the sound from each source and mixes them.

In fact, I once tried pulseaudio and I had that one sound per program issue. Whenever I would open vlc, any other program already playing would lose access to speakers. But with alsa it works fine.

I might be wrong, but maybe it has something to do with gstreamer and the gst plugins. I noticed that without the plugins there are less support for programs like amarok.

You could try to install the gstreamers and the gst plugins (good, bad, ugly). Just check which ones already come with Slackware.

It is strange. For example, if I am playing youtube in firefox, anything else can't make a sound. The same thing happens to others situations too.

Hasek39 05-11-2016 07:25 AM

Quote:

Originally Posted by dwnthk (Post 5543698)
It is strange. For example, if I am playing youtube in firefox, anything else can't make a sound. The same thing happens to others situations too.

It isn't strange. We have told you that ALSA can successfully works with more than one program at the same time. Please, read previous messages if you want to fix your problem and post output of console commands that I asked for.

Quote:

Originally Posted by Hasek39 (Post 5543090)
If your profile's distribution is Slackware 14.1, I think that you use ALSA. Can you please post /etc/asound.conf? If there are no such file show "cat /proc/asound/modules" and output of "aplay -L".

P.S. Maybe the solution will be to create or edit /etc/asound.conf with something like
Code:

defaults.ctl.card 1
defaults.pcm.card 1

But I can't be sure until you post output of previous commands and files.

Quote:

Originally Posted by Hasek39 (Post 5543140)
You aren't right. The fact that ALSA plays sound from only one program by default doesn't mean that you can't configure it to work with two or more programs at the same time at all. And there is, of course, no matter to switch to PulseAudio only because of it.


dwnthk 05-11-2016 08:00 AM

Oh...I am sorry. I wasn't paying attention here.

Here you go:

Quote:

[dw@bash-4.2]$cat /proc/asound/modules
0 snd_hda_intel
1 snd_usb_audio
29 thinkpad_acpi
[dw@bash-4.2]$

Quote:

[dw@bash-4.2]$aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=PCH
HDA Intel PCH, CX20590 Analog
Default Audio Device
front:CARD=PCH,DEV=0
HDA Intel PCH, CX20590 Analog
Front speakers
surround40:CARD=PCH,DEV=0
HDA Intel PCH, CX20590 Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
HDA Intel PCH, CX20590 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
HDA Intel PCH, CX20590 Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
HDA Intel PCH, CX20590 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
HDA Intel PCH, CX20590 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=PCH,DEV=0
HDA Intel PCH, HDMI 0
HDMI Audio Output
sysdefault:CARD=Z205
Logitech Z205, USB Audio
Default Audio Device
front:CARD=Z205,DEV=0
Logitech Z205, USB Audio
Front speakers
surround40:CARD=Z205,DEV=0
Logitech Z205, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=Z205,DEV=0
Logitech Z205, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Z205,DEV=0
Logitech Z205, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Z205,DEV=0
Logitech Z205, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Z205,DEV=0
Logitech Z205, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Z205,DEV=0
Logitech Z205, USB Audio
IEC958 (S/PDIF) Digital Audio Output
[dw@bash-4.2]
And I already have a asound.conf:
Quote:

[dw@bash-4.2]$cat /etc/asound.conf
# Force USB speaker to default
pcm.!default {
type hw
card Z205
}

ctl.!default {
type hw
card Z205
}
[dw@bash-4.2]$


Hasek39 05-11-2016 01:44 PM

Ok, so I suggest to edit /etc/asound.conf to the
Code:

defaults.ctl.card 1
defaults.pcm.card 1

I think that may fix it. If it wouldn't fix problem than try to specify 0 or 29 instead of 1. And if after all of that there will be no result replace it with your original settings.


All times are GMT -5. The time now is 08:40 PM.