The officially official Devuan Forum!

You are not logged in.

#1 2022-01-21 12:21:19

yolobro
Member
Registered: 2019-03-09
Posts: 7  

[SOLVED] firefox and asound.conf

Hi all,

I have this issue with firefox.
Audio will work out-of-the-box. But once I have a /etc/asound.conf, sound is gone.
These are the error messages:

aplay -L shows

...
default
hw:CARD=PCH,DEV=0
    HDA Intel PCH, ALC236 Analog
    Direct hardware device without any conversions
...

Card 0, device 0 is the normal laptop speaker. aplay works with this device.

my /etc/asound.conf

pcm.!default {
    type hw
    card 0
    device 0
}

ctl.!default {
    type hw
    card 0
    device 0
}

This config will work with everything (aplay, mpg123) but firefox.

I dont use pulseaudio.

Any hints? Thanks!

Offline

#2 2022-01-22 11:46:42

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 2,388  

Re: [SOLVED] firefox and asound.conf

Why are you attempting to address the soundcard directly? What is the point of creating asound.conf if the card is already set as the default output device?


To obtain a root shell use su -. Using just su will result in "command not found" messages.

Offline

#3 2022-01-22 23:35:03

GlennW
Member
Registered: 2019-07-18
Posts: 234  

Re: [SOLVED] firefox and asound.conf

yolobro wrote:

Hi all,

I have this issue with firefox.
Audio will work out-of-the-box. But once I have a /etc/asound.conf, sound is gone.
These are the error messages:

aplay -L shows

...
default
hw:CARD=PCH,DEV=0
    HDA Intel PCH, ALC236 Analog
    Direct hardware device without any conversions
...

Card 0, device 0 is the normal laptop speaker. aplay works with this device.

my /etc/asound.conf

pcm.!default {
    type hw
    card 0
    device 0
}

ctl.!default {
    type hw
    card 0
    device 0
}

This config will work with everything (aplay, mpg123) but firefox.

I dont use pulseaudio.

Any hints? Thanks!

Hi, I am interested in your post because it seems you have the same problem (no sound with some programs, firefox, palemoon, and other web-browsers) I get when ever I have tried to live without Pulse Audio on my system(s).

I don't have a solution, But I am watching for a solution. Thank you

Offline

#4 2022-01-23 00:29:20

steve_v
Member
Registered: 2018-01-11
Posts: 133  

Re: [SOLVED] firefox and asound.conf

Head_on_a_Stick wrote:

Why are you attempting to address the soundcard directly?

To break anything that needs format/samplerate conversion or stream mixing? Just a guess.

There's a whole lot of (mis)information on the web regarding "bit perfect" audiophool configurations that disable most of the useful functionality ALSA provides... Not saying that's what's going on here, but I can't really think of any other reason for an asound.conf like that.


Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

Offline

#5 2022-01-23 09:27:28

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 2,388  

Re: [SOLVED] firefox and asound.conf

GlennW wrote:

it seems you have the same problem (no sound with some programs, firefox, palemoon, and other web-browsers) I get when ever I have tried to live without Pulse Audio on my system(s).

The OP says that sound in FF works just fine if no /etc/asoundrc is created. I can also confirm that FF audio is completely functional without PulseAudio (or JACK, or PipeWire). You probably just need to set the default output device to your non-HDMI output: https://wiki.archlinux.org/title/Advanc … sound_card

steve_v wrote:

useful functionality ALSA provides

I would not describe the default ALSA behaviour of software resampling to 48kHz as in any way "useful" for those who have invested in expensive external DACs with hardware-based convertors and custom digital filters wink

But anyway that would only be appropriate for digital outputs. Addressing the hardware directly doesn't seem sensible for an analogue sound card.

FWIW I use this to prevent ALSA ruining the 24-bit 192kHz music files I stream from Qobuz:

pcm.Digital {
   type hw
   card A20
}

ctl.!default {
   type hw
   card A20
}

