LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-11-2014, 10:00 AM   #1
af7567
Member
 
Registered: Nov 2012
Posts: 204

Rep: Reputation: 67
Firefox and .asoundrc, no HTML5 audio


Hi
I have found posts from quite a few people who have the same problem as me, Firefox won't play any HTML5 audio at all if I have a .asoundrc. The 'solution' seems to be change the module load order so your main sound card is card0 and delete your .asoundrc.

Flashplayer works fine, it is only HTML5 audio I have the problem with

Has anyone found the real reason yet why Firefox doesn't like .asoundrc? I use 2 soundcards and there is no way I can have them configured properly without using .asoundrc (or setting up every program individually if possible).

Last edited by af7567; 10-11-2014 at 10:01 AM. Reason: should mentiond flash audio is ok.
 
Old 10-11-2014, 10:33 AM   #2
Armenore
LQ Newbie
 
Registered: Jun 2010
Distribution: Slackware64
Posts: 11

Rep: Reputation: Disabled
From the Gentoo ALSA wiki:

Quote:
Some system motherboards (i.e. Asus Z87-EXPERT) cause Card 0 to be a MID device instead of a PCM device. The same driver module snd_hda_intel is used for both the MID and PCM cards on this motherboard. For some reason Firefox HTML 5 requires Card 0 of the snd_hda_intel no matter how you change it with asoundrc. You can make flash work using the asoundrc file, but HTML 5 audio is silent.
So it's apparently a combination of things. Chromium HTML 5 audio doesn't have that problem. And Firefox's works fine on my laptop with an Ivy Bridge i5 and Intel sound card - the motherboard orders the cards "correctly" for Firefox - but my Haswell Chromebook needs the module load order to be changed.

Does Firefox sound work if you switch the module load order and adjust your .asoundrc to use the "new" sound card names instead of deleting it?
 
Old 10-11-2014, 11:25 AM   #3
af7567
Member
 
Registered: Nov 2012
Posts: 204

Original Poster
Rep: Reputation: 67
Firefox also works fine on my laptop, and google chrome works on my PC with my asoundrc.

Quote:
For some reason Firefox HTML 5 requires Card 0 of the snd_hda_intel no matter how you change it with asoundrc.
I don't understand what that means. Firefox requires an intel sound card? Actually I guess it doesn't mean that because my card 0 is a sound blaster and Firefox works OK with that as long as I delete my asoundrc (even though the asoundrc sets the default playback to be 0,0 anyway)

I just had a go at playing around with the order of my soundcards and found that Firefox will play through any of them as long as they are card0 and I have no asoundrc, but as soon as I create .asoundrc I get no sound at all. The only thing I did find out is that if I use asoundrc to set the default playback to be an invalid soundcard (like my webcam or HDMI output which has nothing plugged in) then Firefox will freeze when trying to play the video - so it must actually be using the values from the asoundrc for something.
 
Old 10-11-2014, 12:41 PM   #4
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 7,567

Rep: Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923
First, are you sure you can't resolve this with module options? You can use slots if the two cards have different drivers, and index if the two cards have the same driver.

See: http://alsa.opensrc.org/MultipleCards

Second, could you please post your .asoundrc? An .asoundrc to send audio to card 1, device 3 (for example) should consist only of the following, and it should use the same "inline" syntax:

Code:
defaults.pcm.card 1
defaults.pcm.device 7
defaults.ctl.card 1
 
1 members found this post helpful.
Old 10-11-2014, 05:31 PM   #5
schmatzler
Member
 
Registered: Jan 2011
Location: Germany
Distribution: Slackware64 -current + Multilib
Posts: 402

Rep: Reputation: 171Reputation: 171
I use an external USB sound card by default. My complete .asoundrc is a bit bigger, but Firefox also works when I strip it down to this:

Code:
#Define the default device via "aplay -l"
#My CM6206 is hw2:0
pcm.!default {
        type hw
        card 2
        device 0
}

#Define the default control
ctl.!default {
        type hw
        card 2
        device 0
}
 
Old 10-12-2014, 12:31 AM   #6
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 7,567

Rep: Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923
Uhm, schmatzler, are you able to play more than one sound a time with that .asoundrc? In my experience, .asoundrc files that are laid out like that override too much, including getting rid of DMix.

I would change it to:

Code:
defaults.pcm.card 2
defaults.ctl.card 2
Which would simply change the default card to #2 and leave every other setting intact.

The two formats are not equivalent.
 
1 members found this post helpful.
Old 10-12-2014, 03:01 AM   #7
schmatzler
Member
 
Registered: Jan 2011
Location: Germany
Distribution: Slackware64 -current + Multilib
Posts: 402

Rep: Reputation: 171Reputation: 171
Quote:
Originally Posted by dugan View Post
Uhm, schmatzler, are you able to play more than one sound a time with that .asoundrc?
It was just a stripped-down example. I have included dmix in my .asoundrc, so I can play more than one sound at a time.
 
Old 10-12-2014, 09:17 AM   #8
af7567
Member
 
Registered: Nov 2012
Posts: 204

Original Poster
Rep: Reputation: 67
My latest .asoundrc which wouldn't work was
Code:
pcm.!default
{
       type asym

       playback.pcm "hw:0,0"
       capture.pcm "hw:1,0"
}
This is a completely stripped down version to my normal one which was using dmix and dsnoop to make games/teamspeak/desktop recording all work ok together. Everything else was working OK with that, just not firefox.

Last edited by af7567; 10-12-2014 at 09:40 AM. Reason: I obviously can't read
 
Old 10-17-2014, 12:46 PM   #9
af7567
Member
 
Registered: Nov 2012
Posts: 204

Original Poster
Rep: Reputation: 67
This problem has now been fixed with the Firefox 33 update.

edit: No it's not fixed. I was accidentally viewing the flash video instead of the HTML5 one

Last edited by af7567; 10-17-2014 at 01:30 PM.
 
Old 10-18-2014, 04:27 PM   #10
gegechris99
Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware 14.2 64bit
Posts: 901
Blog Entries: 4

Rep: Reputation: 133Reputation: 133
As suggested by dugan, I modified my .asoundrc from
Code:
pcm.!default {
type hw
card 1
}

ctl.!default {
type hw
card 1
}
to

Code:
defaults.pcm.card 1
defaults.pcm.device 0
defaults.ctl.card 1
and now HMTL5 sound works in Firefox. Other sound applications (flash videos in firefox, amarok) continue to work as before.
 
Old 09-13-2015, 05:57 PM   #11
coldbeer
Member
 
Registered: May 2006
Location: Orion–Cygnus Arm, MWG
Distribution: Slackware 14.2
Posts: 213

Rep: Reputation: 121Reputation: 121
Sorry for the old thread but I just got bit by this and have spent the past week trying to no avail to fix this until I found this thread.

Slackware 14.1-64 setup. I am trying to connect to my TV through HDMI. Symptoms were: Playing sound files ok, Chrome on youtube ok, Firefox on youtube no sound.

