summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioStreamOut.cpp
diff options
context:
space:
mode:
authorPhil Burk <philburk@google.com>2015-07-14 09:42:29 -0700
committerLajos Molnar <lajos@google.com>2015-07-17 20:56:04 +0000
commitca5e6143740299c877d69e97f7968cd04476d32c (patch)
tree50101b57406c5abce066ec90120d91d3dfd0152b /services/audioflinger/AudioStreamOut.cpp
parentbc24bb8a552097e7975d0c16fad80158b542ba62 (diff)
downloadframeworks_av-ca5e6143740299c877d69e97f7968cd04476d32c.zip
frameworks_av-ca5e6143740299c877d69e97f7968cd04476d32c.tar.gz
frameworks_av-ca5e6143740299c877d69e97f7968cd04476d32c.tar.bz2
AudioFlinger: fix repeated underruns for compressed audio
The AudioFlinger kept pausing the audio when playing compressed AC3 or DTS. This caused pause/resume loops that were hard to break out of. The AudioFlinger was thinking that the compressed audio was PCM because the HAL was in PCM mode playing SPDIF data bursts. It also thought that EAC3 was at 192000 Hz instead of 48000 Hz because the data bursts are played at a higher rate. This CL adds more calls to the shim that separates the AudioFlinger. Now the AudioFlinger gets information about the HAL sample rate, channel masks and format from the shim instead of calling the HAL directly. The AudioFlinger now uses a different threshold for detecting underruns when the audio is compressed. Bug: 19938315 Bug: 20891646 Change-Id: Ib16f539346d1c7a273ea4feb3d3afcc3dc60237d Signed-off-by: Phil Burk <philburk@google.com>
Diffstat (limited to 'services/audioflinger/AudioStreamOut.cpp')
-rw-r--r--services/audioflinger/AudioStreamOut.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/services/audioflinger/AudioStreamOut.cpp b/services/audioflinger/AudioStreamOut.cpp
index f953cc8..b6d1be7 100644
--- a/services/audioflinger/AudioStreamOut.cpp
+++ b/services/audioflinger/AudioStreamOut.cpp
@@ -143,9 +143,19 @@ status_t AudioStreamOut::open(
return status;
}
-size_t AudioStreamOut::getFrameSize()
+audio_format_t AudioStreamOut::getFormat() const
{
- return mHalFrameSize;
+ return stream->common.get_format(&stream->common);
+}
+
+uint32_t AudioStreamOut::getSampleRate() const
+{
+ return stream->common.get_sample_rate(&stream->common);
+}
+
+audio_channel_mask_t AudioStreamOut::getChannelMask() const
+{
+ return stream->common.get_channels(&stream->common);
}
int AudioStreamOut::flush()
@@ -165,7 +175,6 @@ int AudioStreamOut::standby()
ALOG_ASSERT(stream != NULL);
mRenderPosition = 0;
mFramesWrittenAtStandby = mFramesWritten;
- ALOGI("AudioStreamOut::standby(), mFramesWrittenAtStandby = %llu", mFramesWrittenAtStandby);
return stream->common.standby(&stream->common);
}