pcm.!default {
   type plug
   slave {
      pcm "Digital"
      rate "unchanged"
   }
}

^ That example disables software resampling for my Audiolab M-DAC+, which is identified in the output of aplay -l as A20. It's better to use the device identifier rather than the card number because the latter can change from one boot to the next.


To obtain a root shell use su -. Using just su will result in "command not found" messages.

Offline

#6 2022-01-23 10:59:05

steve_v
Member
Registered: 2018-01-11
Posts: 133  

Re: [SOLVED] firefox and asound.conf

Head_on_a_Stick wrote:

192kHz

I'm sure your pet bats just love it. tongue

Sarcasm and HiFi religious wars aside (though I think Harry would like a word), sure. If you just want to chuck the PCM stream at something else to make sense of, ALSAs default conversions are probably unhelpful.


In this case though, it appears we're dealing with a motherboard codec, and a realtek one at that. This is precisely the kind of device the ALSA defaults are aimed at.

That realtek chip has considerably worse SNR and frequency response than the last amp I built... And that one was based on a design from the early '80s.
Direct hardware access and high sample-rates would be completely pointless here even if the chipset supported hardware mixing, which it doesn't.


The notes I left myself in my asound.conf suggest that I have had problems in the past with Firefox (and apulse) using a default device that isn't a plug. I don't remember exactly why, but it gels with FF working if the OP removes that direct hw: routing.
The other problem, i.e. not using dmix with motherboard audio, should be pretty obvious.



Head_on_a_Stick wrote:

It's better to use the device identifier rather than the card number because the latter can change from one boot to the next.

It is indeed, but it's probably worth noting that the old soundcard-shuffle can also be prevented by passing the 'index' option to the module, e.g. in /etc/modprobe.d/alsa.conf.

Last edited by steve_v (2022-01-23 11:14:19)


Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

Offline

#7 2022-01-23 13:26:57

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 2,388  

Re: [SOLVED] firefox and asound.conf

With my humble apologies to the OP for this egregious digression:

steve_v wrote:
Head_on_a_Stick wrote:

192kHz

I'm sure your pet bats just love it. tongue