Code:
bash-4.2$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC662 rev3 Analog [ALC662 rev3 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
On first setup for HDMI I changed .asoundrc to:
Code:
 pcm.!default {   
    type hw
    card 0
    device 3
    }
  ctl.!default { 
    type hw
    card 0
    }
The above allowed Chrome and audio files to playback via hdmi. Firefox still no audio.

To get firefox to work I changed .asoundrc to the following:
Code:
defaults.pcm.card 0
defaults.pcm.device 3
defaults.ctl.card 0
Now everything works! But I don't understand why.

What's the diff between the configs with brackets and the ones without that would have firefox not work with one but work with the other?
 
Old 09-13-2015, 08:42 PM   #12
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 7,567

Rep: Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923
Quote:
Originally Posted by coldbeer View Post
What's the diff between the configs with brackets and the ones without
The config without the brackets overrides only the settings listed. This is what you want and expect.

The config with the brackets overrides the entire section. "defaults.pcm {}" will throw out every setting that /usr/share/alsa/alsa.conf defines for your PCM defaults and replace them, all of them, with what's between the brackets. This is generally not what you want or expect. It's also why you need to manually add a DMix section if you use the brackets syntax.
 
Old 09-14-2015, 09:17 AM   #13
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware has beern Main OpSys for decades while testing others to keep up
Posts: 1,470

Rep: Reputation: 1414Reputation: 1414Reputation: 1414Reputation: 1414Reputation: 1414Reputation: 1414Reputation: 1414Reputation: 1414Reputation: 1414Reputation: 1414
ping Dugan

Greetings

I do some semi-pro quality audio recording and editing and would prefer a decent compromise audio setup these days as opposed to a special session, since I spend more time doing the usual mundane things than serious work. For the daily usual stuff I very much like having a systemwide Graphic EQ. I am currently using the base asoundrc (see below) from the EQ developer and simply have my own cards info inserted. This works very well except sometimes in Firefox. It baffles me as to why sound comes and goes with Firefox but I can see how the brackets may confine Firefox perhaps depending on Firefox version or other variables. I would like to make Firefox consistent.

My question is if I wish to continue using the EQ systemwide how can I declare it in asoundrc and also make Firefox happy?


Code:
### equalizer $HOME/.asoundrc ###
pcm.plugequal {
  type equal;
  # Modify the line below if you don't
  # want to use sound card 0.
  slave.pcm "plughw:0,0";
  # or if you want to use with multiple applications output to dmix
  # slave.pcm "plug:dmix"
}

pcm.equal {type plug;
    slave.pcm plugequal;
}
  # Or if you want the equalizer to be your
  # default soundcard uncomment the following
  # line and comment the above line.
#pcm.!default {
#	type hw
#	card 0
#}

ctl.!default {
	type hw           
	card 0
}

pcm.ice1724 {
          type hw
          card 0
       }
       
       ctl.ice1724 {
          type hw
          card 0
       }
ctl.equal {
	type equal;
}
Any information or link to an appropriate location gratefully accepted. Thank you.
 
Old 09-14-2015, 09:40 AM   #14
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 7,567

Rep: Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923
Do you really need this section?

Code:
ctl.!default {
	type hw           
	card 0
}
(Just a guess, of course).
 
Old 09-14-2015, 12:45 PM   #15
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware has beern Main OpSys for decades while testing others to keep up
Posts: 1,470

Rep: Reputation: 1414Reputation: 1414Reputation: 1414Reputation: 1414Reputation: 1414Reputation: 1414Reputation: 1414Reputation: 1414Reputation: 1414Reputation: 1414
Quote:
Originally Posted by dugan View Post
Do you really need this section?

Code:
ctl.!default {
	type hw           
	card 0
}
(Just a guess, of course).
Greetings
The above quoted section was in the original example from the EQ app and I chose to keep it figuring it may affect smooth routing such as when utilizing Jack and possibly even the EQ itself. I tried commenting it out and it did not fix HTML5 audio such as in Firefox > YouTube as it still doesn't work.

I love how Slackware in general never acts like an underfoot butler, letting me change or keep things, doing nothing that I don't expressly call for or deny but that does not extend to areas outside it's purview and that sometimes includes audio which has gotten better but is still rather messy in Linux. For example sometimes KDE is a culprit in that even just bumping the USB cable to my webcam causes KDE Multimedia Settings to popup a "helper" <sigh> window asking me if I want to permanently forget about the USB audio device. However that is merely annoying. Some issues are actually problematic.

Some comm apps don't play nicely with that USB microphone and require restarting the app a few times or reasserting default communication capture device in KDE System Settings > Multimedia > Phonon before it finally recognizes the mic. I only mention this in this thread because such interruptions instigate fussing instead of set it and forget it.

Now I still don't have sound with Firefox on YouTube HTML5 and somewhere along the line my systemwide Alsa EQ stopped working. It still shows up and active with "alsamixer -D equal" but moving the faders has no effect anymore so I have some deeper troubleshooting to do.

I surely would love to get it all right and then just lock it down.

Anyway I was wondering if dumping the bracketed settings for the "defaults - " would fix my Firefox/YouTube sound problems without destroying my EQ but it looks like it will be the weekend before I can devote this larger amount of time now required by the EQ before I can even think about Firefox sound. For that I at least have alternatives.

Thanks for trying.
 
  


Reply


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
slackware xfinity html5 and firefox wufo Slackware 2 01-20-2014 03:08 AM
LXer: HTML5 for Audio Applications LXer Syndicated Linux News 0 05-08-2012 01:40 AM
LXer: HTML5 for Audio Applications LXer Syndicated Linux News 0 05-07-2012 11:20 PM
Audio only with one program - asoundrc's "opaqueness" hedron Slackware 6 07-02-2010 02:48 AM
5.1 audio playback asoundrc file (CM8738) alesz Linux - Newbie 0 08-30-2005 10:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:43 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration