Open Bug 1753215 Opened 3 years ago Updated 2 years ago

Switching between audio tracks with different number of channels (stereo vs 5.1 surround)

Categories

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

Firefox 98
defect

Tracking

()

UNCONFIRMED

People

(Reporter: bucher, Unassigned)

Details

Attachments

(2 files)

Steps to reproduce:

Verify with the following MPEG-DASH stream in any html5 player and switch between audio tracks

https://devs.origin.cdn.cra.cz:4433/nova/x/51/aac51.smil/manifest.mpd

Here the first track is with 2 channels, the second with 6 channels. The first is marked as main role, the second as alternate role. The initial selection of the audio track might depend on the player used, but the majority will pick as first the one with two channels, be it due to the main role or due to being first in the manifest, known exception here is dash.js reference player which might by default select higher bitrate that the 6-channel track has.

Actual results:

Firefox does not render the audio according to specified number of channels after switching from one audio track to another.

When switching the player in this case to the 6-channel audio track during playback, it is visible in network log that the player actually starts to load the correct track with 6 channels, but Firefox still renders the audio as 2 channels.

Expected results:

Firefox should remap the channel layout according to the new audio track.

For comparison, if the first track has 6 channels as presented in this test stream https://devs.origin.cdn.cra.cz:4433/nova/x/51/aac51reversed.smil/manifest.mpd and the player initializes playback with this track, Firefox correctly renders the audio in 5.1 layout as confirmed by 5.1 speaker setup, however when switched during playback to the track with 2 channels, audio completely drops out and is replaced with silence.

If the stream contains just single 6-channel audio track, everything renders as expected.

This behavior was confirmed with multiple MSE players. It seems that Firefox (or Cubeb?) possibly sets the number of channels during initialization and does not make correct changes to accomodate the number of channels in another track fed subsequently to MSE API during the same session.

I assume that support might be also limited by what the OS allows and multichannel audio track then should be downmixed to stereo anyway if the support is not met. But everywhere else this switching scenario should properly remap the channels to proper speaker layout as instructed by the audio data.

It is worth mentioning that both listed test streams work fine while switching these audio tracks back and forth in Blink-based browsers such as Chrome or Edge.

Everything tested on Windows 10 with 5.1 speaker configuration with up-to-date stable browser versions.

The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

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

:kinetik, is this something you could help me triage? Is this a limitation related to our cubeb usage, or does it lie elsewhere?

Flags: needinfo?(kinetik)

I think the issue is higher up the stack. cubeb can't change formats once configured, so we use AudioConverter to convert the incoming audio to the cubeb format. For the case where you start with 6-channel and switch to 2-channel, that should already work as expected... but I don't think we handle recreating the cubeb stream for cases where we could make use of extra output channels.

Flags: needinfo?(kinetik)
Severity: -- → S3
Priority: -- → P3

i have the same problem

when i try to switch from 5.1 to stereo the audio cuts out
it works perfectly when i switch from stereo to 5.1

Hi, can you share your about:support settings so we can investigate further?

Flags: needinfo?(yannick.fuereder)
Attached file aboutsupportlog
This is mine as the original reporter:
Attached file aboutsupportlog

I am using Dash.js v4.4.0 with clearkey

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

Attachment

General

Creator:
Created:
Updated:
Size: