Require HW AV sync flag match for compatible output IOProfile

Previously, Audio HAL implementers need all HW A/V sync profiles
declared after non HW A/V sync profiles in their audio policy
configurations, otherwise a HW A/V sync profile match could be
found for a non HW A/V sync (e.g. direct only) request, the
Audio HAL output stream would be opened with the HW A/V sync
flag, and Audio HALs typically fail to process the stream as
they are setup to parse in-band HW A/V sync headers (even if
they don't receive keyStreamHwAvSync AudioParameter).

Test: atest audiopolicy_tests
  AudioPolicyManagerTVTest#MatchOutputNoHwAvSync fails w/o IOProfile change,
  passes with the change.
Bug: 140447125

Merged-In: Icfc806497b5b23013e63621a585c28d1d7a9882a
Change-Id: Icfc806497b5b23013e63621a585c28d1d7a9882a
gugelfrei
Mikhail Naganov 5 years ago
parent b0d7fba6e5
commit edad5db98d

@ -79,7 +79,9 @@ bool IOProfile::isCompatibleProfile(const DeviceVector &devices,
}
}
if (isPlaybackThread && (getFlags() & flags) != flags) {
const uint32_t mustMatchOutputFlags = AUDIO_OUTPUT_FLAG_HW_AV_SYNC;
if (isPlaybackThread && (((getFlags() ^ flags) & mustMatchOutputFlags)
|| (getFlags() & flags) != flags)) {
return false;
}
// The only input flag that is allowed to be different is the fast flag.

Loading…
Cancel
Save