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
better management of how summarized records are managed.
Use differentiated names for the summations to avoid confusion with
individual records. Track values appropriate to calculating
min, max, mean, and standard deviation.
Bug: 65027360
Test: examination of dumpsys media.metrics -summary
Change-Id: I40d93d8a5a7cc2c188546574f59d557088d9c1e3
Enhances the media.metrics subsystem to track the pkg name & version
so analysis can move from "error rate has climbed" to "error rate has
climbed within app X".
Changes include fields to hold package name/version, the dump protocol
to emit those fields to upload, and better management of metrics data on
device (time and quantity).
Bug: 65027506
Test: review output of dumpsys media.metrics
Change-Id: Ia55b859d903835c84f7d43883f959dc1cdefb081
The cause of frequent "EffectModule 0xxx destructor called with unreleased
interface" messages was due to not releasing the effects when purging
stale effects.
The cause of "Effect handle 0xxx disconnected after thread destruction"
message was due to late binder call for disconnecting already purged
effect handle.
Also improved logging to communicate uuids of the effects causing
these issues.
Bug: 62267926
Test: no aforementioned warnings in the log when opening the Effects
panel in Play Music
Change-Id: I6ec6f60c46dc704226931fb59a641e4cd74c2fd1
(cherry picked from commit 424c4f5b76)
On device where the SONIFICATION (alarm, ringtone) strategy is
supported by SPEAKER_SAFE, prevent switching output devices
when the ENFORCED_AUDIBLE (shutter sound) strategy starts
by having SONIFICATION at a higher priority than
ENFORCED_AUDIBLE.
Test: take photos while phone rings
Bug: 64386853
Change-Id: I2f7bb45599bd51b2142611eefb84789a985e8841
getNewOutputDevice selects a device by checking active strategy when
startSouce() is called. This behavior sometimes leads to set
unsupported device volume index. For example, BT A2DP resume from combo
output. a2dp output only supports A2DP sound devices. If sonification
stream is played via A2DP and Speaker during music playback, volume
index for speaker is applied as music volume when resume playback until
sonification stream is closed. At this time, A2DP device is selected as
routing device, so volume and routed device does not match.
To avoid this situation, setting volume index from supported device
in startSource().
Bug: 64053820
Test: Check volume after alarm sound finish during music playback via BT.
Change-Id: I71dae2c77d82abc0227ec45fc6c40bfd8f51c8c2
Since mediacodec is a 32-bit process, we don't need the 64bit variant of
the software codecs. This will reduce the system partition usage by
about 11MB (for devices with VNDK) or 5.8MB (for other devices).
Bug: 64193930
Test: no libstagefright_soft_*.so files under /system/lib64/ and
/system/lib64/vndk directories
Test: YouTube, Camcorder recording, Video playback work
Change-Id: I52d4947c673c018ac094b3c84c1652d217611894
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
Preserve initial device selection on mmap streams in order to
reuse it when a new client starts on the same stream so that
audiopolicy does not use the default route for the new client.
Bug: 64981153
Test: verify AAudio playback over MMAP with forced device selection to
speaker while headset is connected.
Change-Id: I7c117c3c0f8e7ad08f8e63ea804c19ce21808874
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
There is a CTS test asking for a AVCLevel1 encoder. Lower the minimal
level to AVCLevel1 in low resolution so that it can pass the test.
BUG: 37101765
Test: run cts -m CtsMediaTestCases -t
android.media.cts.MediaRecorderTest#testProfileAvcBaselineLevel1
Change-Id: Id04d3389be8d6761c6d2040a7bea54a2753a7ee7
(cherry picked from commit 085bdc87edeb5304d9dc604a4d3aa4de67cb6009)
Also, reuse decoding result if decode is called again. Currently
decode only retrieves primary picture, so there is no point to
go to metadata retriever again.
Bug: 64077740
Change-Id: I9243de396957f4d717c386bbaa8692494d624998
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
Also, use a SortedVector in builder to prevent duplicates for both
colors and profile/levels.
Bug: 64691727
Change-Id: I7a70f8e39fab9c9c139f3de421b916ada32e3a8b
In case a result error is followed by a buffer_error for a particular
request, current logic won't be able to remove the pending request from
the inflight queue.
Moving the skipResultMetadata flag into InFlightRequest struct fixes the
issue.
Test: Camera CTS
Bug: 64840907
Change-Id: Iac44e431f9e9fc38684f8509328c777f9cf5f956
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
CFI (control flow integrity) implementation is using a MAP_NORESERVE
allocation of up to 2GB is size. Only a tiny portion of it is backed
by physical memory. Take this into account when setting RLIMIT_AS for
media services.
Test: no immediate effect; CFI shadow increase for 48-bit aarch64 can
be reapplied w/o breaking android boot.
Bug: 64293803
See https://android-review.googlesource.com/#/c/platform/bionic/+/424903/.
(cherry picked from commit f1b0523625)
Change-Id: I3fe72edcdaf908f42a1ffdfde645e34263564990