Firefox failing with certain audio channel layout switching

I have created an audio only DASH stream with the Bitmovin Encoding product. It contains 2 AAC tracks within 2 separate AdaptationSets

AAC config track 1 :

    AacAudioConfiguration aacAudioConfiguration0 = new AacAudioConfiguration();
    aacAudioConfiguration0.setBitrate(384000L);
    aacAudioConfiguration0.setChannelLayout(AacChannelLayout.CL_5_1_BACK);

AAC config track 2

    AacAudioConfiguration aacAudioConfiguration1 = new AacAudioConfiguration();
    aacAudioConfiguration1.setBitrate(384000L);
    aacAudioConfiguration1.setChannelLayout(AacChannelLayout.STEREO);

When initializing the player with the track 1, switching to the track 2 causes the player to keep playing for a few seconds and then freeze. When initializing the player on track 2, no issue switching audio tracks.

As a workaround, I’m forcing the player to initialize with the track 2 and then switch to the track 1 in a PLAYING event handler. In this case, no issue anymore with switching tracks back and forth.

        player.load(source).then(function() {
            console.log('Successfully loaded source'); // Success!
            player.setAudio(player.getAvailableAudio()[1].id)
            player.on("playing", function() {
                player.setAudio(player.getAvailableAudio()[0].id)
            })
        }, function() {
            console.log('Error while loading source'); // Error!
        });

Same behaviour with DASH.js
No issue with Chrome
Firefox version : 105.0.3 (64-bit) / macOS
Chrome version : 108.0.5359.124 (Official Build) (x86_64)

Happy to share the workaround and to hear knowledge on what could cause this behaviour

nice work @ludovic.michaud :smiley:

2 Likes