summaryrefslogtreecommitdiffstats
path: root/media/libmedia/IAudioFlinger.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-07-03 12:28:53 -0700
committerGlenn Kasten <gkasten@google.com>2014-07-17 12:13:18 -0700
commit7410591dad836434c72ddee66680802708b70c10 (patch)
tree697a233ffced732dbe113c927d9de61f14ea3f2c /media/libmedia/IAudioFlinger.cpp
parentb3b1660ecb67f61f9da54efced8677fa3a6f4863 (diff)
downloadframeworks_av-7410591dad836434c72ddee66680802708b70c10.zip
frameworks_av-7410591dad836434c72ddee66680802708b70c10.tar.gz
frameworks_av-7410591dad836434c72ddee66680802708b70c10.tar.bz2
Move AudioRecord frame count calculations to server
Buffer frame count and notification frame count are now calculated by server instead of by client. The server has more information and can do a better job. Also fix a few bugs: - If a fast track was re-created, even with same pipe depth, it would fail. Now it can correctly re-create a fast track provided the pipe depth is same. - Notification frame count for fast tracks was calculated by client as 1/2 of the total frame count, which is a large value due to the pipe. Now the notification frame count is set by server to the HAL frame count. This should reduce latency for fast tracks. - EVENT_OVERRUN were happening frequently when there was sample rate conversion, because the client didn't know about the sample rate conversion, and under-estimated the necessary buffer size. Now since server calculates the buffer sizes, EVENT_OVERRUN is unlikely. - RecordThread::createRecordTrack_l was checking for mono and stereo for fast tracks. This is not necessary, and now we can handle a multi-channel fast track. Bug: 7498763 Change-Id: I0c581618e8db33084d5ff9ed50a592990c9749e8
Diffstat (limited to 'media/libmedia/IAudioFlinger.cpp')
-rw-r--r--media/libmedia/IAudioFlinger.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/media/libmedia/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp
index 7795fdb..bd7ea46 100644
--- a/media/libmedia/IAudioFlinger.cpp
+++ b/media/libmedia/IAudioFlinger.cpp
@@ -197,6 +197,7 @@ public:
lSessionId = *sessionId;
}
data.writeInt32(lSessionId);
+ data.writeInt64(notificationFrames != NULL ? *notificationFrames : 0);
cblk.clear();
buffers.clear();
status_t lStatus = remote()->transact(OPEN_RECORD, data, &reply);
@@ -966,7 +967,7 @@ status_t BnAudioFlinger::onTransact(
track_flags_t flags = (track_flags_t) data.readInt32();
pid_t tid = (pid_t) data.readInt32();
int sessionId = data.readInt32();
- size_t notificationFrames = 0;
+ size_t notificationFrames = data.readInt64();
sp<IMemory> cblk;
sp<IMemory> buffers;
status_t status;