diff options
author | Eric Laurent <elaurent@google.com> | 2015-01-30 11:49:43 -0800 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2015-01-30 11:49:43 -0800 |
commit | a82797faddb37adb2d441737884576684c8515cb (patch) | |
tree | 68f6794347c78e26ec90a25373f6efb7894ba4fe /services/audiopolicy | |
parent | a93fd2be99d21629bed504b9b7df035fc2f54562 (diff) | |
download | frameworks_av-a82797faddb37adb2d441737884576684c8515cb.zip frameworks_av-a82797faddb37adb2d441737884576684c8515cb.tar.gz frameworks_av-a82797faddb37adb2d441737884576684c8515cb.tar.bz2 |
audio policy: add fallback for output selection
When getOutputForDevice() finds a matching direct output profile
but fails to open it, try to fallback to downmix on mixer output
when format is PCM and sampling rate allows it.
Bug: 19197137.
Change-Id: I197b9b202504265b6928e69740875cb7aba5c2c5
Diffstat (limited to 'services/audiopolicy')
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp index fb74d66..c1c6c57 100644 --- a/services/audiopolicy/AudioPolicyManager.cpp +++ b/services/audiopolicy/AudioPolicyManager.cpp @@ -1098,6 +1098,10 @@ audio_io_handle_t AudioPolicyManager::getOutputForDevice( if (output != AUDIO_IO_HANDLE_NONE) { mpClientInterface->closeOutput(output); } + // fall back to mixer output if possible when the direct output could not be open + if (audio_is_linear_pcm(format) && samplingRate <= MAX_MIXER_SAMPLING_RATE) { + goto non_direct_output; + } return AUDIO_IO_HANDLE_NONE; } outputDesc->mSamplingRate = config.sample_rate; |