Expand no resampling support to Android; cleanup code.
Per discussions with the Android team they recommend we skip resampling when using low power audio. This CL expands the workaround we already have in place for ChromeOS into a more maintable state by introducing AudioLatency::IsResamplingPassthroughSupported(). This method returns true on ChromeOS and on Android when the right criteria are met. There are several changes to the buffering size logic, but none should result in any actual changes to the buffering size outside of the new pass-through case. The pass-through case will prefer the larger of the hardware buffer size or ~20ms to avoid issues with massive bluetooth output buffers. As part of this change I've cleaned up the logic in the mixer manager for determining when to allow passthrough. Per a battor run done by liberato@ this is a ~34% power reduction (!), with a basic mp3 playback going from 0.265W to 0.175W. BUG=731860,747541 TEST=verified resampling is not invoked for basic playback. Change-Id: Ia885f41bc50d6fe36934587d34ae646d1ef89364 Reviewed-on: https://chromium-review.googlesource.com/590737 Commit-Queue: Dale Curtis <dalecurtis@chromium.org> Reviewed-by:Chrome Cunningham <chcunningham@chromium.org> Cr-Commit-Position: refs/heads/master@{#491784}
Showing
Please register or sign in to comment