LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-28-2009, 06:16 PM   #1
Arla
Member
 
Registered: Jun 2005
Location: SE
Distribution: Gentoo, k 2.6.24
Posts: 48

Rep: Reputation: 15
ALSA. 2 cards. Firefox no sound.


I have two sound cards and I think that I have now got a grip on how to manage them and refer to each of them in different situations.

For MPlayer, I can use -ao or edit ~/.mplayer/config.
In MPD, i can deal with the audio_outputs in /etc/mpd.conf.
However, Firefox doesn't give any sound when I play Flash or plugins. Except if I start playing something with MPD and then start the Flash object in Firefox. In that case, the Flash starts to play through card 0 (MPD is card 1).

Why does it only play if MPD is already playing?
How does Firefox select its sound card? This one solved. See post 7 and post 5.

Thanks.

Last edited by Arla; 10-05-2009 at 10:52 AM. Reason: Striking one of the two questions out.
 
Old 09-29-2009, 04:11 PM   #2
AngTheo789
Member
 
Registered: Sep 2009
Posts: 110

Rep: Reputation: 24
I guess that Firefox simply uses the first available sound card that is listed by the system. I am not aware of any Firefox setting that would allow dealing with hardware matters directly. It's not even sure that Firefox is at fault here. Have you ever tried to run Skype on that box and checked what soundcard it uses by default?
 
Old 09-29-2009, 05:17 PM   #3
Arla
Member
 
Registered: Jun 2005
Location: SE
Distribution: Gentoo, k 2.6.24
Posts: 48

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by AngTheo789 View Post
Have you ever tried to run Skype on that box and checked what soundcard it uses by default?
It uses the one that ALSA calls card 0.
 
Old 09-30-2009, 04:16 AM   #4
JwN
LQ Newbie
 
Registered: Aug 2005
Location: Finland
Posts: 1

Rep: Reputation: 0
What are these two soundcards.

I have similiar problem with my motherboard integrated and ATI 3650 HDMI.

Alsa used ATI as a card 0 and Integrated as card 1 and refused to swap.

Amarok, smplayer worked fine, but youtube etc. no sound.
I managed to get sound form youtube, but no sound from Amarok etc.

Only way to work this out (in my opinion),is disable integrated sound (from bios) and get soundcard SB or similiar.
Now all fine.

But if you have 2 real soundcards try to disable other one.

Last edited by JwN; 09-30-2009 at 04:18 AM.
 
Old 09-30-2009, 06:10 AM   #5
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 1,506

Rep: Reputation: 233Reputation: 233Reputation: 233
You can re-index your driver modules to make your default card be card 0.

cat /proc/asound/cards

And card 0 seems to be the default for web browsers and other applications like festival. There are tricks to get firefox and such to use pulse audio and other sound methods. But it's generally just best to set your modules up so that the card you want to use is card 0.

For example, on my system, in /etc/modprobe.d/alsa_custom.conf

#-----
alias char-major-116 snd
alias char-major-14 soundcore

options snd major=116 cards_limit=3

options snd-atiixp index=0
options snd-atiixp-modem index=1
options snd-usb-audio index=2

alias snd-card-0 snd-atiixp
alias snd-card-1 snd-atiixp-modem
alias snd-card-2 snd-usb-audio

alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss

alias sound-slot-1 snd-card-1
alias sound-service-1-0 snd-mixer-oss
alias sound-service-1-1 snd-seq-oss
alias sound-service-1-3 snd-pcm-oss
alias sound-service-1-8 snd-seq-oss
alias sound-service-1-12 snd-pcm-oss

alias sound-slot-2 snd-card-2
alias sound-service-2-0 snd-mixer-oss
alias sound-service-2-1 snd-seq-oss
alias sound-service-2-3 snd-pcm-oss
alias sound-service-2-8 snd-seq-oss
alias sound-service-2-12 snd-pcm-oss
#-----

If I need to change that around, I just change the index numbers and module association. And then run:

/etc/init.d/alsasound stop
/etc/init.d/alsasound start

There's other tricks too. Start the browser with aoss, but as soon as you open in new window and the likes that goes out the window. Or add / change this line in your ~/.asoundrc:

defaults.pcm.card 0

