History log of /frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6e2770ef771b7a3042d606c37f9c3af8a933439b 01-May-2018 Phil Burk <philburk@google.com> aaudio: use weak pointer to prevent UAF

Avoid using the mServiceEndpoint smart pointer
from multiple threads.

Bug: 74122779
Test: see bug for test instructions
Change-Id: Idaf9e32a163b25e51bde35d6f5ea10a372b5d916
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
fbf031e8f197c916ae9c399f42926494ebdeb497 13-Oct-2017 Phil Burk <philburk@google.com> aaudio: cleanup logs and comments

This CL should not change any code behavior except for log text.
Mostly it removes redundant class names from the log.

Test: CTS nativemedia/aaudio
Change-Id: I6a6d01da080f536d5345f2b0deb32e92ed1e3d47
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
523b3047af443d0a51141ddabd328d52be5a23b0 13-Sep-2017 Phil Burk <philburk@google.com> aaudio: keep track of streams using strong pointers

Maintain strong pointer to service stream during service calls.
Use simple AAudioStreamTracker instead of complex HandleTracker.

Bug: 65280854
Test: affects all MMAP streams, run all CTS tests, etcetera
Change-Id: I3d2ed8b588ea39c216dacd4dea503b11c33f36f3
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
bcc3674648bc6f554d89a2a5d7721ed41c53f83b 01-Sep-2017 Phil Burk <philburk@google.com> aaudio: fix timestamps and underruns

Start the client after we get valid timing data from the server.
That can take a while because of the long cold start times.
The client is synced with the current position of the service.
Now the client can start clean with no underruns.

Bug: 63918065
Test: test_timestamps.cpp
Change-Id: I5d01eb844e4b14cd5477d56ea1dd9e309abc1c52
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
81ad5ecd211d0f30225714ae8ee61c4d76dbcf56 01-Sep-2017 Phil Burk <philburk@google.com> audioflinger: pass return code up from startClient

Was ignoring failed start.

Bug: 65262790
Test: see bug
Change-Id: I0b1d19adfd50d2b00d86bb82f278b720fcbacdb1
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
39f02ddfbfd9313370d862a6c4727826379a319a 04-Aug-2017 Phil Burk <philburk@google.com> aaudio: fix EXCLUSIVE mode interfering with SHARED

The MMAP endpoints were not tracked by the EndpointManager
so it could not broker EXCLUSIVE access. To fix this the MMAP stream
was refactored to use a per-client stream and a per-device endpoint.

Cleanup close() of MMAP stream.
Add AAudioServiceEndpointShared.cpp.
Extract AAudioServiceEndpointMMAP from AAudioServiceStreamMMAP.
Track MMAP endpoints so we can manage EXCLUSIVE and SHARED access.

Bug: 64494572
Bug: 64310586
Test: see bug, use write_sine to play a shared stream and a excl stream
Change-Id: I5053193abfd9b8a69a2f7e1110739d65e2af5d64
Merged-In: I5053193abfd9b8a69a2f7e1110739d65e2af5d64
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
e72481c5c16d401c776e0ba49b84b80223769b91 08-Aug-2017 Phil Burk <philburk@google.com> aaudio: fix ownership problems with file descriptors

Use unique_fd to track file descriptors.
Fix extra close of file descriptor in SharedMemoryParcelable.cpp.
This bug was causing unrelated file descriptors to be closed!

Bug: 64311216
Test: write_sine.cpp, FD should survive aaudio close
Change-Id: I4f38c83510a49ea22b79b96d970ee48153417249
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
97350f9df7252c881f011a410fcd9e6d766d2bee 22-Jul-2017 Phil Burk <philburk@google.com> aaudio: improve accuracy of timestamps

Account for latency added by the AAudio service.
Fix input timestamps.

Bug: 37080396
Test: test_timestamps.cpp input_monitor.cpp
Change-Id: I1053cd21af722bb9b9371df4e5731bf4a0a57b0b
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
fd34a9310659aa53e9e10d6826651577a75f6447 19-Jul-2017 Phil Burk <philburk@google.com> aaudio: reduce glitching by improving sleep timing

ALways sleep a minimum time to avoid busy wait in real-time thread.
Account for wakeup jitter in threads on the other side of a FIFO.
Avoid race condition that caused a longer sleep than necessary.
Fix calculation of mFreeRunning for capture mode.

Also added systrace logging, which was used to debug this.

Bug: 63814792
Test: Run GStomper on Walleye with MMAP on, see bug
Change-Id: I7b20098580ff454365425bd21e43c17ade532a0a
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
c1fe2634dc228640119849692cd1defb88bc2209 19-Jul-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "aaudio: fix intermittent hang and position error" into oc-dr1-dev
4dbbda2d8c84eabc0cd7c7ee032c2280258f4ffb 18-Jul-2017 Phil Burk <philburk@google.com> Merge "audio: reduce logspam from MMAP mode" into oc-dr1-dev
940083c3049e269f6c150d5477eccb6bad32b129 18-Jul-2017 Phil Burk <philburk@google.com> aaudio: fix intermittent hang and position error

Fix hang caused by recursive mutex.
Fix disconnect caused by getPosition() failing, which was
just because the stream wasn't ready yet.

Bug: 63775537
Bug: 63709749
Test: run "aaudio_loopback -pl -Pl -c2 -n6 -te -m" many times
Change-Id: Ic1d54360b55cfc8ecc1809584c262bc0976c58bb
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
c7abac4329e15cda4bbbd25f8fc4a93b70d70d0a 17-Jul-2017 Phil Burk <philburk@google.com> audio: reduce logspam from MMAP mode

Bug: 63760826
Test: run CTS nativemedia/aaudio and notice less logging
Change-Id: I04564963f85577a53f40f1bad064f5e79723ac76
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
901f65deb49786f4dffd39ac965c0bb681392c0b 13-Jul-2017 jiabin <jiabin@google.com> Add parameters validation on AAudio MMap server

Bug: 63384314
Test: adb shell /system/bin/write_sine -m -pl -n4 \
&& adb shell /system/bin/write_sine -pl -n4 \
&& adb shell /system/bin/write_sine_callback -m -pl -n4 \
&& adb shell /system/bin/write_sine_callback -pl -n4 \
&& adb shell /system/bin/CtsNativeMediaAAudioTestCases32

Change-Id: I462f956e8fc25eb583699af6389e0f299243eafb
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
cb4dae216758d9e9a28050f65097f1ce905c03e9 02-Jul-2017 Eric Laurent <elaurent@google.com> aaudio: indicate client UID and PID to audio flinger

Implement correct indication of client UID and PID to audio flinger
for AAudio MMAP streams in both exclusive mode and shared mode.
- Add start/stop client methods on MMAP streams used only when the MMAP
stream is in AAudio service and carries a mix of shared streams.
- Add "In Service'" indication from "client" side to AAudioServiceStreamMMAP
so that the behavior can be adapted accordingly.
- Modify logic on audio flinger side with regard to mmap tracks and
audio HAL stream activity:
- use same audio session for all clients on a same stream to match
audio policy logic to share same direct output stream for clients on same
session. This is also more consistent with current volume and effect
handling as all MMAP clients sharing the same output stream have the
same volume and use case.
- start/stop the HAL when the stream is started/stopped with the initial client
handle (returned when the stream is opened) but do not create a track.
AAudioService implementation will always send an additional start command before
first client starts and a stop command after last client stops,
in both shared and exclusive mode.
- start/stop a track only if the start/stop stream command is received
with a handle different from the initial handle.
- Allow more than one active client from the same UID on a MMAP input in audio policy.

Bug: 62950008
Test: verify playback and capture in mmap mode
Merged-In: I86151bbb637ff172d2fd5f813056eab13a7bcd3c
Change-Id: I86151bbb637ff172d2fd5f813056eab13a7bcd3c
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
5a26e665e1abb00ed1c8a7e421e19763324776e9 07-Jul-2017 Phil Burk <philburk@google.com> aaudio: do not assert if deleting an unopened stream

Bug: 63440754
Test: write_sine.cpp, see bug for repro case
Change-Id: I1f7ed1bd97d4cfcd54d27d41d708c6c03d3d88ac
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
98d6d9227f6599a5aa7b023217c02a01cc4536cb 06-Jul-2017 Phil Burk <philburk@google.com> aaudio: stop calling virtual methods from destructor

Was calling close(), which is abstract and virtual.
This may have been related to some audioserver crashes.
Also cleaned up some strong pointer handling.

Bug: 63390734
Bug: 63353455
Test: run CTS nativemedia/aaudio many times
Change-Id: Ib95aed60a64771b64395c67f0921c67146f9d10f
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
d51329eca85112973867a6bf0d210e82d6d1c411 01-Jul-2017 Eric Laurent <elaurent@google.com> aaudio: enable exclusive MMAP mode support

Allow exclusive MMAP mode only if the HAL indicates
that the FD returned for shared memory buffer can be shared
with any application.

NOTE: the way the HAL indicates this is temporary until the audio
HAL is modified in next HIDL release.

Bug: 37167970
Test: check playback and capture in mmap exclusive and shared mode
Change-Id: I09c1461b2f99532ded2ef9d36d483b82096fda68
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
5ef003b750ae5188c36d6512584da442be125148 30-Jun-2017 Phil Burk <philburk@google.com> aaudio: disconnect when onTearDown() called

It will be called, for example, when switching from speaker to Bluetooth.

Bug: 62883778
Test: run a long app and switch to or from Bluetooth
Change-Id: Iafb9b52d85c30fee71de46abfb99a27a1daabf59
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
11e8d335b1da528ee771b19b63df23ae6fd52f41 24-May-2017 Phil Burk <philburk@google.com> aaudio: close MMAP stream if client dies

Notify client when audio service dies. Clear connection.
Notify AAudio service when client dies. Close client streams.

Use sp<> to track ServiceStreams.

Bug: 38267698
Test: test_no_close.cpp
Change-Id: I5f1699ed3b8b7bd960947c0028a89ca8419ce7a0
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
ec89b2e2f8c84a7d3936db1a888034f4a4b0df16 21-Jun-2017 Phil Burk <philburk@google.com> aaudio: fix CTS for MMAP mode

Improve calculation of buffer capacity based on requested minimum.
Adjust timing of start() to reduce underflows.
Track ServiceEndpoints based on requested deviceId.
Fix getFramesRead() and flush() behavior.
Fix timeouts due to ClockModel lateness bug.
Misc cleanup.

Bug: 37755299
Test: test_aaudio.cpp
Change-Id: I637c16e87fbe14b6f28c60aeea0b9dfed965ecd0
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
9dca9824da74d50be02bc81f539cc77b7bde678a 26-May-2017 Phil Burk <philburk@google.com> aaudio: remove deprecated aaudio_audio_format_t

Should be using aaudio_format_t

Bug: 62141619
Test: compile and run CTS test_aaudio.cpp
Change-Id: Ibbba2769dfd8bcd9c108d87c19fe1fad2ba43df1
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
cf5f6d2825d9a8430a291042ca9c6f68e5b666d0 26-May-2017 Phil Burk <philburk@google.com> aaudio: reduce logspam, improve critical logs

This will make AAudio less annoying and easier to debug.

Bug: 62080950
Test: look in logcat
Change-Id: Id7ae26a212f83ea8be0b285bd20334eb48607be8
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
87c9f646a94259d7c321c3b3d5947fa1778f5ac2 17-May-2017 Phil Burk <philburk@google.com> aaudio: lower latency using MMAP capture

MMAP can be enabled by setting system properties.

Bug: 38267780
Test: input_monitor.cpp
Change-Id: I5e86fd1d9baef4fe59837ccbca7971acbb54d8b5
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
c8f69a08a409fd163873d725c63f8d60259ae21d 12-May-2017 Phil Burk <philburk@google.com> aaudio: control MMAP mode using system properties

To facilitate testing of MMAP mode.

Bug: 38268547
Test: set properties, see framesPerBurst in write_sine_callback.cpp
Change-Id: I6e15c563215017f6a5020d89ac312ff8331afc4f
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
942bdc0aebc88dc8b12c0e7742ec0003bbb8b80f 03-May-2017 Phil Burk <philburk@google.com> aaudio: plug some resource leaks

Close some file descriptors for shared memory that were not getting closed.

Bug: 37947848
Test: see bug for test procedure
Change-Id: Icdc13188b0a49d08b67babff0852c3a4eda8fd2b
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
4c5129b410884ec0400cbe65fce56d0ade12d11b 29-Apr-2017 Phil Burk <philburk@google.com> aaudio: Fix getFramesWritten() for callback mode.

Plus other small fixes for CTS and cleanup

Bug: 37910599
Test: test_aaudio.cpp
Change-Id: I65a23daf99e9de857d3ce9fd12e9f11c614e298e
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
71f35bb687476694882a617ba4a810a0bb56fe23 14-Apr-2017 Phil Burk <philburk@google.com> aaudio: fix SHARED MMAP mode in server plus other bugs

Fixed some buffer miscalculations, and some NPEs in the close() code.
Added debugging and some general cleanup.
Fixed data conversion.
Fixed start/pause/flush in server.
Added reference counting in server for endpoints.
Programs can now be ran more than once.
General code cleanup.
Reconnect with service if server dies.
Move stop() logic into server for better synchronization.
Add sleep to prevent race condition when closing an MMAP stream.

Bug: 33398120
Test: two write_sine_callback.cpp can be run simultaneously
Change-Id: Ibb006215a498868c222228d675ff961d7e0bf514
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp
c0c70e3c7dd10bc2c0caffcab1f3f5fb406b35fb 09-Feb-2017 Phil Burk <philburk@google.com> AAudioService: integrated with audioserver

Call the MmapStreamInterface from AudioFlinger instead of the FakeHAL.
Fix sending timestamps from the thread.
Add shared mode in service.

Bug: 35260844
Bug: 33398120
Test: CTS test_aaudio.cpp
Change-Id: I44c7e4ecae4ce205611b6b73a72e0ae8a5b243e5
Signed-off-by: Phil Burk <philburk@google.com>
(cherry picked from commit 7f6b40d78b1976c78d1300e8a51fda36eeb50c5d)
/frameworks/av/services/oboeservice/AAudioServiceStreamMMAP.cpp