Wrong channel mapping in 7.1ch audio: side and back channels reversed

I am developing a video streaming app for Fire TV.

When playing FLAC 7.1ch audio, the side L/R channels are mistakenly output as back L/R channels, and the back L/R channels as side L/R channels. I believe this is a Fire TV-specific issue, as it does not occur on the NVIDIA SHIELD TV Pro.

Devices that reproduce the issue

Fire TV Stick 4K Max - 2nd Generation - 16GB (Build Model: AFTKRT)

Devices that do not reproduce the issue

NVIDIA SHIELD TV Pro

Reproduction steps

  1. Use the ExoPlayer demo app https://github.com/androidx/media/tree/1.3.1/demos/main. I tested using version 1.3.1, but this issue seems to occur regardless of the version.
  2. Connect the Fire TV to an AV receiver capable of playing 7.1ch audio (I used the YAMAHA RX-A1080) via HDMI.
  3. Add the 7.1ch audio file (https://d2cyobc08mckht.cloudfront.net/local/fs_test/7.1ch/44.1kHz/manifest_ondemand_max1080p.mpd) to the playlist JSON file media.exolist.json (demos/main/src/main/assets/media.exolist.json).
  4. Run the app and play the added audio.
  5. Observe the output signal from the AV receiver.

Expected result

All signals should be played in the correct channel.

Actual result

  • The side L/R signals are played in the back L/R channels.
  • The back L/R signals are played in the side L/R channels.

Workaround

I am currently using a workaround by utilizing ExoPlayer’s ChannelMappingAudioProcessor to reverse the side and back channels within the app. This counteracts the channel reversal on Fire TV, resulting in the audio being output on the correct channels.

Hi there,

Given the nature of the issue, here are a few suggestions that may help address this problem:

  1. Investigate Existing Solutions: Check if there are any known fixes or workarounds provided the ExoPlayer community for similar channel mapping issues.
  2. Explore Audio Normalization Techniques: In addition to the ChannelMappingAudioProcessor workaround, you could investigate other audio normalization techniques, such as using a custom AudioProcessor implementation, to see if there are any other ways to correct the channel mapping issue.
  3. Monitor ExoPlayer Updates: Keep an eye on the ExoPlayer project and its updates, as future versions may include improvements or bug fixes that address the Fire TV channel mapping problem.

Ultimately, this appears to be a platform-specific issue, and your current workaround using the ChannelMappingAudioProcessor seems like a reasonable approach to address the problem. Continued monitoring and engagement with Amazon and the ExoPlayer community may help uncover a more permanent solution.

Additionally, I have raised you concern to our internal engineering team for further investigation.

Thanks

I noticed wrong channel mapping when playing this file:

{
“creatingLibrary”:{“name”:“MediaInfoLib”,“version”:“24.05.1”,“url”:“MediaInfo”},
“media”:{“@ref”:“\\DISKSTATION\TV Shows\Dolby Demo\Home Theater Demos\dolby-test-tones_5_1_2.mp4”,“track”:[{“@type”:“General”,“VideoCount”:“1”,
“AudioCount”:“1”,
“FileExtension”:“mp4”,
“Format”:“MPEG-4”,
“Format_Profile”:“Base Media / Version 2”,
“CodecID”:“mp42”,
“CodecID_Compatible”:“mp42/dby1/isom”,
“FileSize”:“121254421”,
“Duration”:“503.552”,
“OverallBitRate”:“1926386”,
“FrameRate”:“24.000”,
“FrameCount”:“12012”,
“StreamSize”:“148258”,
“HeaderSize”:“148250”,
“DataSize”:“121106171”,
“FooterSize”:“0”,
“IsStreamable”:“Yes”,
“Encoded_Date”:“2017-01-23 18:50:03 UTC”,
“Tagged_Date”:“2017-01-23 18:50:03 UTC”,
“File_Created_Date”:“2024-08-17 14:51:41.284 UTC”,
“File_Created_Date_Local”:“2024-08-17 07:51:41.284”,
“File_Modified_Date”:“2024-08-17 14:50:36.687 UTC”,
“File_Modified_Date_Local”:“2024-08-17 07:50:36.687”},{“@type”:“Video”,“StreamOrder”:“0”,
“ID”:“1”,
“Format”:“AVC”,
“Format_Profile”:“Main”,
“Format_Level”:“4.1”,
“Format_Settings_CABAC”:“Yes”,
“Format_Settings_RefFrames”:“3”,
“Format_Settings_GOP”:“M=4, N=24”,
“CodecID”:“avc1”,
“Duration”:“500.500”,
“BitRate”:“1485031”,
“Width”:“1920”,
“Height”:“1080”,
“Stored_Height”:“1088”,
“Sampled_Width”:“1920”,
“Sampled_Height”:“1080”,
“PixelAspectRatio”:“1.000”,
“DisplayAspectRatio”:“1.778”,
“Rotation”:“0.000”,
“FrameRate_Mode”:“CFR”,
“FrameRate”:“24.000”,
“FrameRate_Num”:“24”,
“FrameRate_Den”:“1”,
“FrameCount”:“12012”,
“Standard”:“NTSC”,
“ColorSpace”:“YUV”,
“ChromaSubsampling”:“4:2:0”,
“BitDepth”:“8”,
“ScanType”:“Progressive”,
“StreamSize”:“92907251”,
“Default”:“Yes”,
“AlternateGroup”:“1”,
“Encoded_Date”:“2017-01-23 18:50:03 UTC”,
“Tagged_Date”:“2017-01-23 18:50:03 UTC”,
“colour_description_present”:“Yes”,
“colour_description_present_Source”:“Stream”,
“colour_range”:“Limited”,
“colour_range_Source”:“Stream”,
“colour_primaries”:“BT.709”,
“colour_primaries_Source”:“Stream”,
“transfer_characteristics”:“BT.709”,
“transfer_characteristics_Source”:“Stream”,
“matrix_coefficients”:“BT.709”,
“matrix_coefficients_Source”:“Stream”,
“extra”:{“CodecConfigurationBox”:“avcC”}},{“@type”:“Audio”,“StreamOrder”:“1”,
“ID”:“2”,
“Format”:“E-AC-3”,
“Format_Commercial_IfAny”:“Dolby Digital Plus with Dolby Atmos”,
“Format_Settings_Mode”:“Dolby Surround EX”,
“Format_Settings_Endianness”:“Big”,
“Format_AdditionalFeatures”:“JOC”,
“CodecID”:“ec-3”,
“Duration”:“503.552”,
“BitRate_Mode”:“CBR”,
“BitRate”:“448000”,
“Channels”:“6”,
“ChannelPositions”:“Front: L C R, Side: L R, LFE”,
“ChannelLayout”:“L R C LFE Ls Rs”,
“SamplesPerFrame”:“1536”,
“SamplingRate”:“48000”,
“SamplingCount”:“24170496”,
“FrameRate”:“31.250”,
“FrameCount”:“15736”,
“Compression_Mode”:“Lossy”,
“StreamSize”:“28198912”,
“ServiceKind”:“CM”,
“Default”:“Yes”,
“AlternateGroup”:“2”,
“Encoded_Date”:“2017-01-23 18:50:03 UTC”,
“Tagged_Date”:“2017-01-23 18:50:03 UTC”,
“extra”:{“ComplexityIndex”:“16”,“NumberOfDynamicObjects”:“15”,“BedChannelCount”:“1”,“BedChannelConfiguration”:“LFE”,“bsid”:“16”,“dialnorm”:“-31”,“compr”:“0.53”,“acmod”:“7”,“lfeon”:“1”,“dmixmod”:“3”,“ltrtcmixlev”:“-3.0”,“ltrtsurmixlev”:“-3.0”,“lorocmixlev”:“-3.0”,“lorosurmixlev”:“-3.0”,“dialnorm_Average”:“-31”,“dialnorm_Minimum”:“-31”,“compr_Average”:“1.27”,“compr_Minimum”:“0.53”,“compr_Maximum”:“1.94”,“compr_Count”:“32”}}]}
}

Hi there,

Can you share us detailed logs for the issues?

Thanks