Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1803,6 +1803,8 @@ public static int getAudioTrackChannelConfig(int channelCount) {
return AudioFormat.CHANNEL_OUT_5POINT1 | AudioFormat.CHANNEL_OUT_BACK_CENTER;
case 8:
return AudioFormat.CHANNEL_OUT_7POINT1_SURROUND;
case 10:
return AudioFormat.CHANNEL_OUT_5POINT1POINT4;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the commit! We have some details hope to be confirmed:

  1. Is 10 the channel count of the compressed DD+JOC stream or the decoded stream? The reason why we are asking is similar to the discussion in another pull request. At track selection, we will check if the audio can be spatialized and then select that track if possible. If 10 is the channel count of the compressed DD+JOC stream, then we will call spatializer.canBeSpatialized() against CHANNEL_OUT_5POINT1POINT4. But if the decoder outputs a different channel count that the spatializer cannot spatialize, the user won't be able to hear the spatial audio.

  2. Could you please test this change on the device on Android 12L+? ExoPlayer didn't set the key MediaFormat.KEY_MAX_OUTPUT_CHANNEL_COUNT until the API level 32, and according to the previous discussion, the DD+JOC decoder will output 2.0ch PCM in this case.

  3. Just curious, do you know if there is any compressed streams coming with CHANNEL_OUT_7POINT1POINT2, since by making this change, we will assume that 10-channel is always mapped to 5.1.4.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below is my response to your questions:

  1. Here ChannelCount 10 is the decoded stream. On a platform that supports Spatializer, the output can be spatialized otherwise no.
  2. This change has been tested on Android-13 using emulator.
  3. We are using canonical channel mask for the 10 channels as 5.1.4 similar to the 8 channels mask of 7.1.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sqshet for the response!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And before I proceed with internal review of this pull request, I have one more question -

What is channel count for the original compressed stream? My concern on the other hand is that if the original channel count is different than 10, for example some other number that falls to AudioFormat.CHANNEL_INVALID mask during the track selection, then Spatializer.canBeSpatialized() can return false with that invalid channel mask (even if the device is actually supports spatialization), then track selector will try to select an alternative track instead of DD+JOC track.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tianyif ,

The input channel count refers to the number of audio objects in the input stream whereas the output channel count maps to canonical channel masks up to 12 channels. As long as canonical channel mask up to 12 channels are supported, it should be OK.

The canonical channel mask what we wanted to add here is for the 10 channels (i.e, 5.1.4).

Thanks

case 12:
return AudioFormat.CHANNEL_OUT_7POINT1POINT4;
default:
Expand Down