Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a24db48 authored by François Gaffie's avatar François Gaffie Committed by Eric Laurent
Browse files

[BUG] Fails to find a profile for AudioSource for Direct Output



When trying to start an audio source expected to be routed on a Direct
Output, it fails on identifying the matching profile due to wrong
channel mask.
The channel mask is taken from the source port configuration, which
is an input device. Thus, it fails to apply to identify a sink profile.

Bug: 238058094
Test: adb shell ./data/nativetest/AudioPolicyEmulatorTests/AudioPolicyEmulatorTests --gtest_filter=*AudioSourceBridgingTest.UsingAudioSourceAPI/4

Signed-off-by: default avatarFrançois Gaffie <francois.gaffie@renault.com>
Change-Id: I6c460ea765b5eb8ec26e56547e8262beb347f2b2
parent 24255a17
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -4519,7 +4519,11 @@ status_t AudioPolicyManager::createAudioPatchInternal(const struct audio_patch *
                    audio_attributes_t resultAttr;
                    audio_config_t config = AUDIO_CONFIG_INITIALIZER;
                    config.sample_rate = sourceDesc->config().sample_rate;
                    config.channel_mask = sourceDesc->config().channel_mask;
                    audio_channel_mask_t sourceMask = sourceDesc->config().channel_mask;
                    config.channel_mask =
                            (audio_channel_mask_get_representation(sourceMask)
                                == AUDIO_CHANNEL_REPRESENTATION_INDEX) ? sourceMask
                                    : audio_channel_mask_in_to_out(sourceMask);
                    config.format = sourceDesc->config().format;
                    audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE;
                    audio_port_handle_t selectedDeviceId = AUDIO_PORT_HANDLE_NONE;