media icon indicating copy to clipboard operation
media copied to clipboard

Why was max channel count handling changed to not check Spatializer anymore?

Open nift4 opened this issue 1 month ago • 1 comments

Dolby codecs have an optimized downmix feature. If max output channels is not set, it will output stereo audio with downmix optimized for sound quality. If max output channels is set to >=12 instead the unmodified audio will be output. Spatializer requires full set of channels to work, so Dolby recommends to set max output channels on codec to 99 if spatialization is enabled:

https://professionalsupport.dolby.com/s/article/Enabling-Dolby-Atmos-in-Android-Mobile-media-apps?language=en_US at "Important notice when targeting Android 12L (API level 32) and later."

However when spatialization is disabled the codec should do stereo downmix by just not setting max channel count. ("it's necessary to monitor if the spatializer status changes during playback. This can happen if the end user modifies the spatializer effect settings. In such cases, playback should be adjusted to reflect those changes.")

Since https://github.com/google/ExoPlayer/commit/0dd108046bef3be37c4a15bcc8e139be61e7571 ExoPlayer ignores the Spatializer API's opinion and just hardcoded max channel count to 99.

Is it possible to explain why it was done?

Thanks in advance.

nift4 avatar Nov 13 '25 18:11 nift4

It seems these docs also still describe the old behaviour: https://developer.android.com/media/grow/spatial-audio#channel-count-constraints which is confusing to me

nift4 avatar Nov 18 '25 17:11 nift4