Closed Bug 1904734 Opened 3 months ago Closed 1 month ago

Firefox 127 not playing audio out Channels assigned in Audio MIDI setup Mac OS 14.5

Categories

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

Firefox 127
Desktop
macOS
defect

Tracking

()

RESOLVED FIXED
131 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- affected
firefox129 --- wontfix
firefox130 --- wontfix
firefox131 --- fixed

People

(Reporter: zmix, Assigned: chunmin, NeedInfo)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

This appears to be a regression of this bug:

https://bugzilla.mozilla.org/show_bug.cgi?id=1552928

At least it's the same Symptoms.

The severity field is not set for this bug.
:kinetik, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(kinetik)
OS: Unspecified → macOS
Hardware: Unspecified → Desktop
Version: unspecified → Firefox 127

(In reply to BugBot [:suhaib / :marco/ :calixte] from comment #1)

The severity field is not set for this bug.

Sorry, I missed that. I'd say the severity is S1 because it forces all the audio to a default output, and prevents the user from changing the routing.

(In reply to zmix from comment #0)

This appears to be a regression of this bug:

https://bugzilla.mozilla.org/show_bug.cgi?id=1552928

At least it's the same Symptoms.

That landed a long time ago. Maybe Chun-Min has some ideas.

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

Hi, thanks for the report.

Could you provide your about:support information under the Media section for us and the device information that has the issue? Additionally, could you use the mozgression tool to help us narrow down the culprits and follow the steps below to get the program logs? That will be super helpful, and I'll really appreciate any help you can provide (currently, I don't have a multi-channel sound card at hand to test this, but I am going to find one).

Steps to get logs

  1. Install Firefox profiler: https://profiler.firefox.com/
  2. Open Firefox, and go to about:logging page
  3. Click Logging preset and choose Media Playback
  4. Click Start Logging
  5. Open a new tab and repeat the steps that cause the issue. Once you reproduce the issue, close the tab, then go back to about:logging page and click Stop Logging.
  6. The Firefox Profiler should launch itself automatically.
  7. Click Upload Local Profile, then download and upload the profile to Bugzilla or paste the share link in the comment directly.
    (The tutorial to get the logs is here: https://www.loom.com/share/24ea3a8e3a054c478de94643a0ea8620?sid=87b0ffaa-c4ea-43ce-8107-639f24b747a8 or https://paul.cx/public/about-logging-presentation.webm)
Flags: needinfo?(cchang) → needinfo?(zmix)

I just got a Cubilux Surround Sound Card (CA7) and reproduced the issue on my MacBook Pro. The channel layout was set to 6 channels: [BackLeft, BackRight, FrontCenter, LowFrequency, FrontLeft, FrontRight]. Chrome works fine, but Firefox doesn't. The mixer wasn't created as I expected. I suspect the problem is probably caused by the code here. I'll investigate it ASAP.

(In reply to C.M.Chang[:chunmin] from comment #5)

Commenting this piece of code doesn't solve the issue, since the output_dev_desc.mChannelsPerFrame (and output_hw_desc.mChannelsPerFrame), on my Cubilux Surround Sound Card (CA7), reports 2 while the device_layout reports that the hardware layout is set to [BackLeft, BackRight, FrontCenter, LowFrequency, FrontLeft, FrontRight] (via Audio MIDI Setup) (get_channel_count reports 6 in this case). These two pieces of hardware information contradict each other.

In this absurd case, Mixer forces the channel layout to [FrontLeft, FrontRight]. However, forcing the channel to 6 doesn't solve the issue, and it would lead to break the output_buffer_size >= size_needed assertion in audiounit_output_callback.

More investigation is required to know why the assertion is reached when mutating the channel from 2 to 6.

See Also: → 1474175, 1552928

(In reply to C.M.Chang[:chunmin] from comment #6)

(In reply to C.M.Chang[:chunmin] from comment #5)
....

More investigation is required to know why the assertion is reached when mutating the channel from 2 to 6.

This means the buffer size given by the output callback is only for 2-channel instead of for 6-channel since the channel of audio stream is set to output_dev_desc.mChannelsPerFrame, which is 2. The channel of the output_dev_desc is defined by output_hw_desc.mChannelsPerFrame, which is expected to reflect the hardware information. However, it reports 2 in this case as well. Setting kAudioUnitScope_Input to kAudioUnitScope_Output makes output_hw_desc.mChannelsPerFrame report 6, meeting the expectation.

Commenting this piece of code doesn't solve the issue, since the output_dev_desc.mChannelsPerFrame (and output_hw_desc.mChannelsPerFrame), on my Cubilux Surround Sound Card (CA7), reports 2 while the device_layout reports that the hardware layout is set to [BackLeft, BackRight, FrontCenter, LowFrequency, FrontLeft, FrontRight] (via Audio MIDI Setup) (get_channel_count reports 6 in this case). These two pieces of hardware information contradict each other.

Commenting this piece of code setting kAudioUnitProperty_AudioChannelLayout and reverting the kAudioUnitScope_Input back to kAudioUnitScope_Output resolves the issue with my Cubilux Surround Sound Card (CA7).

These changes (kAudioUnitScope_Input and kAudioUnitProperty_AudioChannelLayout) were introduced in PR #220 and PR #222 resepctively. However, there were no comments or explanations detailing the issues they were meant to address. Without this context, I am unsure if reverting these changes is the right approach or if it might lead to other regressions.

This issue is mirrored to git repo: https://github.com/mozilla/cubeb-coreaudio-rs/issues/232

Paul, do you remember what those settings do?

Flags: needinfo?(padenot)

PR #220 and PR #222 were merged in bug 1474175 and bug 1895787

Regressions: 1474175, 1895787

Bug relationship was reversed

Keywords: regression
Regressed by: 1474175, 1895787
No longer regressions: 1474175, 1895787

The goal of those changes is to play stereo to the channels that have been set as stereo in Audio MIDI setup, and having macOS mix for us, regardless of what the hardware supports, instead of opening all channels, and sending silence to most of them.

Flags: needinfo?(padenot)

This patch updates cubeb-coreaudio to f7e50c2 by running

cargo update -p cubeb-coreaudio && ./mach vendor rust

to import the code in the given version.

Assignee: nobody → cchang
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

The uploaded patch should fix this issue. Note that for 2-ch audio input, the channels go to the stereo configuration set via Audio MIDI Setup, while multi-channel audio input (e.g., https://www2.iis.fraunhofer.de/AAC/multichannel.html) follows the surround configurations. See https://github.com/mozilla/cubeb-coreaudio-rs/issues/232#issuecomment-2302658638 for more details.

Pushed by cchang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cef212095a44 Update cubeb-coreaudio to f7e50c2 r=cubeb-reviewers,pehrsons
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch
No longer regressed by: 1474175
Flags: needinfo?(zmix)

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

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

For more information, please visit BugBot documentation.

Flags: needinfo?(cchang)

I believe this problem is minor, and it's okay to let the patch ride the train instead of uplifting it.

Flags: needinfo?(cchang)
Flags: qe-verify+

Unfortunately, I don't have the specific sound card (Cubilux Surround Sound Card CA7 mentioned in Comment 5) to test it directly.
@zmix, could you kindly check if the issue still persists on your end with the latest Firefox 131.0b8 ? Thank you.

Flags: needinfo?(zmix)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: