Free the AudioEndpoint and check for nullptr to
prevent accessing shared memory that had been freed.
This is to protect against calls to the stream after
AAudioStream_release() has been called.
Bug: 154274446
Bug: 154274027
Test: libaaudio/tests/test_various.cpp
Change-Id: I194d502fd48c4d31602ffce76aca6b28753ad7d2
This can prevent some loud noises during unit tests.
Also use std::unique_ptr
Bug: 154342174
Test: libaaudio/tests/test_various.cpp
Change-Id: I1c1dc0f4a6a29cf7d7a656392a81a325847de22d
The list of possible paths for the audio configuration
files is now retrieved using audio_get_configuration_paths()
function. All duplicated lists of known configuration
directories have been removed.
Bug: 153680356
Test: test audio on built image working
atest VtsHalAudioV6_0TargetTest VtsHalAudioPolicyV6_0TargetTest
Change-Id: I8c369442f5ca7baa17df95e6a001396fc9de5681
Merged-In: I8c369442f5ca7baa17df95e6a001396fc9de5681
Do not systematically request a stream disconnect upon
EVENT_NEW_IAUDIOTRACK received AudioTrack but only if the new
audio Track properties have changed in such a way that the initial
contract is broken.
Bug: 139763500
Test: OboeTester TEST DISCONNECT
Test: OboeTester TEST OUTPUT while enabling/disabling Live Caption
Change-Id: I3b43275a888e23471fcd1ce20725f5731a77a255
Bug: 147894326
Test: build
Exempt-From-Owner-Approval: This CL only changes build config, but not
the test logic.
Change-Id: I5f2e6db3ebff48cd53be07c49c24c58c9b116306
Based on some usecase, outputing in float is not an option.
Should allow a property to select the behavior
Bug: 140952553
Test: NativeDecoderTest#testExtractor
Test: MediaExtractorTest#testFlacIdentity
Change-Id: Idf2bf382f50d12c00a85aa7bb5582fb0439c6ea1
Signed-off-by: Jean-Baptiste Théou <jb@essential.com>
With b/152655547, all aidl_interface modules are considered as stable
unless it is explicitly with "unstable: true". This change marks the
aidl_interface that are not used across updatable module bounraries
as unstable, so that the build system does not run the API
dumping/checking on them.
Bug: 152655547
Test: m
Change-Id: I5597f7d3fa0e2196dbfcf7ab9a33c71c15a33806
The internals of AData do exactly the type casting that upsets CFI
sanitizers, so disable CFI for those routines.
Bug: 153739236
Test: atest sf_foundation_test
Change-Id: I69ac7f064a8d3c874d7587598b450af657c4ba59
Add error checks for invalid number of coupled streams and channel
mapping values
Bug: 148771305
Test: test in bug
Change-Id: I0d8fcbaa514dfe55a94246f8f847be9a14be7a60
Instead of assuming stride to be a multiple of 64, use the value
returned by graphic view.
These codecs require chroma stride to be half of luma, hence the luma stride
should be a multiple of 32. Hence request for stride that is multiple of
32, then use returned stride.
This is needed where allcoated buffer has a stride that is multiple of
128.
Test: atest android.media.cts.DecoderTest
Test: Test decoding clips with dimensions that are not multiples of 16
Bug: 144190181
Change-Id: I08912396e495326fca787e8ae0b47256505210ca
Merged-In: I08912396e495326fca787e8ae0b47256505210ca
In order to support signalling lower levels, default dimensions
and frame rate are set to smaller values, such that minimum level
calculations done with default values still stay at lowest level
supported
Bug: 149360064
Bug: 151423508
Test: atest android.media.cts.MediaRecorderTest#\
testProfileAvcBaselineLevel1
Change-Id: Ic86e5d728d99652ea4e4a46df4f46b3ff3b357ac
Merged-In: Ic86e5d728d99652ea4e4a46df4f46b3ff3b357ac
This fixes a rebase issue between f72774b and 2a24a30.
Bug: 153120636
Test: Manually run ARC c2 e2e test app
Change-Id: I68987ff27f43380e7ad149c2776830219c42dba9
Without trunksize as restriction, function parseClearEncryptedSized()
can read the rest of file. If the file has a large number of saiz trunk,
large number of bytes will be copied, which can lead to high cost of
CPU time.
Bug: 124777526
Test: please see #3 and #8 in b/124777526: push senc.mp4 to devices's
sdcard, play with photo app, manuly print log. Also need to verify if
Dexter app (b/152531488) not crash.
Change-Id: I87f215cf04c5d002076e145f21c10556773f4bb2
The old minimum was zero, which minimized latency
but was probably too aggressive for some devices.
It is better to avoid glitches.
Because of other changes in AAudio MMAP, this will
have the same latency as earlier version,
but better immunity from glitches.
Bug: 153589709
Test: launch OboeTester
Test: tap TEST OUTPUT
Test: tap OPEN and START
Test: notice that actual buffer size will be 1 * burstSize
Change-Id: Ie53352a0589c710be11f74e995bd12be4f7c45a8
Since the error callback ends up calling into Java,
there is a potential for a deadlock with Java code
that takes AudioSystem.class lock and calls into
native code that takes gLock in its own turn.
Bug: 152819012
Test: use audio on a phone, also
killing native audioserver while watching YT,
also while making cellular calls
Change-Id: Ib288ba96ae2f7b5ab36c1b0a1db4adde487d6a49
C2 plugin for avc decoder is now updated to appropriately
handle both types of interlaced content, i.e. sent as one
field per one input buffer and sent as two fields per one
input
- Allow bytes consumed to be returned as zero to handle dangling fields
- Do not ignore trailing bytes after decode call as that data may
contain next field
- Ensure input buffer contains at least 4 bytes
- After signalling new output delay, do not feed the input again
Bug: 135146280
Bug: 152087140
Test: poc in bugs
Test: atest android.media.cts.DecoderTest
Change-Id: I1f6a12878eeebb604a16f8e9edcdf3d631ef5afc
Merged-In: I1f6a12878eeebb604a16f8e9edcdf3d631ef5afc
Instead of allowing ID3 parsing to read entire buffer,
pass a buffer with only relevant chunk_data_size bytes
Test: atest android.media.cts.MediaMetadataRetrieverTest#\
testID3v2Metadata
Test: poc in bug
Bug: 123237930
Change-Id: I2d6997d16e18d595c5bced02194eb20ab11184e6
This is a client-side wrapper around the respective feature of APS.
Bug: 146157104
Test: Manual verification of proper behavior when starting/stopping
recording, killing of audio server, by examination of the logs.
Merged-In: I9b56c431f69e77683151de19830ec6f45741dd6f
Change-Id: I1f5279c4a4b18e0a7862d3b103d383ac3de4c9a0
Previously, audio policy client would call an method on the sound
trigger middleware service. This has been replaced by the sound
trigger service registering a callback, in order to avoid a cyclic
dependency between the services.
Bug: 146157104
Merged-In: I876461a7650d337d6dd05fbe80efaf08f8ef20dd
Change-Id: Ia8f674d7dd50f6dcdd6595bcbadec2f25fdb3561
This is a helper class for notifying a client of capture
state changes.
Bug: 146157104
Test: Compiles (further testing as part of the topic).
Merged-In: Ie27bc404805d319a6969290a6369d59fb68c1f38
Change-Id: I2902468c4692ba68e4bc9be0e5038d5505da7154
wasn't clearing size/filled when we cleared buffer.
Bug: 151159638
Test: poc, but it didn't fail either before or after the patch
(cherry picked from commit f2acb7a018)
Change-Id: Ie62c28c0b91a1ec36ba1a307fea5ff73d5c085bf
The UID of the current InputMethodService (DEFAULT_INPUT_METHOD) is
pushed from AudioService to AudioPolicyService via AudioSystem.
Allow capture audio if:
- the UID is the current InputMethodService's UID,
- AND a RTT call is active,
- AND the source is AUDIO_SOURCE_VOICE_RECOGNITION.
Bug: 147037345
Test: use voice input with Gboard 9.1.4 during a simulated RTT call.
Change-Id: Ib32ec25e962833eddd0320742e177e3c1e0e5c05
Bug: 152541934
Bug: 152531488
This reverts commit bce9a57e0f.
Reason for revert:
This change aims at fixing b/124777526, but it has led to two new bugs: b/152531488 and b/152541934.
Change-Id: I812c64a68c15542dec2521b985e987f5329a1320
In aaudio, when adding tracks to mixed stream, it is needed to update
audio attributes to HAL whenever the tracks are added or removed.
Currently, only the audio attributes used to open the stream will be
sent to the HAL. In that case, adding audio attributes of the clients
when starting the stream can help solve the problem. In audio flinger,
the client's audio attributes will be used to create MmapTrack.
Test: play multiple aaudio tracks, add log
Bug: 77279923
Change-Id: Ic1c536049e194a2bb7513425ee4828d52769d27f
media time and segment duration entries from 1st edit list entry only is
used for gapless playback, hence don't process the same from second edit
list entry.
Bug: 152372048
Test: atest android.media.cts.MediaMetadataRetrieverTest
atest android.media.cts.MediaMuxerTest
atest android.media.cts.MediaExtractorTest
Gapless playback files played as expected.
Change-Id: I79ce7c69c65f71440e0ba6552e150586fab64aac
Variable 'tag' in TimeCheck::TimeCheckThread::threadLoop
may end up being used w/o prior initialization.
Found by clang-tidy.
Bug: 152526318
Test: m
Change-Id: Ifc1efbee39007ea9cfba8083edbfdb763eafb8dc
Sample rate and channel counts should be the only settings that
triggers skip-cut-buffer update.
Bug: 150270199
Test: atest CtsMediaTestCases:DecoderTestAacDrc
Change-Id: Iecf54833d6b484374e6336fd31d8038a441e1c30
The buffers queued in Puller need to be flushed when resuming
recording, or these buffers' timestamps would be modified by
the InputBufferTimeOffset incorrectly.
Bug: 143046077
Test: atest android.media.cts.MediaRecorderTest
Change-Id: Ia904c8cdd3e2ba59a05df5702d8682b02b3fa30c
* changes:
MPEG4Extractor: check the default sample info before checking the validity of sample size.
Add size checking for 'saiz' box
Add more size checking for 'stts' box
Add more size checking for 'stss' box
Add size checking for 'saio' box
Ignore releaseBuffer() if it is for a different IAudioTrack than was
used for obtainBuffer().
Bug: 136268149
Test: at bug comments #32 and #45
Change-Id: I2e1955c60479edcba6e7d66c98b9faef088b65d9
Ignore releaseBuffer() if it is for a different IAudioRecord than was
used for obtainBuffer().
Bug: 136268149
Test: at bug comments #26 and #27
Change-Id: I2a08c30bf9187b35535318761eaac7856da68c11
Without trunksize as restriction, function parseClearEncryptedSized()
can read the rest of file. If the file has a large number of saiz trunk,
large number of bytes will be copied, which can lead to high cost of
CPU time.
Bug: 124777526
Test: please see #3 and #8 in bug report:
push senc.mp4 to devices's sdcard
open photo app
manuly print log
Change-Id: I854765c82d02d541b92f2658673aa4ce61fb5412
(cherry picked from commit aa15fefa185278a549fd72dd1b79ae73ca5e4436)
Among the many changes that went in as part of CL ag/9501009, reading empty edit list entry was
also added in MPEG4Extractor. Code modifications for seek functionality with the same is done
now.
Bug: 150956121
Test: atest android.media.cts.MediaMetadataRetrieverTest
atest android.media.cts.MediaMuxerTest
atest android.media.cts.MediaExtractorTest
atest android.media.cts.MediaRecorderTest
Change-Id: I3ec065f56259eaf1d923c6701713c6a445e4e2f4
Bug: 135515629
Test: set forceGoogleEncoder to true in VideoCodecTestBase.java
Test: atest android.media.cts.VideoCodecTes.testSyncFrameHEVCCBR
Change-Id: I869506d13d695b90a280d9bcd42c307043269b74
CHECK() for color format has been replaced with appropriate error
handling.
Bug: 117625412
Bug: 152070124
Test: stagefright -s -S /sdcard/cformat.webm
Test: stagefright -s -S /sdcard/crowd_640x360p50f32_frmPar_1x1.webm
Change-Id: I1fe0be54f9910fd98ff4db9240b4dcfd09888ffb
Merged-In: I1fe0be54f9910fd98ff4db9240b4dcfd09888ffb
Use media utility function limitProcessMemory().
Test: restrict mediametrics memory by property, ensure restart
Bug: 152084875
Change-Id: I20b51cecd67e9ac5e03ab34c1c68b1cfd0b8a964
Three properties are declared as vendor-init-settable:
ro.media.xml_variant.codecs
ro.media.xml_variant.codecs_performance
ro.media.xml_variant.profiles
media_codecs.xml can now be named
media_codecs${ro.media.xml_variant.codecs}.xml
media_codecs_performance.xml can now be named
media_codecs_performance${ro.media.xml_variant.codecs_performance}.xml
media_profiles_V1_0 can now be named
media_profiles${ro.media.xml_variant.profiles}.xml
Test: Rename "media_codecs.xml" to "media_codecs_test.xml",
set ro.media.xml_variant.codecs to "_test", then
call "stagefright -i".
Test: Rename "media_codecs_performance.xml" to
"media_codecs_performance_test.xml",
set ro.media.xml_variant.codecs_performance to "_test", then
run android.media.cts.VideoDecoderPerfTest.
Test: Rename "media_profiles_V1_0.xml" to "media_profiles_test.xml",
set ro.media.xml_variant.profiles to "_test", then
run vts_mediaProfiles_validate_test.
Bug: 142102953
Change-Id: I38fa2924e02363639d1cdc3dd85128e0652343ee
Merged-In: I38fa2924e02363639d1cdc3dd85128e0652343ee
Add an argument to IAudioFlinger::createEffect() API to
ask AudioFlinger to just run the pre flight checks but not
create the actual audio effect instance and allocate resources.
This is the basis of an API for apps to query if a given
effect can be created without having to allocate the resources
and risk an exception when calling the constructor.
Bug: 150699608
Test: CTS and GTS Tests for audio effects
Change-Id: Ibdda22fd945c88c33e3c7342a7a5ed3e02d399ac
Apps are using zero length frames with EOS flag at the end of a track.
However, they are either ignoring timestamp or are setting to zero.
This breaks the CHECK for last frame duration to be positive and media
file is not created at all. Inorder to let apps to compose movie file in that
case, changed the logic of that code to care only when timestamp of EOS
flagged empty buffer is positive. Also, throw only a warning message when
last frame duration becomes negative.
In other cases, old behaviour of copying the previous frame's duration
for the last frame would stay the same.
Bug: 151056554
Test: 1) The issue mentioned in the bug is not happening with this fix.
2) atest android.media.cts.MediaMuxerTest
3) atest android.media.cts.MediaRecorderTest
Change-Id: I1754bb524049a00def232ae82d08fe94fa13bd0f
* changes:
Plumb the notification about audio HAL services update to APM
libaudiohal: Allow late registration of HIDL HAL services
Allow for late audio module discovery in APM
Android added support for correctly applying color transfer for
thumbnails of HDR videos with PQ color transfer, this expands it to HLG
color transfer.
Bug: 151096599
Test: manual - see bug
Change-Id: I880b2baeeab49a623fcc6e3568c1569b9d3788e4