Exclude remote submix devices with non "0" (legacy) addresses from devices
returned to Engine by AudioPolicyManagerObserver::getAvailableOutputDevices()
and AudioPolicyManagerObserver::getAvailableInputDevices()
Bug: 129144725
Test: make
Change-Id: If1ce89acb2a35a6bede195f520b4047f92b928bd
Previously, ThreadBase::mLock was only acquired inside
ThreadBase::dumpBase method. That means, dumping of fields of
descendant classes, tracks, and effect chains was performed
without holding ThreadBase::mLock.
This patch changes the way of how dumping is driven. Now only
ThreadBase has a public 'dump' method which is non-virtual.
This method takes the lock and dumps all the fields, tracks, and
effect chains. It calls virtual methods for dumping the contents
of descendant classes.
Bug: 118842894
Test: compare audioflinger dumps A/B
Change-Id: Iaafc75d13935a6a92ca37f9567b7ac7c31374b3e
The dump code was not using AudioMixMatchCriterion class fields
correctly.
Bug: 112151391
Test: 1. run and pause AudioPolicyTest#testMixByUidCapturing
2. adb shell dumpsys media.audio_policy
Change-Id: I5f74a0e6dc1a7039eab1470402179b7f9d1cd962
Make sure the Engine is never aware of remote submix devices with non
"0" (legacy) addresses as the Engine does not have to deal with devices
only used by dynamic audio policies.
Bug: 129144725
Test: make
Change-Id: Ifa19c952e22ac18c5d47e731cbfa41f81fe5c32c
Fix missing log line in the case when there are no effects in
the chain.
Bug: 118842894
Test: adb shell dumpsys media.audio_flinger
Change-Id: I31fe4760caa61610de4f143b3a6ae185efb55baa
1. Change Camera3Device logs to ALOGV
2. In Camera3OutputStream, only log before we mark stream state
to STATE_ABANDONED
3. Also changed BUFFER_ERROR log to ALOGV
Test: manually check log of GCA mode switch
Bug: 125415787
Change-Id: Ibd83b7010932a8be25d85573d9c9dce9c394f6bb
The technique of bouncing lock attempts does not work well
in the case when another lock has higher priority and acquires
the lock frequently. Timed lock works better in this case
because the acquiring thread is then put in a queue and gets
the lock as soon as another thread releases it. The wait time
in the worst case (deadlock) is the same.
Bug: 118842894
Test: Run VOICE_COMMUNICATION capture + AEC effect, dump audioflinger
Change-Id: Idc4fc2b6f5faf6988979f9354dd92441af33e600
Fix use use of mAudioRecordClients instead of
mAudioPlaybackClients in doReleaseOutput().
Test: make.
Change-Id: I5c695582828300c0297f4f58bcba37e17b51bbbd
This makes the libaudioflinger build deterministic between
devices.
A few notes:
- the include-path-for include is obsolete, so it was removed
- the AUDIOSERVER_MULTILIB use was removed, as I believe it's
unused
Bug: 121208203
Test: make
Change-Id: I08eb0d7f53f1fbcef3e14faa3ea75b5326383ef8
Suppress first callback sent by startInput() as the input device is not
yet set and it results in a spurious AudioRecordingConfiguration callback
sent by RecordingActivityMonitor with a null audio device.
Also fix a bug in getInputForAttr() where the wrong audio attributes
were stored in the RecordClientDescriptor resulting in a failure to
create the audio patch when DEFAULT audio source is used.
Bug: 129287962
Test: cts-tradefed run cts-dev -m CtsMediaTestCases -t android.media.cts.AudioRecordingConfigurationTest
Change-Id: Ia67abfa56ea653cf69e68bfabbb3d19a12adc310
Apps were previously forced to set their allowed capture policy from
either their manifest which is not flexible or from each track which is
a very fine grain but difficult when using libraries like exoplayer.
Thus add an application level policy set with AudioManager.
Test: atest android.media.cts.AudioPlaybackCaptureTest
Bug: 111453086
Change-Id: Ic890b5b041affea757fbd3f2707ff2ce18771828
Signed-off-by: Kevin Rocard <krocard@google.com>
The opt-out was only present in the java API but not on the native ones.
Test: atest test_attributes
Change-Id: I1b84f1a428508e00de65e615b59405b9ee2ba009
Signed-off-by: Kevin Rocard <krocard@google.com>
For system application with the new permission CAPTURE_MEDIA_OUTPUT, or
CAPTURE_AUDIO_OUTPUT, allow to capture the audio of playing apps that
allow it.
Test: adb shell audiorecorder --target /data/file1.raw
Test: atest android.media.cts.AudioPlaybackCaptureTest
Bug: 111453086
Change-Id: I5bfca51e48992234508897c595a076d066db26b2
Signed-off-by: Kevin Rocard <krocard@google.com>
This fixes the case when the SwAudioOutputDescriptor is part of
duplicated output. In this case, APM::closeOutput finds the
duplicated output, deactivates all the clients for all outputs,
then calls 'close' on the descriptor. Since there are no active
clients, closing the descriptor does not stop it, leaving
pending 'active count' in the profile.
Bug: 128362999
Test: steps from b/124415601
Change-Id: I8fa60ef50efa74ca8cf6e3312e1075a9ec9c63f3
The physical camera device ID must be present as part
of the capture result extras in case of corresponding
result failure notification.
Bug: 128835627
Test: Camera CTS,
AImageReaderVendorTest
--gtest_filter=AImageReaderVendorTest.LogicalCameraPhysicalStream
Change-Id: I042af8bd85eaadd389b059c2833f352ceb2f40fc
- Fix accessibility service not able to get same policy as regular apps
when not using VOICE_RECOGNITION source b/126785297
- Make sure two captures from same app do not silence each other
(e.g two privacy sensitive captures concurrently)
- Ignore clients in idle state when considering priority active clients in
silencing logic.
- Prevent capture while in call if privileged permission CAPTURE_AUDIO_OUTPUT
is not granted
- Allow capture concurrently with privacy sensitive capture or call if
permission CAPTURE_AUDIO_OUTPUT is granted.
- Do not silence virtual sources when sensor privacy is enabled.
- Consider system persistent service as top app state.
Bug: 128419018
Bug: 126785297
Test: audio smoke tests
Change-Id: I7f8c7c511c674d4d46a815eaa7e9cf95e95cc3f9
Bug: 120407707
Test: CTS
Test: Use camera to take pictures / record videos (sanity)
Merged-In: I7b29c337d0e217d2eb6a62e2c75ccc550d795e61
Change-Id: I7b29c337d0e217d2eb6a62e2c75ccc550d795e61
(cherry picked from commit 7d355db285)
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
Bug: 120407707
Test: CTS
Test: Use camera to take pictures / record videos (sanity)
Change-Id: I7b29c337d0e217d2eb6a62e2c75ccc550d795e61
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
Switch to using a dynamically-linked library function to initialize
ICU, not a statically-linked function. This means the knowledge of file
paths stays in the runtime module.
Bug: 120493361
Test: build/boot
Exempt-From-Owner-Approval: It's just a cherry-pick
Merged-In: Ibe1d5ffd50e5cce76b1b01788954dcfb4762b1c6
Change-Id: Ibe1d5ffd50e5cce76b1b01788954dcfb4762b1c6
This CL simplifies call flow to set volume from stream or attributes.
It also removes unused parameter from mute setter and fix a volume
source comparison.
Also refactor logic in setVolumeIndexForAttributes() by removing the
loop on all volume sources on a given output given it was ignoring all
sources not equal to current source anyway.
Bug: 124767636
Test: AudioPolicyTests --gtest_filter=StreamTypeVolumeTest.*
AudioPolicyTests --gtest_filter=AttributeVolume/AttributeVolumeTest.*
AudioPolicyTests --gtest_filter=AudioProductStrategiesPlaybackVolume/AudioProductStrategiesPlaybackVolumeTest.*
Change-Id: Id816de023e917b0c0e34bb0888c8b0ad29029f8b
Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
The RLIMIT_AS limit was introduced as a security mitigation, but it
isn't exactly what the media processes want to control. It is also
problematic under sanitizers which allocate large amounts of address
space as shadow memory, and is especially problematic under shadow
call stack, which requires 16MB of address space per thread. Instead,
use the newly introduced android_mallopt(M_SET_ALLOCATION_LIMIT_BYTES)
to control the allocator's memory limit directly.
Also remove ASAN/HWASAN/CFI specific hacks; they are no longer
necessary because these tools consume address space using mmap and
not the allocator, and remove the 64-bit pointer check before calling
__scudo_set_rss_limit, since otherwise the limit would stop being
enforced in 32-bit mode with Scudo.
Bug: 118642754
Change-Id: Ie66128626976c0b04d5dafd455c375bbfdccc083
Fix setGroupVolumeIndex() which was applying
volume for all groups if in call and causing the wrong
index to be used.
when DTMF are muted when entering call, voice call was
also muted.
Bug: 128499415
Test: call with voice volume set to 6
Change-Id: Ie1296a7a48fdfba3710acb3d7a7e4f00e7b576a5
Additionally initializey the stream id to invalid negative
value in case the Hal tries to verify it during stream
combination queries.
Bug: 128450197
Test: Camera CTS
Change-Id: Ife058e22ef72ee84be82799ed397ca49cd8ea99f
Switch to using a dynamically-linked library function to initialize
ICU, not a statically-linked function. This means the knowledge of file
paths stays in the runtime module.
Bug: 120493361
Test: build/boot
Change-Id: Ibe1d5ffd50e5cce76b1b01788954dcfb4762b1c6
change from a blanket 'using namespace...' directive to a more
explicit qualification on the entities that prompted adding the using in
the first place.
Bug: 128606338
Test: compilation
Change-Id: Id8c8cfcd18801661b82b73d1c59952d1e75d3c7d
Not required and do not assume it.
Test: no regression with atest CtsNativeMediaAAudioTestCases
Bug: 128615806
Change-Id: I29d77d01aad417cc6aa6f882b7bc0812775e13c6
Output error messages on failure.
Test: CTS effects, dedicated test with bad sessionId
Bug: 128528126
Change-Id: Icdd306c30e8eb818b0a27d6463fa785bac2fb707
Allow at most one effect chain with same sessionId on mPlaybackThreads.
Test: poc, CTS effect tests
Bug: 123237974
Change-Id: Ide46cd23b0a9f4295f0dca2fea23379a76b836ee
This CL allows to generate at build time the ProductStrategy structure
file to ensure it is aligned with audio policy engine configuration file.
Bug: 124767636
Test: build
Change-Id: I1afba9602482a898147c685d4a8b03fbe99c08b1
Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
Lazy loading of sound files can speed up camera startup more than 60ms,
it gives users a great experience. Many apps do not playSound when camera
open or they may use their own audio files. so we load audio files as needed.
Bug: 128432959
Test: install wechat app,open camera,use systrace to see the uiThread wait time.
Change-Id: I3b3697cf9d0d919b88276f6d8e7fdd84578f4fcd
AudioOutputDescriptor::devices() returns a DeviceVector
by value. That means, the returned vector must be held
as long as we need its elements.
Added a FIXME to consider other devices because the
current code looks suspicious.
Bug: 128327759
Test: make
Change-Id: Ifd3a7c8faf89b2c4fc3400aac0060d0e9e673e73
Volume used to be managed per stream type.
VolumeGroup is a configurable way to manage volume affinity.
This CL allows to switch to VolumeGroup as new volume affinity management.
Bug: 124767636
Test: audio smoke tests
Change-Id: I71fc214f6db3158f0f05920cc3d700b29db1a4bc
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
AudioInputDescriptor and AudioOutputDescriptor used to reference
AudioMix instances using a raw pointer. This isn't safe as AudioMix
was owned by AudioPolicyMix, which is not referenced by descriptors.
Change AudioMix* pointers in Audio{Input|Output}Descriptor to
wp<AudioPolicyMix> which reflects their relationship correctly.
To ensure that code does not operate on AudioMix instances
independently from AudioPolicyMix, and to avoid introducing
a lot of getter / setter methods into AudioPolicyMix, make
the latter to inherit AudioMix. This makes sense because
AudioPolicyMix is essentially a ref-counted version of AudioMix.
Bug: 124899895
Test: build and sanity check on crosshatch,
build crosshatch with USE_CONFIGURABLE_AUDIO_POLICY := 1
Change-Id: Ic508caedefe721ed7e7ba6ee3e9175ba9e8dc23a
The code for clearing software patch connections was missing
a check for a null track pointer.
Bug: 126789266
Bug: 128269566
Test: see repro steps in b/128269566
Change-Id: Ice6887622d5fa2fa3198ce15146bff3cb05f7451
Fix the long (>1s) dequeueBuffer call when a stream is managed by
Camera3BufferManager and its consumer end discards free buffers.
Test: CTS, no more long dequeBuffer call in GCA mode switch
Bug: 126054873
Change-Id: I03d6526b076796bb44f15cc2c4a092ff3d04fc1d
- Renamed libaudiopolicyengineconfig to libaudiopolicyengine_config
in order to match names libaudiopolicyengine_{common|interface}.
- Made libaudiopolicyengine_config static to avoid .so overhead.
- Added a cleanspec for it.
- Added libaudiopolicyengine_common which includes source files
previously included directly into engineconfigurable and
enginedefault libraries.
Bug: 121208203
Test: make & flash crosshatch
Change-Id: If3b7b89fcbd5752ddfdeca6c164a88f55bc35811
Camera service listeners must be able to receive
information about camera access permission changes.
Bug: 121379978
Test: Camera CTS
Change-Id: I2e13fdd35a267901a3caa0e0ce78ab1cea83e7ab
Return buffers managed by HAL buffer manager in disconnect.
Test: kill HAL process and check for buffer leak in cameraserver
Bug: 126889012
Change-Id: I83173c5eaae13ee11eb3f185e7204a2dd8855b4e
Capture from REMOTE_SUBMIX audio source should always be
allowed in concurrency situation.
Also include FM_TUNER as virtual source that should never be
silenced.
Also remove voice call capture sources from privacy senitive sources
as capturing a voice call does not constitute in itself a situation
that should prevent other apps from accessing the mic.
Bug: 121200677
Test: verify music playback in auto projected mode.
Change-Id: Idbd9e9f55f29fb8a8e2b76cea5b85f0d9a555788
When selecting device on a given output stream, check if
an enforced audible sound is active on any other output stream and
not just on this stream.
Bug: 124063442
Test: set property audio.camerasound.force=true and test music + shutter
sound concurrency.
Change-Id: Ic7f548df2b67041d532afc68685cdbeb3cb3f125
Change to new properties + swap audio XML files, and supports following
scenarios:
1) (default) audio_policy_configuration.xml
Using BluetoothAudio HAL (+ A2DP offload if supported)
2) audio_policy_configuration_a2dp_offload_disabled.xml
Using BluetoothAudio HAL only when A2DP offload is supported but
disabled.
3) audio_policy_configuration_bluetooth_legacy_hal.xml
No BluetoothAudio HAL nor A2DP offload
Bug: 126304229
Test: Switch BluetoothAudio HAL and A2DP offload manully
(cherry picked from commit 52982cb595)
Change-Id: I9699368914db37d2fd075cd30c49a5a7c57e8036
Merged-In: I3c17b304a12c1eccd9f97ee50a0b7cf6e4b9a1da
When playing audio-haptic channels, there could be request to mute
haptic channels according to settings. To support that, do not select
haptic output when forcing muting haptic channels.
Test: Play audio-haptic coupled data
Bug: 126401770
Change-Id: Ifb52385c56ec8d67fe031e1877ea35cbe2319600
This was not efficient and leaded to an assert in obtainBuffer.
I'm not sure which condition can lead to a getNextBuffer of size 0,
but it has been observed and is not forbidden by getNextBuffer
documentation.
Test: atest android.media.cts.AudioPlaybackCaptureTest#testCaptureMediaUsage
Bug: 111453086
Change-Id: I5accf7c1d488ff4686272588329bab71d64f67cd
Signed-off-by: Kevin Rocard <krocard@google.com>
Query the package manager to check if the app has not opt-out of its
playback being captured.
Test: adb shell audiorecorder --target /data/file1.raw &
adb shell am start -a android.intent.action.VIEW -d file:///system/media/audio/ringtones/Lollipop.ogg -t audio/ogg
adb dumpsys media.audio_policy # check playback is not recorded
# change media player manifest to allowPlaybackCapture=true
adb dumpsys media.audio_policy # check playback is recorded
kill %1
adb pull /data/file1.raw && sox -r 48000 -e signed -b 16 -c 2 file1.raw file.wav&& audacity file.wav
# check silence then sound
Bug: 111453086
Change-Id: Id6fb7d0e10c02b0473bcbc0786e8360536996f48
Signed-off-by: Kevin Rocard <krocard@google.com>
Change to new properties + swap audio XML files, and supports following
scenarios:
1) (default) audio_policy_configuration.xml
Using BluetoothAudio HAL (+ A2DP offload if supported)
2) audio_policy_configuration_a2dp_offload_disabled.xml
Using BluetoothAudio HAL only when A2DP offload is supported but
disabled.
3) audio_policy_configuration_bluetooth_legacy_hal.xml
No BluetoothAudio HAL nor A2DP offload
Bug: 126304229
Test: Switch BluetoothAudio HAL and A2DP offload manully
(cherry picked from commit baa9e4e167)
Change-Id: I3c17b304a12c1eccd9f97ee50a0b7cf6e4b9a1da
Set bufferSize in @3.4::Stream::bufferSize for JPEG_APP_SEGMENTS stream.
Bug: 124999074
Test: Build
Change-Id: I6f24f4273b0d3d18b1bdbf263fc12ed48e857004
Bug: 125464062
Test: GCA (sanity)
Test: Connect to a camera device using a HAL process, change the device user and connect again;
connection is successful
Change-Id: Ia25b961baa396fd383d089e400c6d877b9875955
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
Change to new properties + swap audio XML files, and supports following
scenarios:
1) (default) audio_policy_configuration.xml
Using BluetoothAudio HAL (+ A2DP offload if supported)
2) audio_policy_configuration_a2dp_offload_disabled.xml
Using BluetoothAudio HAL only when A2DP offload is supported but
disabled.
3) audio_policy_configuration_bluetooth_legacy_hal.xml
No BluetoothAudio HAL nor A2DP offload
Bug: 126304229
Test: Switch BluetoothAudio HAL and A2DP offload manully
Change-Id: I6d996d616c6c0b998699f90dbaebb7d70ef3237c
Change to new properties + swap audio XML files, and supports following
scenarios:
1) (default) audio_policy_configuration.xml
Using BluetoothAudio HAL (+ A2DP offload if supported)
2) audio_policy_configuration_a2dp_offload_disabled.xml
Using BluetoothAudio HAL only when A2DP offload is supported but
disabled.
3) audio_policy_configuration_bluetooth_legacy_hal.xml
No BluetoothAudio HAL nor A2DP offload
Bug: 126304229
Test: Switch BluetoothAudio HAL and A2DP offload manully
Change-Id: I6d996d616c6c0b998699f90dbaebb7d70ef3237c
Merged-In: I6d996d616c6c0b998699f90dbaebb7d70ef3237c
Otherwise incorrect state might be hidden.
Also: Unify devicesToString() and deviceToString() to toString().
Miscellaneous cleanup of replicated functionality.
Test: Basic audio sanity, AF and APM dumpsys check
Change-Id: Ic81167e2d2dbfcca881f0898764cf886215c217c
mediaserver is no longer forced to 32-bit mode, floating to primary
architecture which is usually 64 bits.
Bug: 16890215
Test: boot, record video, android.media.cts.MediaPlayerTest
Change-Id: If5265e251a4201e7037ddaa2f36fa998936622aa
This CL adds the concept of Volume Group to the engine.
It generalizes the volume management today controled by stream types
and hard coded into AOSP.
The goal is to control the volume per attributes, being able to define
a group of attributes that follow the same volume curves.
It intends to replace the concept of aliases in AudioService.
Bug: 124767636
Test: build
Change-Id: Icd079374cc1680d074b01836eca0bceb0b0c5247
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Implemented for threads that read/write PCM.
Test: audioflinger dumpsys Play Music, Movies, Video Recording
Bug: 114112762
Change-Id: I866a8b639d18426633088d6a03d9135f4ee09fd3
For privacy, require the app wanting to capture other app audio to have
a valid MediaProjection.
Test: adb shell audiorecorder --target /data/file.raw
Bug: 111453086
Change-Id: Ia9343b2125aea2d9c0fc5a37b6ded9237d1d0f28
Signed-off-by: Kevin Rocard <krocard@google.com>
The implementation uses IBase::debug() method which can write
debugging info into the provided file descriptor (same model
as used for devices and streams).
Bug: 69939533
Test: adb shell dumpsys media.audio_flinger
Change-Id: I02a74b51977d105edf6f7e624ea26f866c965708
This CL removes the hard coded volume table in the engine and
use as a fallback for compatibility reason the apm config file
to load the volume tables.
Bug: 124767636
Test: dumpsys media.audio_policy & diff with previous version
Change-Id: I0392aad730c67ee79f898093fd1b4f64e26ab3fd
Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
This CL moves the volume curves to the engine.
The configuration files of volume are now owned by the engine,
that is intended to become vendor specific.
Test: build, dumpsys media.audio_policy and checks the volume curves.
Bug: 124767636
Change-Id: I9e3b256d2eb89c8eac6b282db0e59ec3af47d76d
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Bypass systematic playback client route evaluation when connecting a
remote submix output device used by a recorder dysnamic policy as no
rerouting is needed in this case.
Bug: 115429872
Bug: 123986127
Test: play music with GPM on Android TV and use the BLE remote
Test: use the BLE remote on Android TV
Change-Id: I285d416f54ff398d23742086fcd8c9f511cd289b
Use libyuv's optimized CopyRow function to improve performance of YUV
tiling.
Bug: 124781199
Test: Camera CTS
Test: TestingCamera2 smoke test
Change-Id: I6af6678099655b7e35ddaccf7cd9aa817ec64a9c
Depth and confidence maps require physical rotation in
case the source color image has similar physical rotation.
The EXIF orientation value will be kept consistent and
set to 0 in case of physical rotation.
Bug: 123699590
Test: Manual using application,
adb shell /data/nativetest64/cameraservice_test/cameraservice_test
--gtest_filter=DepthProcessorTest.*
Change-Id: I5cdd41c89368a1841d53f2195790aa1b55258495
Depth and confidence maps should always use the same
EXIF orientation as the main color image.
Bug: 123699590
Test: Manual using application,
Camera CTS,
adb shell /data/nativetest64/cameraservice_test/cameraservice_test
--gtest_filter=DepthProcessorTest.*
Change-Id: I0d887798e8717cdff81aba10d595dc3ccfe99197
In case the Camera3Device enters a bad state, the
RequestThread can continue to run after disconnect()
completes. This can potentially cause instabilities
because some of the Camera3Device member variables
will become invalid after disconnect() but are still
accessible in code paths triggered by RequestThread.
Avoid using potentially invalid reference by checking
the respective strong pointer.
Bug: 123293729
Test: Manual using application,
Camera CTS
Change-Id: If3305840db89537593370b7f57bccbb257e49cbd
When ro.bluetooth.a2dp_offload.supported is false, but
persist.bluetooth.bluetooth_audio_hal.enabled is true, we use new config
audio_policy_configuration_bluetooth_hal_enabled.xml
Remove primary flags from hearing aid also.
Bug: 124278829
Bug: 124014853
Test: manual with BluetoothAudioHAL enabled / disabled under Pixel 2, 3
Change-Id: I77e53ee50165e420d28c8a0c8fa9c5fc866c4596
VOICE_CALL, VOICE_UPLINK.
This update will allow features like Call Screen (go/callscreen), Tap to Caption (go/whatist2c) and
Tulip (go/tulip) to work simultaneously.
Bug: b/124457248
Test: Manual testing. See videos in folder: http://go/audio-fix-videos
and README.txt
Change-Id: Ic279dde6c99eca51b880bb340dfc3235d8680121
Use static and dynamic metadata to override Exif tags.
Also added back a missing ATRACE_ASYNC_ENDs statement.
Test: Camera CTS
Test: ERROR_BUFFER of internal streams is propagated to app
Test: ERROR_RESULT only results in EXIF not being overridden
Bug: 124066183
Change-Id: Id2c69c6bee04ae724ff5f190b2dd96d0159700c9
Use the constant from IExternalVibratorService.
Bug: 124318236
Test: play audio-haptic coupled file
Change-Id: Ice2ac13d0f6a6a749bb6243230524336144fa5f4
This reverts commit ddd87af881.
Reason for revert: Turning down diagnostics mode in codecs.
Bug: 111498295
Change-Id: Ida7302ec70f31b79931e2a5df424a5ab4e3d5d62
1. Fix off by one error in signalStreamFlush call
2. Make sure signalStreamFlush is called before we toggle request
thread idle (which might cause another thread finishing
waitUntilIdle() and thus start calling configureStreams)
Test: Pixel 3 + camera CTS
Bug: 120986771
Change-Id: Ifd6f77ef628ee200c024c7c6a05bde20937c745d
onBufferReleased is no longer reliable indicator of capture
error due to HAL buffer manager feature. Switch to listen
to error callback from HAL directly.
Test: API1 CTS + Pixel 3
Bug: 123952355
Change-Id: I7362942f19356583ec66f259b01e963a1af3a205
Track::interceptBuffer failed to write all the audio if the source BP
could not returned the requested buffer size.
This is actually normal when the source circular buffer wraps around.
Handle it by retrying if the first buffer is too small.
Test: adb shell audiorecorder --target /data/file.raw
Bug: 111453086
Change-Id: I42a7962449a0f075909a29f5f8f5ba82ca1d0085
It's possible that tracks with the same session id running on various
playback outputs, which causes effect chain being created on the same
session twice. As a result, the same effect engine will be released
twice as the same context is reused.
Output that has effect chain with same session id is more preferable.
Test: No regression with Play Music and Effects
Bug: 123082420
Change-Id: I690ea3cb942d1fdc96b46048e271557d48000f43
In order to avoid track to be added to tracksToRemove
redundantly, merge the adding operation under exclusive
condition check.
This can make sure the add can happen only one time within
one prepareTracks iterator.
authored-by: Zhou Song <zhous@codeaurora.org>
Test: AF active track removal with audio playback pause
Bug: 123375253
Change-Id: If35348af2144a28b84241e1cb93f497d5eec9a8a
When a composite stream is deleted, the previously connected output
surface needs to be disconnected. Otherwise when the composite stream is
re-created with the same output surface, connect() will fail.
Test: TestingCamera2, and Camera CTS
Bug: 79465976
Bug: 109735087
Bug: 124072769
Change-Id: I254238235d306f9be8152110b1c55a7ada46424a
If a track is paused right after start before it gets a chance to mix
the first frame. Don't apply volume ramp if it resumes later.
Test: Basic audio sanity. Partner CL.
Bug: 123063164
Change-Id: I969ff1b6edce8faf77f2cdc481db9c1e3ef6d3dd
The test case here involves two applications both of
which play the same music clip. When the 2nd application
ends playback, the 1st application must resume playback
where it left off. But it is possible that the new
AudioTrack.start() command from the 1st application is processed
after the 2nd application has paused and terminated.
This will prevent a flush to clear any state before playback
of the 1st application can resume. Direct thread thus
stays in pause state indefintely.
Issue unconditional flush for direct thread when a new
track is added to a direct output.
Test: partner CL submit, check compilation
Bug: 123082418
Change-Id: I33d36db35358a1b3b89dd5b2b8cb4db1f9c6d4a0
Session parameter changes will by default trigger internal stream
reconfiguration. If possible query Hal whether this sequence
is required for specific parameter values.
Bug: 122609098
Test: Manual using application
Change-Id: I9eaa55b0a552d9753122c16f9470779e2ed8ffec
While a playback is ongoing using explicit routing
and the device is disconnected, setOutputDevices() will bail out
if the new device is incompatible with the io profile. So the device
will not be reset in the output.
Moreover, if another device of the same type/address is connected,
this device will have a new unique ID.
If a track wants to use it as explicit, as the first playback/capture is still
on going, the function findPreferredDevice will return the previous device id.
This CL enforces:
-setOutputDevices() to check if new device is not compatible AND previous devices
are still available
- When a device is disconnected, go over all clients to clear any preferred device
referring to the device being removed.
- Sanitize preferred device received by get<Output|Input>ForAttr() according to
connected devices.
Test: AudioPolicyTests --gtest_filter=DynamicAddressOutputDevice/DeviceConnectionTest.DeviceConnectionState/*
Test: audio smoke tests
Test: CTS tests for AudioTrack, AudioRecord, AudioRouting
Change-Id: Ib3a2d54d902def0fcfc2a623c25bb92d65b1ab98
Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
These changes are to make it in sync with the internal repository.
Change-Id: I45e207a6ef887acd89239c7c73f046cb42fdb845
Signed-off-by: Joel Fernandes <joelaf@google.com>
* changes:
Propagate track status to interception patch track
Add secondary output to audio tracks
Audioflinger: add timeout to PatchTrack
Audiopolicy: Move AudioPolicyMixCollection in helper function
Add MIX_ROUTE_FLAG_LOOP_BACK_RENDER
Clean up logic for FastTrack AudioMixer track initialization.
Test: SoundBar menu scrolling, AudioFlinger tee
Bug: 119284313
Change-Id: I551d9d54d82e0029a49c6481ba8669093359d6d1
The secondary are returned from mixes (from DAP loopback&render),
from getOutputForAttr.
All getOutputForAttr* of the stack are update.
Internal getOutputForAttr use descriptor, external one use handles.
The secondary output are saved in each track and the track is
invalidated if the list of secondary output changes.
In audio flinger, create a pair of recordTrack & patchTrack to pipe
the intercepted audio audio to the secondary output.
Test: adb shell audiorecorder --target /data/file.raw
Bug: 111453086
Change-Id: Id6523d9e383c15a0e39313d5f355df809b7e72fe