From 5c9f0837b3094923229127ef154507fda311a21b Mon Sep 17 00:00:00 2001 From: Dean Wheatley Date: Thu, 21 Nov 2019 13:39:31 +1100 Subject: [PATCH] Add IEC958_NONAUDIO output flag to MSD patches For the formats compatible with IEC61937 encapsulation, assume that the record thread input from MSD is IEC61937 framed (for proportional buffer sizing). Add the AUDIO_OUTPUT_FLAG_IEC958_NONAUDIO flag so downstream HAL can distinguish between raw and IEC61937 framed streams. Test: manual test on BCM TV device Change-Id: I8f09f936ccce63985df4ad00433299b063769419 --- .../audiopolicy/managerdefault/AudioPolicyManager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp index 23c0a12b15..8085fd5586 100644 --- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp +++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp @@ -1355,6 +1355,14 @@ status_t AudioPolicyManager::getBestMsdAudioProfileFor(const spflags.output = static_cast( sinkConfig->flags.output | AUDIO_OUTPUT_FLAG_DIRECT); + if (audio_is_iec61937_compatible(sinkConfig->format)) { + // For formats compatible with IEC61937 encapsulation, assume that + // the record thread input from MSD is IEC61937 framed (for proportional buffer sizing). + // Add the AUDIO_OUTPUT_FLAG_IEC958_NONAUDIO flag so downstream HAL can distinguish between + // raw and IEC61937 framed streams. + sinkConfig->flags.output = static_cast( + sinkConfig->flags.output | AUDIO_OUTPUT_FLAG_IEC958_NONAUDIO); + } sourceConfig->sample_rate = bestSinkConfig.sample_rate; // Specify exact channel mask to prevent guessing by bit count in PatchPanel. sourceConfig->channel_mask = audio_channel_mask_out_to_in(bestSinkConfig.channel_mask);