Open Bug 1624110 Opened 4 years ago Updated 5 months ago

No sound in firefox 74.0 with ALSA on a certain website

Categories

(Core :: Audio/Video: cubeb, defect, P5)

74 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: monsterovich, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0

Steps to reproduce:

  1. Build firefox 74.0 with --enable-alsa option.
  2. Open souncloud.com
  3. Play any track.

Actual results:

While a track is playing, there is no sound at all.

Expected results:

The sound should've played.

P.S. If you set dom.webaudio.enabled to false, the sound will work again.

I discovered this solution here:
https://bugzilla.mozilla.org/show_bug.cgi?id=1621309

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core
Component: Audio/Video: Playback → Web Audio

Nikolay, can you get us logs:

MOZ_LOG=cubeb:5,MediaTrackGraph:4 ./firefox

Thanks!

Flags: needinfo?(monsterovich)

dom.webaudio.enabled is true

https://pastebin.com/a9C2sFwf

Flags: needinfo?(monsterovich)

dom.webaudio.enabled is false: sound is working

https://pastebin.com/y8Cdxe03

In both logs I play two random tracks. Warnings are present in both cases.

Something is off when Firefox tries to open an ALSA backend, but there are no logs there. The error is probably in alsa_stream_init_single if you want to debug (in media/libcubeb/src/cubeb_alsa.c). I'm thinking maybe the latency requested is too small ?

Component: Web Audio → Audio/Video: cubeb
Priority: -- → P5

I am seeing the same behavior with sites like chess.com where the sound effects will only play sometimes, like if I open youtube, play something with sound, and then go back to chess.com. Its really bizarre.

I can reproduce the issue using a short JavaScript snippet. This snippet works fine with plain ALSA:

var elem = new Audio('some_file.mp3');
elem.play();

This snippet doesn't work with plain ALSA. It'll produce the mute button in the tab header indicating that Firefox thinks it's playing sound but no sound comes out. It works fine when I build Firefox with pulseaudio support (even with pulseaudio shim like apulse):

var ctx = new window.AudioContext();
var elem = new Audio('some_file.mp3');
var track = ctx.createMediaElementSource(elem);
track.connect(ctx.destination);
elem.play();

Hi, I would like to know if this is considered a bug to be fixed, or if Firefox is only going to support pulseaudio and there is no intention to fix this to support ALSA.

Please see https://github.com/kinetiknz/cubeb/wiki/Backend-Support for details on the different audio backends and their level of support. To summarize, patches for ALSA are always appreciated and the ALSA code is supported by community contributions.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.