Although my hearing is limited to ~10kHz (I'm getting old now) it is still has the time-domain discrimination required to appreciate the quality imparted by higher sampling rates than those imposed by the Red Book (CD) standard.[1][2][3][4][5][6]

And now back to the thread...

[1] Jackson, H. M., Capp, M. D. and Stuart, J. R., 'The audibility of typical digital audio filters in a high-fidelity playback system', 9174, 137th AES Convention, (2014).
[2] Gabor, D., 'Theory of Communication', Journal of the Institution of Electrical Engineers, 93, III, p.429, (November 1946). http://dx.doi.org/10.1049/ji-1.1947.0015.
[3] Gabor, D., 'Acoustical Quanta and the Theory of Hearing', Nature, 159, pp.591–594, (1947). http://dx.doi.org/10.1038/159591a0.
[4] Oppenheim, J. M. and Magnasco, M. O., 'Human Time-Frequency Acuity Beats the Fourier Uncertainty Principle', Phys. Rev. Lett., 110, 044301, (2013). http://dx.doi.org/10.1103/PhysRevLett.110.044301.
[5] Oppenheim, J. M., et al., 'Minimal Bounds on Nonlinearity in Auditory Processing' (Jan 2013). arXiv:1301.0513 q-bio.NC.
[6] Maka, M, Sobieszczyk, P, et al., 'Hearing overcomes uncertainty relation', Euro Physics News 46 #1, pp.27–31.


To obtain a root shell use su -. Using just su will result in "command not found" messages.

Offline

#8 2022-01-24 20:14:25

yolobro
Member
Registered: 2019-03-09
Posts: 7  

Re: [SOLVED] firefox and asound.conf

FF is somehow fixated on using the "default" sound output.
Having my asound.conf like this, fixed it and i can control FF*s sound output:

defaults.pcm.card 0
defaults.ctl.card 0

Offline

#9 2022-01-24 20:33:51

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 2,388  

Re: [SOLVED] firefox and asound.conf

But card 0 is always the default anyway, that's why it's called "0" hmm

Just remove the file.


To obtain a root shell use su -. Using just su will result in "command not found" messages.

Offline

#10 2022-01-25 04:23:39

steve_v
Member
Registered: 2018-01-11
Posts: 133  

Re: [SOLVED] firefox and asound.conf

yolobro wrote:

FF is somehow fixated on using the "default" sound output.

This has been the case for years, and the various bug reports regarding it simply get closed as "WONTFIX or "WORKSFORME".
I don't know what the FF devs (or more likely a committee) think is so hard about providing an about:config setting to select the sound PCM (or officially supporting anything but pulseaudio to begin with for that matter), but apparently that's how it is.
They certainly appear to have enough manpower to work on constant and pointless UI changes though...

There is MediaElement.setSinkId, but it AFAICT that only enables an underlying API, i.e. the possibility of switching the audio output... Actually implementing device selection is left to extensions. roll

Last edited by steve_v (2022-01-25 04:32:17)


Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

Offline

#11 2022-01-26 08:08:45

GlennW
Member
Registered: 2019-07-18
Posts: 234  

Re: [SOLVED] firefox and asound.conf

yolobro wrote:

FF is somehow fixated on using the "default" sound output.
Having my asound.conf like this, fixed it and i can control FF*s sound output:

defaults.pcm.card 0
defaults.ctl.card 0

I have had those lines in my /home/glenn/.asoundrc for quite some time ... it didn't iron out any wrinkles for my system.

Currently I don't have /etc/asound.conf on my system, only in old backups.

This file is from October 2020 (ascii I think)

pcm.!default {
    type plug
    slave.pcm "dmixer"
}

pcm.dmixer  {
     type dmix
     ipc_key 1024
     slave {
        pcm "hw:0,0"
        period_time 0
        period_size 1024
        buffer_size 4096
        rate 48000
    }
    bindings {
        0 0
        1 1
    }
}

ctl.dmixer {
    type hw
     card UA25EX
}

ctl.equal {
    type equal;
}

pcm.plugequal {
    type equal;
    # Modify the line below if you do not
    # want to use sound card 0.
    #slave.pcm "plughw:0,0";
    # by default we want to play from more sources at time:
    slave.pcm "plug:dmix";
}

# pcm.equal {
# If you do not want the equalizer to be your
# default soundcard comment the following
# line and uncomment the above line. (You can
# choose it as the output device by addressing
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)
pcm.!default {
    type plug;
    slave.pcm plugequal;
}

In this case, where would I insert those 2 lines? Thank you

Offline

#12 2022-01-26 15:24:06

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 2,388  

Re: [SOLVED] firefox and asound.conf

GlennW wrote:

I have had those lines in my /home/glenn/.asoundrc for quite some time ... it didn't iron out any wrinkles for my system.

That's not really surprising because as I explained above that file does absolutely nothing at all. All it does is set card "0" as the default output but ALSA names the default card "0" so it's already set.

You probably want:

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

^ That works for every laptop I have ever owned that has an HDMI audio output. It sets the analogue card as the default and so makes FF produce sound without needing PulseAudio to hold your hand.

EDIT: this was clearly explained in the ArchWiki link I gave earlier but obviously clicking on a link is far too much work... roll

Last edited by Head_on_a_Stick (2022-01-26 15:25:02)


To obtain a root shell use su -. Using just su will result in "command not found" messages.

Offline

#13 2022-01-26 23:33:46

GlennW
Member
Registered: 2019-07-18
Posts: 234  

Re: [SOLVED] firefox and asound.conf

I appologise, HoaS. I was on my way out yesterday when I posted that comment (Public holiday here in Aus).

I'll check out the link, thank you.

Offline

Board footer