But that only works if the application uses alsa natively. Which your typical web browser does not. And other means to an end.

HTH
 
Old 10-02-2009, 02:46 PM   #6
Arla
Member
 
Registered: Jun 2005
Location: SE
Distribution: Gentoo, k 2.6.24
Posts: 48

Original Poster
Rep: Reputation: 15
I think I'm being a bit misunderstood here. I know how to set default ALSA sound card. I also know how to switch between them in several applications. However this does not go for Firefox. Instead, it seems to always use the default card. This is of course not surprising, but I would certainly prefer to be able to control that.

Furthermore, and more importantly, Firefox generally doesn't play sound at all. I have however made it happen a couple of times, when I have had MPD playing as the Firefox sound started playing, as said in first post.

arla@ezekiel ~> cat /proc/asound/cards
0 [M2496 ]: ICE1712 - M Audio Audiophile 24/96
M Audio Audiophile 24/96 at 0xbca0, irq 16
1 [Intel ]: HDA-Intel - HDA Intel
HDA Intel at 0xfebfc000 irq 16
 
Old 10-04-2009, 11:38 AM   #7
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 1,506

Rep: Reputation: 233Reputation: 233Reputation: 233
Yes, firefox defaults to card 0. That's pretty much a given. There's a few tricks with pulse-audio and other means to override that. But it's pretty safe to assume that firefox will always default to card 0. The above change in configuration changes your default card 0 to your desired card. If used/customized for your system.

$ aoss firefox-bin

Works up until the point that you open a new browser from within the browser. At which point the child process is NOT started with aoss. Pretty much the same as artsdsp or esddsp, or many of the other means of sharing a single soundcard among several applications at the same time. dmix helps and defaults for alsa these days, but it assumes that the application uses alsa by default, which firefox does not. aoss tricks it, within limits.

HTH
 
Old 10-05-2009, 10:46 AM   #8
Arla
Member
 
Registered: Jun 2005
Location: SE
Distribution: Gentoo, k 2.6.24
Posts: 48

Original Poster
Rep: Reputation: 15
Okay, one of my two questions is answered: Firefox does use card 0 and it can be overridden with hacks.

Now the other (and most important question) remains: Why does Firefox only play sound given the mentioned - peculiar - condition?
 
Old 10-05-2009, 04:34 PM   #9
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 1,506

Rep: Reputation: 233Reputation: 233Reputation: 233
It really depends on your system's configuration. KDE seems to wrap applications a little better with artsd as the sound daemon to share the device. And there are a few applications that bring up artsd when they access sound. pidgin, rosegarden, ..... I'm not usually using more than one sound generating application at a time, so I don't have an issue shuffling my card order. festival and a few other apps, mainly those geared towards multi-platform are the ones affected. They were written a while back based on OSS and were never updated to use alsa. Or their condition / licensing prevents them from being updated. Who knows, I don't deal with that half.

Basically it's an OSS thing. Those apps that use /dev/dsp directly, and they tend to hog the device in the process. Those are the ones that exhibit this type of behavior. festival will work with esddsp, but it tries to say all of the words in a sentence at the same time. And if you want to record from the pcm device, it's much easier to just let it default to card 0.

On the flip side, some soundcards have hardware mixers. If you can setup alsa to use that ability and keep the first two channels in that mixer clear. You can make it behave more normally with only using one of your soundcards. There's so many different ways to setup and use audio, it's near impossible to tell how your system / distro is setup. When I'm recording I use jackd. When I'm playing games, I might use esd or artsd. But generally I just use alsa natively and configure my media applications to do the same.
 
  


Reply

Tags
alsa, firefox


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sound cards and alsa? ericb Linux - Hardware 3 09-07-2005 12:48 AM
Getting two sound cards to work with ALSA linuxpyro Linux - Hardware 3 08-24-2005 09:25 PM
(K)ubuntu ALSA with two sound cards. Help :) Groovelab Ubuntu 7 05-08-2005 06:03 PM
alsa + 2 sound cards atrain Linux - Hardware 2 02-13-2005 11:51 AM
ALSA + 2 Sound Cards codyman Linux - General 3 08-14-2004 09:20 AM


All times are GMT -5. The time now is 07:36 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration