Closed Bug 1772769 Opened 2 years ago Closed 2 years ago

Surround sound not working, all audio is stereo

Categories

(Core :: Audio/Video: Playback, defect, P4)

Firefox 101
Desktop
Linux
defect

Tracking

()

RESOLVED FIXED
110 Branch
Tracking Status
firefox-esr91 --- wontfix
firefox-esr102 --- wontfix
firefox101 --- wontfix
firefox102 --- wontfix
firefox103 --- wontfix
firefox104 --- wontfix
firefox108 --- wontfix
firefox109 --- wontfix
firefox110 --- fixed

People

(Reporter: andrewammerlaan, Assigned: sna)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

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

Steps to reproduce:

In Firefox 101.0 (possibly earlier) surround sound seems to have broken (on Linux(?)). Testing with [1] results in only stereo sound output.

Vlc is working, Chrome is working. The latest Firefox esr release (91.10.0) is also working just fine. I created a new fresh profile, in which I could still reproduce the issue.

This is a Gentoo Linux system running kernel 5.18.1, pulseaudio version 16.0, and pipewire version 0.3.51.

[1] https://www2.iis.fraunhofer.de/AAC/multichannel.html

Actual results:

By inspecting the number of channels produced using pavucontrol I confirmed that audio is only stereo.

Expected results:

Full 5.1 audio should have been produced, in accordance with the system audio profile. As happens in the latest esr release.

The Bugbug bot thinks this bug should belong to the 'Core::Web Audio' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

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

Could you try using mozregression to find out what caused this?

The bug has a release status flag that shows some version of Firefox is affected, thus it will be considered confirmed.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(andrewammerlaan)

(In reply to Marco Castelluccio [:marco] from comment #2)

Could you try using mozregression to find out what caused this?

Done, I hope this is useful. The application was quite crashy on my system for some reason so I had to do it a couple of times. I copied and uploaded the log and took a screenshot after a successful run.

Thanks! So it looks like the culprit might be bug 1351378.

Regressed by: 1351378

:NordinAbouzahra+BMO, since you are the author of the regressor, bug 1351378, could you take a look?
For more information, please visit auto_nag documentation.

Flags: needinfo?(NordinAbouzahra+BMO)

Andrew, what audio backend is reported in about:support under the media section? Also, are you using a build provided by Gentoo (or using non-default options for the audio backend when building) or a Mozilla build?

Flags: needinfo?(andrewammerlaan)

(In reply to Matthew Gregan [:kinetik] from comment #9)

Andrew, what audio backend is reported in about:support under the media section? Also, are you using a build provided by Gentoo (or using non-default options for the audio backend when building) or a Mozilla build?

The "Audio Backend" is "pulse-rust", interestingly enough "Max Channels" is actually reported correctly as "6" (even though all actual audio is stereo according to pavucontrol). I tried both the official Mozilla binary (www-client/firefox-bin) and a custom built one from source (www-client/firefox). I have the same problem with both versions. I also tried explicitly enabling sndio support in the custom build since it is mentioned above, however this made no difference.

Flags: needinfo?(andrewammerlaan)
Has Regression Range: --- → yes

Set release status flags based on info from the regressing bug 1351378

Severity: -- → S3
OS: Unspecified → Linux
Priority: -- → P4
Hardware: Unspecified → Desktop

Redirect a needinfo that is pending on an inactive user to the triage owner.
:jimm, since the bug has recent activity, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(NordinAbouzahra+BMO) → needinfo?(jmathies)
Flags: needinfo?(jmathies)

Adding an additional comment for the same issue.
Arch Linux user using the latest Linux Firefox 103.0.2 (64-bit). Audio > 2 channels does not work properly.

A good test page to troubleshoot/verify, play the first sample "HE-AAC Bitstream:":
https://www2.iis.fraunhofer.de/AAC/multichannel.html

Important note: I have found that if I downgrade to Linux Firefox 99.x (tested on 99.0.1-1), the audio works as expected for multichannel audio suggesting only later versions of Firefox 100.x.x are affected. As a further confirmation, I tested the same scenario in Google Chrome and multichannel audio is working as expected.

Below is a copy>paste of my support page with some basic related info, showing 6 channels detected. This is the same issue as Andrew Ammerlaan's.

Hope a fix will be issued soon since I really do not want to use an older version of Firefox as a workaround is certainly not optimal or secure. Please let me know if I can provide any further details.

about:support

Application Basics
Name Firefox
Version 103.0.2
Build ID 20220808225913
Distribution ID archlinux
User Agent Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0
OS Linux 5.18.16-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Wed, 03 Aug 2022 11:25:10 +0000

Media
Audio Backend pulse-rust
Max Channels 6
Preferred Sample Rate 48000
Roundtrip latency (standard deviation) 44.66ms (2.70)

Output Devices
Name Group Vendor State Preferred Format Channels Rate Latency
Starship/Matisse HD Audio Controller Analog Surround 5.1 /devices/pci0000:00/0000:00:08.1/0000:0a:00.4/sound/card1 Advanced Micro Devices, Inc. [AMD] Enabled All default: F32LE, support: S16LE S16BE F32LE F32BE 6 default: 48000, support: 1 - 384000 0 - 0

Input Devices
Name Group Vendor State Preferred Format Channels Rate Latency
Monitor of Starship/Matisse HD Audio Controller Analog Surround 5.1 /devices/pci0000:00/0000:00:08.1/0000:0a:00.4/sound/card1 Advanced Micro Devices, Inc. [AMD] Enabled None default: F32LE, support: S16LE S16BE F32LE F32BE 6 default: 48000, support: 1 - 384000 0 - 0
Starship/Matisse HD Audio Controller Analog Stereo /devices/pci0000:00/0000:00:08.1/0000:0a:00.4/sound/card1 Advanced Micro Devices, Inc. [AMD] Enabled All default: F32LE, support: S16LE S16BE F32LE F32BE 2 default: 96000, support: 1 - 384000 0 - 0

(In reply to Andrew Ammerlaan from comment #10)

(In reply to Matthew Gregan [:kinetik] from comment #9)

Andrew, what audio backend is reported in about:support under the media section? Also, are you using a build provided by Gentoo (or using non-default options for the audio backend when building) or a Mozilla build?

The "Audio Backend" is "pulse-rust", interestingly enough "Max Channels" is actually reported correctly as "6" (even though all actual audio is stereo according to pavucontrol). I tried both the official Mozilla binary (www-client/firefox-bin) and a custom built one from source (www-client/firefox). I have the same problem with both versions. I also tried explicitly enabling sndio support in the custom build since it is mentioned above, however this made no difference.

Firefox version 105.0.2 as of this post, surround sound is still not working properly on Linux distributions

  • All Chrome-based browser latest versions, surround sound works properly.
  • Installing any Firefox versions 99.x or earlier, surround sound works properly.

As stated prior, this audio bug was introduced in Firefox Linux versions 100.x and up.

Please advise, thank you.

(In reply to Release mgmt bot [:suhaib / :marco/ :calixte] from comment #8)

:NordinAbouzahra+BMO, since you are the author of the regressor, bug 1351378, could you take a look?
For more information, please visit auto_nag documentation.

Sorry, I was busy for some time. I look into this but from the brief overview bug 1351378 was build system changes of which should not have effected PulseAudio's ability for multichannel audio but I will investigate further in case there was some brittle build system logic that broke.

(In reply to Patrick Sheets from comment #13)

Adding an additional comment for the same issue.
Arch Linux user using the latest Linux Firefox 103.0.2 (64-bit). Audio > 2 channels does not work properly.

Are you also running a PulseAudio + PipeWire setup?

(In reply to Patrick Sheets from comment #13)

Adding an additional comment for the same issue.
Arch Linux user using the latest Linux Firefox 103.0.2 (64-bit). Audio > 2 channels does not work properly.

Are you also running a PulseAudio + PipeWire setup?

Yes, I am currently using PulseAudio + PipeWire. To note here however, I upgraded to PipeWire less than a month ago. My initial experience (and likely many others) are/were without use of Pipewire. This bug effects both PulseAudio & PulseAudio+Pipewire setups. I am not entirely sure how audio backends work within Firefox, but it would seem the issue may be somewhere to changes specific to Firefox's calls to PulseAudio. According to about:config, Firefox uses "Audio Backend pulse-rust". Not sure what changes happened in Firefox 100.x and up, I wish I could be of more use here. In either scenario (Pipewire, non-Pipewire), downgrading Firefox to versions 99.x and lower, surround works as expected immediately, without any changes to the Linux operating system.

Hopefully a resolution can be found soon, thank you kindly for your reply.

(In reply to Patrick Sheets from comment #16)

(In reply to Patrick Sheets from comment #13)

Adding an additional comment for the same issue.
Arch Linux user using the latest Linux Firefox 103.0.2 (64-bit). Audio > 2 channels does not work properly.

Are you also running a PulseAudio + PipeWire setup?

Yes, I am currently using PulseAudio + PipeWire. To note here however, I upgraded to PipeWire less than a month ago. My initial experience (and likely many others) are/were without use of Pipewire. This bug effects both PulseAudio & PulseAudio+Pipewire setups. I am not entirely sure how audio backends work within Firefox, but it would seem the issue may be somewhere to changes specific to Firefox's calls to PulseAudio. According to about:config, Firefox uses "Audio Backend pulse-rust". Not sure what changes happened in Firefox 100.x and up, I wish I could be of more use here. In either scenario (Pipewire, non-Pipewire), downgrading Firefox to versions 99.x and lower, surround works as expected immediately, without any changes to the Linux operating system.

Hopefully a resolution can be found soon, thank you kindly for your reply.

I found the culprit. I removed what I thought was a spurious set_define() as I never saw any ifdef logic using it. I did check using searchfox but nothing populated in the codebase back then I believe. Fortunately there is an easy work around/solution. For the time being in about:config type media.forcestereo.enabled and set it to false (this is what the ifdef logic is suppose to do).

If Patrick or Andrew can confirm setting media.forcestereo.enabled to false resolves the issue for them as well I will go ahead and write a patch for it.

Flags: needinfo?(andrewammerlaan)
Flags: needinfo?(admin)

I found the culprit. I removed what I thought was a spurious set_define() as I never saw any ifdef logic using it. I did check using searchfox but nothing populated in the codebase back then I believe. Fortunately there is an easy work around/solution. For the time being in about:config type media.forcestereo.enabled and set it to false (this is what the ifdef logic is suppose to do).

If Patrick or Andrew can confirm setting media.forcestereo.enabled to false resolves the issue for them as well I will go ahead and write a patch for it.

I can confirm that this works! Thanks for the workaround!

Flags: needinfo?(andrewammerlaan)

(In reply to Nordin Abouzahra from comment #17)

(In reply to Patrick Sheets from comment #16)

(In reply to Patrick Sheets from comment #13)

Adding an additional comment for the same issue.
Arch Linux user using the latest Linux Firefox 103.0.2 (64-bit). Audio > 2 channels does not work properly.

Are you also running a PulseAudio + PipeWire setup?

Yes, I am currently using PulseAudio + PipeWire. To note here however, I upgraded to PipeWire less than a month ago. My initial experience (and likely many others) are/were without use of Pipewire. This bug effects both PulseAudio & PulseAudio+Pipewire setups. I am not entirely sure how audio backends work within Firefox, but it would seem the issue may be somewhere to changes specific to Firefox's calls to PulseAudio. According to about:config, Firefox uses "Audio Backend pulse-rust". Not sure what changes happened in Firefox 100.x and up, I wish I could be of more use here. In either scenario (Pipewire, non-Pipewire), downgrading Firefox to versions 99.x and lower, surround works as expected immediately, without any changes to the Linux operating system.

Hopefully a resolution can be found soon, thank you kindly for your reply.

I found the culprit. I removed what I thought was a spurious set_define() as I never saw any ifdef logic using it. I did check using searchfox but nothing populated in the codebase back then I believe. Fortunately there is an easy work around/solution. For the time being in about:config type media.forcestereo.enabled and set it to false (this is what the ifdef logic is suppose to do).

If Patrick or Andrew can confirm setting media.forcestereo.enabled to false resolves the issue for them as well I will go ahead and write a patch for it.

That appears to have fixed the issue perfectly! I have tested with media.forcestereo.enabled to false and then played multichannel audio tests via the fraunhofer AAC page (https://www2.iis.fraunhofer.de/AAC/multichannel.html), as well as with video streaming from Netflix, for an additional confirmation of proper functionality. I also tried this on a few other Linux distributions that are using Firefox 100.x and above such as Debian 11, Manjaro, and the latest Ubuntu. All audio channels are working properly as expected with that setting change.

Nordin, appreciate your efforts here and also your time for the upcoming patch.

Again, many thanks!

Flags: needinfo?(admin)

Earlier in bug 1351378 some superfluous set_define()s were removed. However,
some were accidentally removed despite having purpose. This commit restores
the MOZ_ALSA and MOZ_PULSEAUDIO defines, the former being used in
Sandbox{Filter,BrokerPolicyFactory,Launch}.cpp and the latter used in setting
the preference media.forcestereo.enabled to false which fixes the primary
concern of bug report.

Assignee: nobody → NordinAbouzahra+BMO
Status: NEW → ASSIGNED

Any update on this? I know there is a workaround, but it was mentioned recently on reddit:
https://www.reddit.com/r/firefox/comments/1050x4o/51_audio_on_version_10801_linux_mint_jan_2023/

Flags: needinfo?(NordinAbouzahra+BMO)

(In reply to Dianna Smith [:diannaS] from comment #21)

Any update on this? I know there is a workaround, but it was mentioned recently on reddit:
https://www.reddit.com/r/firefox/comments/1050x4o/51_audio_on_version_10801_linux_mint_jan_2023/

There is a patch. Just needs to be reviewed, should be a trivial task.

Flags: needinfo?(NordinAbouzahra+BMO) → needinfo?(jmathies)

Mathew, curious if you can help get this fix landed?

Flags: needinfo?(jmathies) → needinfo?(kinetik)

Reviewed and queued for landing. Thanks for the fix!

Flags: needinfo?(kinetik)
Pushed by mgregan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a655600bab2b
Allow default multichannel audio support by restoring defines. r=kinetik
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch

The patch landed in nightly and beta is affected.
:sna, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox109 to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(NordinAbouzahra+BMO)

(In reply to Release mgmt bot [:suhaib / :marco/ :calixte] from comment #27)

The patch landed in nightly and beta is affected.
:sna, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox109 to wontfix.

For more information, please visit auto_nag documentation.

The bug is not important enough, as well as there is an easy workaround. However, I cannot set status-firefox109 to wontfix (wontfix is not an option for me to set).

Flags: needinfo?(NordinAbouzahra+BMO)
Regressions: 1830206
No longer regressions: 1830206
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: