Was not handling negative IDs correctly.
Update test to allow negative IDs.
Bug: 72333892
Test: CTS has test_session_id
Change-Id: I1ca57026d6202f7d54c8efd51b14854be6cc69e4
Now requestStop() and requestPause() do the appropriate thing
based on state.
Flush is allowed when OPEN, PAUSED or STOPPED because there might
be pre-roll data.
Bug: 69810494
Test: test_various.cpp
Change-Id: Ie1b306b17734a58fa71b1742bb186482893656b7
audio.h and its dependencies (audio-effect.h, sound_trigger.h...)
used to be shared between system and vendor code.
This led to multiple problems:
1) Such sharing contradicts the Treble policy of
strict independence of framework and vendor code.
2) When audio.h was changed, every vendor needed to update
its code in the next release. This meant that audio*.h
headers were mostly changed in backward compatible manner.
Nevertheless, for P the HIDL interface and thus the audio.h
interface are changed in backward incompatible way.
(Some enum are becoming 64 bit long).
3) As the headers were common, some API used only by the framework
needed to be visible to the vendors (mostly enum values).
4) Treble policy is to support at least one previous HAL version
As a result the audio*.h headers are now duplicated,
one set for the framework, and one for the vendor.
Each set will evolve independently. After this split,
the framework-only APIs will be removed from the vendor headers
and vice versa.
The split is implements as such:
+ for system code
- NOT moving the libaudio_system_headers
Eg: system/audio.h and system/audio_effects/effect_equalizer.h
are still in system/media/audio
- the legacy audio HAL API that were in libhardware headers
are now in libaudiohal_legacy_headers
Eg: hardware/audio.h and hardware/audio_effect.h
are now in frameworks/av/media/libaudiohal/legacy/
+ for vendor code
- moving libaudio_system_headers and the legacy audio HAL API
that were in libhardware_headers in
android.hardware.audio.common.legacy@2.0
Note that those headers are now versioned, so migrating to a @4.0
HIDL HAL will mean changing the legacy dependency too.
Eg: system/audio.h, system/audio-effect.h, hardware/audio.h
are now in hardware/interfaces/audio/common/2.0/legacy
- the legacy audio effect HAL API that was in libaudioeffects
is now moved in android.hardware.audio.effect.legacy@2.0
Eg: audio_effects/effect*.h are now in
hardware/interfaces/audio/effect/2.0/legacy
- the legacy sound trigger HAL API that were in libhardware_headers
is now moved in android.hardware.soundtrigger.legacy@2.0
Eg: hardware/sound_trigger.h is now in
hardware/interfaces/audio/effect/2.0/legacy
libaudioutil being used by both system and vendor, had
to be renamed for system to libaudioutil_system.
Vendor libs that now depend on the audio.h of a specific
version and are not extensively referenced in non google code,
append @2.0 to their name.
Note that headers that are not expected to change in the 4.0 HAL are
left in all-versions folder to avoid duplication.
This is an implementation detail as the versioned libraries export
the all-versions headers.
Note that strict vendor-system separation is enforced by the
build-system. The system headers are not available for vendor
libs and vice-versa.
Note that this patch is split between numerous git repository (>10),
all the commits having the same Change-id for searchability.
Note that audio_policy.h is no longer exposed to vendors
as the legacy audio policy HAL API was never officially supported.
As a result the audiopolicy stub implementation has been removed.
Test: compile taimen-userdebug walleye-userdebug
sailfish-userdebug marlin-userdebug
gce_x86_phone-userdebug gce_x86_phone
full-eng aosp_arm aosp_x86-eng
Test: check that the emulator booted and played audio
Test: full QA on sailfish-userdebug and taimen-userdebug
Bug: 38184704
Change-Id: I950f4e0a55613d72e32eba31bd563cb5bafe2d1a
Signed-off-by: Kevin Rocard <krocard@google.com>
Using the legacy HAL interface was not needed. Only the system audio
header types are used by aaudio.
Test: compile
Bug: 38184704
Change-Id: I321635ef79732eb20864d1349e6a13911ece8da5
Signed-off-by: Kevin Rocard <krocard@google.com>
If a sessionID other than AAUDIO_SESSION_ID_NONE is requested
then legacy data path will be forced.
SessionID is implemented for MMAP data path but not used.
It is easier to implement it now then try to figure
it out later.
Bug: 33268927
Test: test_session_id.cpp will be moved to CTS when stable
Change-Id: I3ea67f57c1cbe24a512980f1352b917ab3cb6387
Test AAUDIO_SESSION_ID_NONE.
Test AAUDIO_SESSION_ID_ALLOCATE then use the allocated ID
for both input and output.
Bug: 33268927
Test: this is a test
Change-Id: Ia70670259137e715e75a497ef910a231b638e877
The session ID can be associated with a group of audio effects.
The effects can be controlled from the Java API.
Bug: 33268927
Test: test_session_id.cpp
Change-Id: Ifaec4d48e33428221ef4f7dd2c61067554527197
These docs apply to O and P release.
Say POWER_SAVING not supported on input.
Emphasize that error callback should not stop or close directly.
Fix some incorrect function names in comments.
Bug: 62291775
Bug: 72036879
Test: read the autodocs to see if they make sense
Change-Id: Id03a7733735b856499dd944eb9e3c1523f8b6650
Set callback enable flag before starting AudioTrack callback.
Bug: 72115512
Test: Repeat: adb shell write_sine_callback -pn -s4
Test: 20 times and make sure framesWritten is advancing.
Change-Id: I670fde46da0dccf8a6d03478fe2aa8b7ad596a3b
The attributes were not propagating all the way down for MMAP
streams.
Bug: 72046612
Bug: 72049948
Test: adb shell aaudio_loopback -te -pl -n1 -x -X -i6
Change-Id: I41b592d0c3a9daef5070ad299198c8d6cd890cfc
Name them "AAudio_#" where # is an increasing index.
For example AAudio_1, AAudio_2, etc.
Also name threads that are used for sending timestamps.
Test: run write_sine_callback then dump the threads for that process.
Change-Id: Ibd8c7be1109f6c15a4601ef154038cdce2e65e11
Needed to keep track of when functions were added to an API.
Bug: 68052449
Test: CTS test_aaudio_attributes.cpp
Change-Id: I7c325e9ca71ff92550cd743c456745569dd6a40d
Pass these audio attributes to AudioFlinger.
Bug: 68052449
Bug: 62104146
Test: test_attributes.cpp will be moved to CTS when ready
Change-Id: Ib8804614d95dcf1b85e51ec1f5569892e017a991
Pass these audio attributes to AudioFlinger.
Also test for default behavior.
Bug: 68052449
Bug: 62104146
Test: this is a test
Change-Id: I3bef65fb7b7da6eeb670f53aa9e5bf7d237ea714
These correspond to audio attributes already supported in the Java API.
Bug: 68052449
Test: test_attributes.cpp will be moved to CTS when it is ready
Change-Id: I29de99b3e815d4de3eca769da9106b792bce80bb
Save recording in a WAV file instead of a RAW file.
Add a test mode that reads a WAV file, for debugging auto-correlation.
Cleanup printed reports.
Discard more input buffers at beginning.
Test: this is a test
Change-Id: Ib5ea63882eda325b02716a448897007a945f7312
The compiler was complaining because a pointer was printed after it was
freed. The compiler folks agree this is OK and recommended a technique that
prevents the warning.
Test: any AAudio program, look at log for close
Change-Id: I49c005b48edc4a5dcb5c85da2a9e875befc37206
Test whether functions are illegal from a callback.
Also test AAUDIO_CALLBACK_RESULT_STOP
Test: this is a test
Change-Id: I0e91b08951f7f29f6fa317a8b3c4a69f14e58483
Detect whether AAudioStream_requestStop() is being called
from a data or error callback and return error.
Also for start(), pause(), flush() and close().
Honor AAUDIO_CALLBACK_RESULT_STOP in Legacy callback.
Bug: 65560631
Bug: 62943389
Bug: 63096718
Test: test_various.cpp callback_blocker_none and callback_blocker_lowlat
Change-Id: I29a685cd42910f70d16e23db0f9ec00b72451cfc
Was calling setDeviceId(), which is overwritten by set().
Bug: 70512693
Test: write_sine_callback, see bug for details
Test: input_monitor, see bug for details
Change-Id: I484f47e898a0e92a6f88e099a115f3d091c174c2
Randomly start, stop, pause, flush audio streams
to see if we can trigger unexpected bugs.
Test: this is a test
Change-Id: I52a62c247f8c94de024aed63764e8d6b50c59343
The service knows when an actual xrun occurs so we pass
that value to the client.
Bug: 38512417
Test: write_sine_callback -pl -n1 -s20 -c2 -u
Change-Id: I9e5ff1edd2e9378957309280162d7cda855f5adb
It was using numSamples instead of numFrames.
So timing was off.
Bug: 68804159
Test: raise and lower volume without clicking
Test: test_linear_ramp.cpp
Change-Id: I18b10dadbc47ab9cbe9c5aefd4e6197c50a0bedc
Test: I solemnly swear I tested this conflict resolution.
Exempt-From-Owner-Approval: simple merge conflicts
Change-Id: I32cd6ce0eca9b74b20554f20bcf410d76612c47a
-- replace 'loopback' with 'aaudio_loopback', since this is how
the executable is called;
-- remove "-f" argument, as it's not implemented;
-- in the example, replace "-b2" to "-n2" ("-b2" doesn't seem correct);
-- brush up text layout.
Change-Id: Ifae87380d0c9378f936f661ad77cb94a944c05fc
Test: make and run
This fixes a problem with intermittent severe distortion
and variable latency after restarting a stream.
Bug: 68003241
Test: write_sine_callback -pl -m2 -n2 -s5 -c2 -l100
Merged-In: Id7418adb86f2869ac74936cfbd365815a0a0e923
Change-Id: Id7418adb86f2869ac74936cfbd365815a0a0e923
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
These will actually get installed as tests in /data/nativetest{,64}/...,
instead of into the /system/bin directory.
Test: mmma frameworks/av/media/libaaudio
Change-Id: I41e077e21e3d5c76f0fd5b4f21f7377a0c293740
This fixes a problem with intermittent severe distortion
and variable latency after restarting a stream.
Bug: 68003241
Test: write_sine_callback -pl -m2 -n2 -s5 -c2 -l100
Change-Id: Id7418adb86f2869ac74936cfbd365815a0a0e923
Loop while starting and stopping or pausing/flushing.
Check framesWritten - framesRead.
Blip so we can tell if the beginning of the sound was cut off.
Add -t option for the high pitched prefix tone.
Test: this is a test
Change-Id: I2a642be67f4e80caad015254d006a0153b46e3f7
See build/soong/README.md for more information about Soong.
I didn't translate the examples, since they appear to be NDK build
files, not platform build files.
Test: mmma frameworks/av/media/libaaudio
Change-Id: Icf228c701afe37dd3c7f00ea9e6fb740b0d450f1
Merged-In: Icf228c701afe37dd3c7f00ea9e6fb740b0d450f1
Exempt-From-Owner-Approval: simple backport
(cherry picked from commit 0230b1ac4a)
See build/soong/README.md for more information about Soong.
I didn't translate the examples, since they appear to be NDK build
files, not platform build files.
Test: mmma frameworks/av/media/libaaudio
Change-Id: Icf228c701afe37dd3c7f00ea9e6fb740b0d450f1
Merged-In: Icf228c701afe37dd3c7f00ea9e6fb740b0d450f1
See build/soong/README.md for more information about Soong.
I didn't translate the examples, since they appear to be NDK build
files, not platform build files.
Test: mmma frameworks/av/media/libaaudio
Change-Id: Icf228c701afe37dd3c7f00ea9e6fb740b0d450f1
Just start a new stream without stopping or closing the old disconnected
stream.
Bug: 67664976
Test: this is a test
Change-Id: I674626d0d365ed3a72e079212c6aceed9b0c85fc
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
Simplify registration. Reduce use of virtual methods.
This CL, plus some CLs in AudioManager, should fix
crashes involving RefBase::decStrong
Bug: 65450109
Test: CTS or "write_sine_callback -m2 -pl"
Change-Id: Ie1decd20f8d44bdefb0faf92e6b74de4f72e86bd
but include the associated names in the global symbol export list, so
that apps that receive AAudioTesting.h outside of NDK can access the
symbols without dlsym().
Test: builds OK
Change-Id: If68f35145d68f359ebb7995ffcf9c9b8f9be6eb1
(cherry picked from commit 4257fd9aba)
Also clean up the state machine handling in the data callback.
Prevent error callback sometimes being called twice for the same error.
Bug: 63342351
Bug: 63087953
Test: add sleep(2) to write_sine_callback.cpp before the requestStop()
Change-Id: I27737bcb0371052741f50bda9f65c5994ccf6fd9
Should be AAUDIO_ERROR_INVALID_STATE if no timestamp available.
Bug: 65447871
Test: test_timestamps.cpp should only print AAUDIO_ERROR_INVALID_STATE
Change-Id: Id9e211ef8fce078514f4348a434e0c003372369c
CTS test was crashing because of a multiple inheritance
problem involving PlayerBase.
We now implement separate PlayerBase class that sits between
AudioStream and the system.
Bug: 65450109
Test: CTS nativemedia/aaudio
Change-Id: I424663acc1eeacc9544769991495cb48f4110359
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
Use MonotonicCounter for timestamp position.
Bug: 63918065
Test: write_sine_callback.cpp and test_timestamps.cpp
Change-Id: Iea58384e2d96adcfad586e8c522024baaecccb8c
Automatically reopen the stream if we get disconnected.
Add a futex based signaling class so that the error callback can
immediately inform a waiting thread.
This can be used to prevent the system from playing an unpleasant sound
after the stream is disconnected.
Bug: 63342351
Test: plug and unplug headphones while running write_sine_callback
Change-Id: I3ea4fb24106156a29d2f302f3eb614f25f1b758a
This removes the manually rolled IPlayer implementation and instead uses
an aidl generated implementation. The IPlayer aidl file is moved from
frameworks/base/.
Test: run cts --module CtsMediaTestCases
Bug: 64223827
Change-Id: Ia609f7ba1cc6f71ce919d6174dd8b5e0e1b05575
Note that this uses the -d option, which used to be for durationSeconds.
We now use the -s option for seconds.
Bug: 64981153
Test: this is a test
Change-Id: I9789a1f520dc93bfb26143582dacb9619650abf7
Fix timeout detection so that callback thread can die.
Prevent AAudioBinderClient singleton from getting deleted,
which caused a subsequent lock on a dead object to hang.
Bug: 64988439
Test: "write_sine -m2 -pl" and "adb shell killall audioserver"
Change-Id: I044bce385b66e69007d1997f051c9d6c042b7871
AAudio was setting the stream to PERFORMANCE_MODE_NONE
if we got the FAST mixer but did not get the RAW flag.
We now consider FAST flag by itself to be LOW_LATENCY.
Bug: 63004643
Test: see bug for repro case using NativeOboe app
Change-Id: Id4643d20926a8e983cd28408f70e176976c02195
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
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
Prevent AudioEndpoint from being configure()d twice.
Check return value of AudioEndpoint.configure().
Prevent AudioStreamInternal from being open()ed twice.
Bug: 64522125
Test: adb shell dumpsys media.audio_flinger --unreachable
Change-Id: I3ae07af5610fd1f9e539f884923f781eefcd645f
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
Merged-In: I4f38c83510a49ea22b79b96d970ee48153417249
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
Use AIDL to generate the IAudioRecord interface rather than using
a manually implemented interface.
Bug: 64223827
Test: Ran the AudioNativeTest and CtsMediaTestCases CTS tests.
Change-Id: Iade23c73253a97c358050bbd697ebe592b89a4c0
When a stream is disconnected, clear the MMAP memory
buffer to prevent the hardware from looping on stale data
and making a buzzing sound.
Bug: 63342351
Test: play GStomper with AAudio through headphones and then unplug them
Change-Id: I6372b0a031dea242e3830cc2d226a4c043d4467e
This restores some deprecated functions that some released apps
were calling. Restored:
AAudioStreamBuilder_setSamplesPerFrame()
AAudioStream_getSamplesPerFrame()
Bug: 64346279
Test: put GStomper in AAudio mode using its Settings on Marlin
Change-Id: I2749a06cded9fc3863d233713efda2674cf7f5e3
Report when INVALID_STATE returned.
This was used to debug monkey test errors.
Cleanup some log messages.
Improve "dumpsys media.aaudio"
Bug: 64310586
Test: CTS nativemedia/aaudio
Change-Id: Ifbcac4794cda22cccbacff6352243c0ef4589c53
Add logging to the loopback test.
Update state in the callback.
Implement AAudioStreamRecord::getFramesWritten().
Bug: 62781173
Bug: 64214193
Test: aaudio_loopback.cpp, look for STARTED state while running
Change-Id: Iba867d048dcfcafe6db1d095abe2766f1aabe608
Legacy streams could return EXCLUSIVE from getSharingMode()
if requested by caller. But that is not supported.
To avoid misleading developers, we force it to SHARED mode.
Bug: 63355841
Test: setprop aaudio.mmap_exclusive_policy 2 && write_sine -x -pn
Change-Id: I91c82b63293752c6aa2c4933cd2bfe8c6d41a5d3
but include the associated names in the global symbol export list, so
that apps that receive AAudioTesting.h outside of NDK can access the
symbols without dlsym().
Test: builds OK
Change-Id: If68f35145d68f359ebb7995ffcf9c9b8f9be6eb1
(cherry picked from commit 4257fd9aba)
Mixer was not advancing FIFO when underflowed so the client could not
detect the xrun.
Also underruns could cause the stream to drift in time relative to other
streams.
Bug: 64033855
Test: trigger underruns by sleeping in a callback
Change-Id: Ia038f5048ffbff3b82e9d86e6807483dfe6879d0
Also improve automatic loop gain control for latency testing.
Use ArgParser to parse command line options.
Bug: 38178592
Test: this is a test
Change-Id: Idfe8f25544a3e7c74ee15be008bf34e3a0741455
Use CLOCK_MONOTONIC instead of AAUDIO_CLOCK_MONOTONIC
Bug: 63915257
Test: Look at the generated autodocs.
Change-Id: I856da9ba4139833bcaef6873e87a3ef58e6ace69
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
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
This releaves reviewing burden from the frameworks/av owners.
Note that the lists of owners are inherited from the parent
directories thus the people listed in these files are owners
*in addition* to people listed in frameworks/av/OWNERS,
and frameworks/av/{media|services}/OWNERS.
Change-Id: I5e2db1c40cb807b906b2701fe446c874a8d19983
Test: not needed
This namespace is not used by this file and its declaration is removed
in a separate CL from utils/Log.h, which is the only place it is
defined, so we must remove this extraneous line.
Also, since that separate CL is deprecating utils/Log.h in favor of
log/log.h, we make the switch to the new header.
Test: Build
Exempt-From-Owner-Approval: Owners file needs updating
Change-Id: I34aa80765d30c79f8cb67eaf95a9995066bd672e
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
Add command line options.
Add magnitude measurement.
Add automated latency analyzer that uses round trip echo and an impulse correlation.
Uses Harmonic Product Spectrum technique but in the time domain.
Bug: 33398120
Bug: 38178592
Test: this is a test
Change-Id: Ied6c09e6d8d373a188c13ed85b27de6c4b7be2f4
Signed-off-by: Phil Burk <philburk@google.com>
Generic parser that is used in multiple examples.
Added -n{numberOfBursts} for buffer size.
This is being used to test the MMAP features.
Bug: 63002656
Test: this is a test
Change-Id: Idf7560f9bb3ed7834f6c4686dd6009f27f04220e
Merged-In: Idf7560f9bb3ed7834f6c4686dd6009f27f04220e
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
Change-Id: I86151bbb637ff172d2fd5f813056eab13a7bcd3c
Generic parser that is used in multiple examples.
Added -n{numberOfBursts} for buffer size.
This is being used to test the MMAP features.
Bug: 63002656
Test: this is a test
Change-Id: Idf7560f9bb3ed7834f6c4686dd6009f27f04220e
They should return AAUDIO_ERROR_UNIMPLEMENTED
just like the legacy streams.
Bug: 63351465
Test: CTS test_aaudio.cpp testPauseAndFlushNotSupported
Change-Id: I42c8d45517bf0d808e648287579b9fb0c0cb3ae0
This is a quick workaround that just disables MMAP mode unless
performance mode is LOW_LATENCY.
Bug: 63176221
Test: use write_sine and change performance mode
Change-Id: Ic17ad45366d51d86fb4801c84ada4f6f82b5ff98
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
Add more information about various streams and endpoints.
Bug: 38396780
Test: adb shell dumpsys media.aaudio
Change-Id: I5cc116574bfc3aa93703c182d933dbdfcbefad7a
Testing the new max streams restriction revealed the bug
involving the second shared stream.
Bug: 62951298
Bug: 63171495
Test: test_n_streams.cpp can open MAX_STREAMS_PER_PROCESS MMAP streams
Change-Id: Ibea7d9c4716326a37c669954b52f397ed2968caa
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
Do not call data.checkInterface(this) unless needed,
and properly handle invalid interface.
This prevents stripping the file descriptor from the dump()
binder call.
Test: adb shell dumpsys media.aaudio
Bug: 38396780
Change-Id: I14c847e098145f49d4d5732787d3cc435dd05226
Bug: 62090113
Test: run AAudio test and verify a valid device is reported just
after opening playback or capture streams in legacy mode.
Merged-In: Ic8be42e1735690eb00c811ef0cb8b5abb36172d6
Change-Id: Ic8be42e1735690eb00c811ef0cb8b5abb36172d6
Bug: 62090113
Test: run AAudio test and verify a valid device is reported just
after opening playback or capture streams in legacy mode.
Change-Id: Ic8be42e1735690eb00c811ef0cb8b5abb36172d6
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
They were statically linking with libaaudio.
Bug: 62820459
Test: mmm frameworks/av/media/libaaudio
Change-Id: Ie704dd6c9d12b00c3f16f30d296468c9b5b42776
Check for obviously bad values to prevent common exploits.
Bug: 38205290
Test: CTS test_aaudio.cpp
Change-Id: Ic650dbfbcbb9b87a89aae080ee72910ab2c9409b
Signed-off-by: Phil Burk <philburk@google.com>
Make AudioStreamInternal derive from PlayerBase to
provide playback and volume control via IPlayer interface.
Bug: 62027849
Test: verify aaudio playback in MMAP mode and registration of aaudio
players in AudioService when active
Change-Id: Ia0878d46637c0a954d8a6259868a2d3bccf19119
but include the associated names in the global symbol export list, so
that apps that receive AAudioTesting.h outside of NDK can access the
symbols without dlsym().
Test: builds OK
Change-Id: If68f35145d68f359ebb7995ffcf9c9b8f9be6eb1
These codes were unused or redundant.
Bug: 37755198
Test: CTS test_aaudio_misc.cpp
Change-Id: I46797b9fba9406b9c98d4b9aa49f0cacbec332b9
Signed-off-by: Phil Burk <philburk@google.com>
Make AudioStreamTrack derive from PlayerTrackBase to
provide playback and volume control via IPLayer interface.
Bug: 62027849
Test: verify aaudio playback regressions and registration of aaudio
players in AudioService
Change-Id: I5c04110f1554233eae3f1bc357a64a584d7303d1
Controls whether MMAP data path is used NEVER, AUTO or ALWAYS
For testing only. To improve code coverage in CTS.
Bug: 38268547
Test: write_sine.cpp
Change-Id: Iad97876fb6f1d0c653262161b7b5519d83d16ac5
Signed-off-by: Phil Burk <philburk@google.com>
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>
Add detection for device switch during capture and playback tests:
write_sine, write_sine_callback, input_monitor, input_monitor_callback
Refactor tests and move simple player, simple recorder and utility
methods in separate header files and folder.
Bug: 33355262
Test: run write_sine and input_monitor tests
Change-Id: Iced66fa4344aecd8a2952e22a98e6e8454f38a5e
Implement device switch detection on legacy path (AudioTrack and
AudioRecord) based on audio routing callbacks forcing the stream state
to disconnected.
Bug: 33355262
Bug: 62090113
Test: tested with write_sine and input_monitor command line tools.
Change-Id: I9e0421fee233964b1bf318acb640569196a00f13
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>
This is to match similar code in AudioStreamTrack.
Bug: 38268707
Test: input_monitor.cpp
Change-Id: I0ffd230816b690c979a8a3fe8a93541511728e89
Signed-off-by: Phil Burk <philburk@google.com>
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>
For example, if you cannot get a FAST track then
the performanceMode of the stream will be AAUDIO_PERFORMANCE_MODE_NONE
instead of AAUDIO_PERFORMANCE_MODE_LOW_LATENCY
Bug: 38268707
Test: write_sine_callback.cpp, change modes and sample rates
Change-Id: I33648bd48fd00d588424fa7e4deb2c57c5008423
Signed-off-by: Phil Burk <philburk@google.com>
Made it a Singleton that gets reused.
Bug: 37992613
Test: write_sine_callback.cpp
Change-Id: I63c045bd71d3bc1fc84f5fd4d7a6159fa5184c1c
Signed-off-by: Phil Burk <philburk@google.com>