diff options
author | Jeff Brown <jeffbrown@google.com> | 2013-08-16 20:10:48 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2013-08-19 15:47:33 -0700 |
commit | b96b2839f464f93e30d256124034ec985f8a9702 (patch) | |
tree | 3ea3e6b5cf4bad03ac0f3679f0cb92123fb59973 /audio | |
parent | 0f330488afcfff031bc0ba88de826f998f7cfaf9 (diff) | |
download | hardware_libhardware_legacy-b96b2839f464f93e30d256124034ec985f8a9702.zip hardware_libhardware_legacy-b96b2839f464f93e30d256124034ec985f8a9702.tar.gz hardware_libhardware_legacy-b96b2839f464f93e30d256124034ec985f8a9702.tar.bz2 |
Automatically enable/disable remote submix when input started.
When recording from the audio submix begins, enable the remote
audio submit output device. When it ends, disable it.
Bug: 10265163
Change-Id: Ia0dc2e20623bb834d06561469ce856688991243b
Diffstat (limited to 'audio')
-rw-r--r-- | audio/AudioPolicyManagerBase.cpp | 13 | ||||
-rw-r--r-- | audio/audio_policy.conf | 20 |
2 files changed, 32 insertions, 1 deletions
diff --git a/audio/AudioPolicyManagerBase.cpp b/audio/AudioPolicyManagerBase.cpp index 56ec96e..01fb48f 100644 --- a/audio/AudioPolicyManagerBase.cpp +++ b/audio/AudioPolicyManagerBase.cpp @@ -969,6 +969,13 @@ status_t AudioPolicyManagerBase::startInput(audio_io_handle_t input) if ((newDevice != AUDIO_DEVICE_NONE) && (newDevice != inputDesc->mDevice)) { inputDesc->mDevice = newDevice; } + + // automatically enable the remote submix output when input is started + if (audio_is_remote_submix_device(inputDesc->mDevice)) { + setDeviceConnectionState(AUDIO_DEVICE_OUT_REMOTE_SUBMIX, + AudioSystem::DEVICE_STATE_AVAILABLE, AUDIO_REMOTE_SUBMIX_DEVICE_ADDRESS); + } + AudioParameter param = AudioParameter(); param.addInt(String8(AudioParameter::keyRouting), (int)inputDesc->mDevice); @@ -995,6 +1002,12 @@ status_t AudioPolicyManagerBase::stopInput(audio_io_handle_t input) ALOGW("stopInput() input %d already stopped", input); return INVALID_OPERATION; } else { + // automatically disable the remote submix output when input is stopped + if (audio_is_remote_submix_device(inputDesc->mDevice)) { + setDeviceConnectionState(AUDIO_DEVICE_OUT_REMOTE_SUBMIX, + AudioSystem::DEVICE_STATE_UNAVAILABLE, AUDIO_REMOTE_SUBMIX_DEVICE_ADDRESS); + } + AudioParameter param = AudioParameter(); param.addInt(String8(AudioParameter::keyRouting), 0); mpClientInterface->setParameters(input, param.toString()); diff --git a/audio/audio_policy.conf b/audio/audio_policy.conf index d4e7844..804558e 100644 --- a/audio/audio_policy.conf +++ b/audio/audio_policy.conf @@ -9,7 +9,7 @@ global_configuration { attached_output_devices AUDIO_DEVICE_OUT_SPEAKER default_output_device AUDIO_DEVICE_OUT_SPEAKER - attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC + attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_REMOTE_SUBMIX } # audio hardware module section: contains descriptors for all audio hw modules present on the @@ -43,4 +43,22 @@ audio_hw_modules { } } } + r_submix { + outputs { + submix { + sampling_rates 44100|48000 + channel_masks AUDIO_CHANNEL_OUT_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX + } + } + inputs { + submix { + sampling_rates 44100|48000 + channel_masks AUDIO_CHANNEL_IN_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_IN_REMOTE_SUBMIX + } + } + } } |