You are not logged in.

#1 2009-05-25 19:17:49

Lazze
Member
From: Bangkok, Thailand
Registered: 2008-09-28
Posts: 133

[SOLVED] Can't play audio sometimes when firefox is running

Hello

I'm having some problem with my audio setup. Mostly it works fine, but sometimes when running Firefox or Virtualbox I can't play audio from my media player like VLC or Totem.

It seems like Firefox is somehow locking the audio driver, VLC outputs this error when it's locked:

[00000470] oss audio output error: cannot open audio device (/dev/dsp)

To be able to play any sound in VLC or Totem again I have to exit the blocking program, which mostly is firefox.
Any ideas how to solve this and why it occurs?

Thanks
// Lasse

Last edited by Lazze (2009-05-31 17:17:38)

Offline

#2 2009-05-25 20:44:15

Peanut
Member
From: Norway
Registered: 2009-05-24
Posts: 99

Re: [SOLVED] Can't play audio sometimes when firefox is running

There are two sound systems available for GNU/Linux: the traditional OSS (Open Sound System), and the newer ALSA (Advanced Linux Sound System). Most modern GNU/Linux systems default to using ALSA, which also provides compatibilty with the OSS API.

Your applications seem to be using the OSS approach, which involves accessing the sound device /dev/dsp directly. Unless you have a sound card with an integrated hardware mixer, this implies that only one application at a time may use the sound device.

The workaround is to add a software layer between the soundcard and the applications, that merges different sound streams into one stream. One such software mixer ("dmix") is usually preconfigured if you use ALSA, so the easy workaround is to simply use an ALSA wrapper for your OSS applications. This wrapper is easily installed with pacman (extra/alsa-oss), and then you have to launch all your OSS applications like this:

aoss COMMAND

For example:

aoss vlc

And since flashplayer-plugin is based around OSS, you also have to launch firefox like this:

aoss firefox

In the case of VLC, an easier way out may be to change the audio output driver from OSS to ALSA, but as far as I know, firefox still has to be launched with AOSS.

Offline

#3 2009-05-26 07:55:23

Lazze
Member
From: Bangkok, Thailand
Registered: 2008-09-28
Posts: 133

Re: [SOLVED] Can't play audio sometimes when firefox is running

I thought it was something like that. But shouldn't firefox and vlc run fine without oss. I haven't had this problems earlier with these applications.

Running aoss in front of every command line which uses sound seems a bit tedious.

Offline

#4 2009-05-26 09:13:13

whoops
Member
Registered: 2009-03-19
Posts: 891

Re: [SOLVED] Can't play audio sometimes when firefox is running

Maybe it just depends on what you start first and if firefox can't access oss at the time it's started, it can't hog it.

Also that wiki page might help:
http://wiki.archlinux.org/index.php/All … nd_at_once

Offline

#5 2009-05-26 14:04:26

Peanut
Member
From: Norway
Registered: 2009-05-24
Posts: 99

Re: [SOLVED] Can't play audio sometimes when firefox is running

As I mentioned earlier:

In the case of VLC, an easier way out may be to change the audio output driver from OSS to ALSA, but as far as I know, firefox still has to be launched with AOSS.

Most newer sound applications support using ALSA directly, including vlc and anything based on gstreamer, xine or mplayer. So in your case, running all your sound applications through aoss is not necessary; you just have to configure your applications (eg. vlc) to use ALSA instead.

The problem with firefox arise if you use plugins like Adobe Flashplayer. Last time I checked, the flashplayer plugin only supports the OSS API - which means that is has to be run through aoss to get along with your other audio applications. But I can't see any problem with that, you just have to modify the menu entry/desktop shortcut/whatever you use to launch firefox.

[EDIT]
I found this on the wiki page linked to by whoops:

I see a lot of posts about flash + other programs that use sound. This happens because flash uses the alsa oss emulation instead of real alsa. The fix is easy, just disable oss (almost all programs are converted to alsa these days) by blacklisting the oss module in /etc/rc.conf in the MODULES section: !snd-pcm-oss

This seems to indicate that newer versions of the flashplayer-plugin also supports using ALSA directly, can anyone comment on this?
[/EDIT]

Last edited by Peanut (2009-05-26 14:09:54)

Offline

#6 2009-05-26 19:32:31

2_Thumbs_Up
Member
Registered: 2009-05-09
Posts: 22

Re: [SOLVED] Can't play audio sometimes when firefox is running

I think that you have vmix disabled. Check for that in ossxmix.

Last edited by 2_Thumbs_Up (2009-05-26 19:37:50)

Offline

#7 2009-05-26 20:56:58

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: [SOLVED] Can't play audio sometimes when firefox is running

Peanut wrote:

[EDIT]
I found this on the wiki page linked to by whoops:

I see a lot of posts about flash + other programs that use sound. This happens because flash uses the alsa oss emulation instead of real alsa. The fix is easy, just disable oss (almost all programs are converted to alsa these days) by blacklisting the oss module in /etc/rc.conf in the MODULES section: !snd-pcm-oss

This seems to indicate that newer versions of the flashplayer-plugin also supports using ALSA directly, can anyone comment on this?
[/EDIT]

flashplugin defaults to OSS. When it realizes OSS is unavailable, it falls back to ALSA.

Offline

#8 2009-05-26 22:04:07

Peanut
Member
From: Norway
Registered: 2009-05-24
Posts: 99

Re: [SOLVED] Can't play audio sometimes when firefox is running

Peasantoid wrote:

flashplugin defaults to OSS. When it realizes OSS is unavailable, it falls back to ALSA.

OK, thanks smile

Offline

#9 2009-05-27 07:15:19

Lazze
Member
From: Bangkok, Thailand
Registered: 2008-09-28
Posts: 133

Re: [SOLVED] Can't play audio sometimes when firefox is running

Thanks for all the replies, I have been kinda busy lately and haven't had time to try any of this out.
I'll return with some results in a day or two.

Offline

#10 2009-05-31 17:16:54

Lazze
Member
From: Bangkok, Thailand
Registered: 2008-09-28
Posts: 133

Re: [SOLVED] Can't play audio sometimes when firefox is running

I found out what was wrong now, I've been a bit lazy lately so it took a while. I was missing the alsa-oss package, installing that one solved everything it seems.
Thanks for all the replies!

Cheers
// Lasse

Offline

Board footer

Powered by FluxBB