This CL contains stuff that are pretty much copied over from the
libaom component. It makes it easier to review the series of CLs.
All the libgav1 specific functions will follow in a subsequent CL.
Test: all AV1 CTS tests still pass.
Bug: 131989882
Bug: 130249450
Merged-In: Iaafbf5379577bd42c7de64c7ec96d5b0fbb45b18
Change-Id: Iaafbf5379577bd42c7de64c7ec96d5b0fbb45b18
Bug: 134042971
Test: NTS case AUDIO-026-DDP51-TC3-NonTunnel / Tunnel verify volume starts at 0 when fading in
Change-Id: I8ee4444e3ceb2d8a0ceb979fada10c644b5db35c
- Fix ResourceManagerSerivce handling of adding same-type
resource in multiple calls, combine entries with the same
<type, subtype>. This is not required in existing usage,
bug could be required if we allow same type to be added
incrementally (eg. memory usage).
- Add api for removing some resources. Currently we can
add resources in multiple calls, but removeResource always
remove all resources of that client. We need this to toggle
battery stat On/Off based on actual usage of the codec.
- Add unit tests for the above.
bug: 138381810
test: ResourceManagerService_test; CTS ResourceManangerTest.
Change-Id: Icdba6c6b4c517755291668c52764169aac3071ea
We can't track video stats accurately if it's reported from
app side MediaCodec. If the app dies, video stats get stuck
in On state forever. This can be easily triggered by forcefully
kill and app that uses MediaCodec from app side (instead of
through mediaserver's Recorder or Player service), eg.
launch GoogleCamera app and switch to Video tab, and kill it
from adb shell.
In order to track MediaCodec usage from apps we need to move
the battery stats reporting from MediaCodec into ResourceManager.
bug: 138381810
test:
1. test if app uses MediaCodec directly and it dies off, the video
off is received: launch GoogleCamera app, swipe to Video tab,
"dumpsys batterystats --history" and see +video; now adb shell
kill GoogleCamera, dumpsys should show -video.
2. test app that uses MediaCodec through mediaserver: use Chrome
(which uses MediaPlayer) to play some website with video, kills
Chrome from adb shell, and check -video is received.
In anycase it shouldn't stuck in On state.
3. ResourceManagerService_test
Change-Id: I164b31681c4e72e8cce02342641dbec14b8df374
(cherry picked from commit 47db2ff19c)
Also remove the expected argument in addProviderLocked method as
we now can query from device manifest for instance names.
Test: manually modify Pixel3 manifest to test, CTS
Bug: 136010319
Merged-In: Ib57fd84ad8f22aac2a82920e03148cff2592daae
Change-Id: Ib57fd84ad8f22aac2a82920e03148cff2592daae
Do not consider Accessibility services when determining
lastest active capture client. As an Accessibility service
capturing does not silence other captures, it should not
prevent another client from being selected as the latest active.
Bug: 135806801
Test: Start capture with Recorder app, activate Voice Access
Change-Id: I864be785752f27201d45ce24f95013de6391dbd6
Replace the item MIME type with value supported
by the dynamic depth specification.
Bug: 138399780
Test: runtest -x
cts/tests/camera/src/android/hardware/camera2/cts/ImageReaderTest.java
-m testDynamicDepth
Change-Id: Ib51dd69e6de7da3269eccfa6b671fe95a269b4d6
This is no longer necessary because the headers are exported by the
libicuuc library which is a dependency of libxml2.
Bug: 134379140
Change-Id: I01dfe41c6584d71de47a5a76e1f7cc718083ca8c
Test: m libaudiopolicyengine_config
Exempt-From-Owner-Approval: cherry pick from qt-dev-plus-aosp.
(cherry picked from commit 2142c72cd7)
Do not consider Assistant capturing with HOTWORD source
when determining lastest active capture client. As assistant
capturing for HOTWORD does not silence other captures, it should not
prevent another client from being selected as the latest active.
Bug: 135806801
Test: Start capture with Recorder app, place in background and trigger
false OK G detection
Change-Id: Ic17bfd70675ef749d6a678d067112b1dbd205746
This change moves almost everything from libaadio.so to
separate libaaudio_internal.so library. This is done to
avoid exporting symbols which apps are not allowed to use
but have them available for platform libraries by exporting
them from libaaudio_internal.so
Bug: http://b/69603741
Test: make
Merged-In: If93118ed2c266faf2964abf21e17b0b13df493d2
Change-Id: If93118ed2c266faf2964abf21e17b0b13df493d2
This change moves almost everything from libaadio.so to
separate libaaudio_internal.so library. This is done to
avoid exporting symbols which apps are not allowed to use
but have them available for platform libraries by exporting
them from libaaudio_internal.so
Bug: http://b/69603741
Test: make
Merged-In: If93118ed2c266faf2964abf21e17b0b13df493d2
Change-Id: If93118ed2c266faf2964abf21e17b0b13df493d2
Force close mmap input streams when a capture device is
connected to force disconnect callback to client.
Bug: 137311579
Test: capture with oboetester and connect headset
Change-Id: Iafe939247fa565e2424b40afacdb79a31b8955b7
(cherry picked from commit 7bd2939d6c)
(cherry picked from commit c833ccc86b)
Force close mmap input streams when a capture device is
connected to force disconnect callback to client.
Bug: 137311579
Test: capture with oboetester and connect headset
Change-Id: Iafe939247fa565e2424b40afacdb79a31b8955b7
(cherry picked from commit 7bd2939d6c)
Force close mmap input streams when a capture device is
connected to force disconnect callback to client.
Bug: 137311579
Test: capture with oboetester and connect headset
Change-Id: Iafe939247fa565e2424b40afacdb79a31b8955b7
This is no longer necessary because the headers are exported by the
libicuuc library which is a dependency of libxml2.
Bug: 134379140
Change-Id: I01dfe41c6584d71de47a5a76e1f7cc718083ca8c
Test: m libaudiopolicyengine_config
This is to reduce application confusion when switching between back and
front cameras.
Test: Observe dumpsys on a phone with NIR camera device
Bug: 133141567
Change-Id: I0c11b99fc3a0304d54562548d109df8c56ba1db1
unlinkToDeath is no longer required, (this change in behavior is to
avoid leaks) so holding onto ActivityManager here (still calling
unlinkToDeath to avoid a log, but may for instance remove all
unlinkToDeath calls in the future).
Exempt-From-Owner-Approval: approval received on AOSP CL, only
whitespace difference here.
Bug: 134576445
Test: boot
Change-Id: I273f77aac2b80ba9be70197cc3842f83a11bbd1c
Merged-In: I273f77aac2b80ba9be70197cc3842f83a11bbd1c
(cherry picked from commit 2f34814d1b)
unlinkToDeath is no longer required, (this change in behavior is to
avoid leaks) so holding onto ActivityManager here (still calling
unlinkToDeath to avoid a log, but may for instance remove all
unlinkToDeath calls in the future).
Exempt-From-Owner-Approval: approval received on AOSP CL, only
whitespace difference here.
Bug: 134576445
Test: boot
Change-Id: I273f77aac2b80ba9be70197cc3842f83a11bbd1c
unlinkToDeath is no longer required, (this change in behavior is to
avoid leaks) so holding onto ActivityManager here (still calling
unlinkToDeath to avoid a log, but may for instance remove all
unlinkToDeath calls in the future).
Bug: 134576445
Test: boot
Merged-In: I273f77aac2b80ba9be70197cc3842f83a11bbd1c
Change-Id: I273f77aac2b80ba9be70197cc3842f83a11bbd1c
The deprecated method AudioManager.isBluetoothA2dpOn() calls
getDeviceConnectionState on APM with an empty address, which
caused HwModuleCollection::getDeviceDescriptor to set an empty
address on the DeviceDescriptor for the currently connected
A2DP device. This method is called by MediaRouter.
When the address was reset, the java listener for audio device
connection monitoring was reporting the connection of an A2DP
device with an empty address, which in turn caused AvrcpManager
to behave as if the audio device connection failed.
If MediaRouter called isBluetoothA2dpOn() before AvrcpManager
received its called for device connection, the error would occur.
Bug: 132416679
Test: call isBluetoothA2dpOn() and check for valid address in dumpsys media.audio_policy
Test: atest AudioServiceHostTest#testInjectForRecord ; atest AudioHostTest ; atest AudioPlaybackCaptureTest
Change-Id: I1370edbbca46657506a990855d06a176f07c54d3
Original logic was comparing an overridden format int, switch
to use a const original format.
Test: partner device, Pixel 3 CTS
Bug: 136456900
Change-Id: I03d6e190770ee05e40446c417e323f546fdc2689
By checking the expected duration for all inflight requests to
finish and only log when it takes more than a threshold (5 secs)
to process all inflight requests and the list is long.
Test: manual testing
Bug: 135927862
Change-Id: Iaa2c593f1e69f63b1da7d35d73c696de3510cd2c
Also use audio HAL volume APIs for fast tracks opened on a
specific VoIP RX output. Previous implementation was only
considering regular tracks.
Fix regular track implementation to send volume before it is altered by
effect volume controller if present.
Also only reflect stream and master volume in volume sent to HAL:
track and shaper volumes are still applied by mixer.
Bug: 133829194
Test: VoIP call
Change-Id: Id5025a1f67df0eab7391056715047a23429e0f02
in addition to the time-based expiration, enable count based expiration
and set it to 2000 records, about 5x the daily average. Caps the memory
footprint.
Bug: 135552978
Test: boot, enough traffic to force expirations
Change-Id: Ide96df24b00e8f115905678800c782f29a91bcba
Make sure 'jpeg_destroy_compress()' is always called
before leaving 'encodeGrayscaleJpeg()'.
Additionally fix misspelling of 'intrinsic'.
Bug: 135622974
Test: atest
cts/tests/camera/src/android/hardware/camera2/cts/StillCaptureTest.java#testDynamicDepth
--generate-baseline=12
Change-Id: I55c1f86881ba05aac6aac6981df5fcb276c9d4da
Set voice volume to 0 when SCO volume index is 0 to
allow muting RX audio. when index is not 0, voice volume
is set to max to allow volume control by headset as before.
Bug: 111195322
Test: check call volume with SCO headset
Change-Id: I90466b01a9899929cd3e6fb1ac0a4985099497fc
AudioInputDescriptor, AudioOutputDescriptor, and AudioSession 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 and
AudioSession 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 marlin,
build marlin with USE_CONFIGURABLE_AUDIO_POLICY := 1
Merged-In: Ic508caedefe721ed7e7ba6ee3e9175ba9e8dc23a
Change-Id: Ic508caedefe721ed7e7ba6ee3e9175ba9e8dc23a
(cherry picked from commit a306e2a357)
Enable audio capture by the Assistant when RTT is ON during a call
similarly to when an accessibility service is in the foreground.
Also remove log when permission checked for hotword
and audio output capture fail as those checks are now done
systematically.
Also do not check permission to bypass interruption policy if
bypass flags are not set.
Bug: 132976361
Test: use voice input during a call with RTT enabled.
Change-Id: Iff45b0816dac889262ec29ea115f74dea4dc6b6d
With the new dataSpace/format override logic, during
finishConfiguration, we shouldn't check mDataSpaceOverride flag anymore
because now mDataSpaceOverride will be true for reconfigure.
Instead, we should check if the new override is the same as old
override.
Test: testPrepare on HAL device with dataSpace override
Bug: 134800141
Change-Id: I1ddc258100dfd7e3c2cc86f9e476d8d52c710e3f
[Context]
When a LOOPBACK dynamic audio policy mix PLAYER/RECORDER
is registered, first the REMOTE_SUBMIX device that will be
used by the app to capture/play respectively is activated.
Eg a mix RECORDER (used to inject audio to apps recording),
when registered will activate an OUT_REMOTE_SUBMIX.
Then the app can open a record/playback track on this
REMOTE_SUBMIX, which will trigger the other end of the pipe
to be activated.
Following this the playback/Record Tracks that match the
mix will be routed to the IN/OUT REMOTE_SUBMIX.
[Example for an app FUU]
1) App FUU register Playback/record mix
2) APM activates out/in remote submix
3) App FUU opens track to out/in remote submix
4) APM activates in/out remote submix
5) tracks matching mix are redirected to the out/in remote submix
When an OUT_REMOTE_SUBMIX is activated, it tries to check if it matches
a mix, if it does, it saves the output in the mix (in mOutput).
This output is then used to find a matching mix output in
getOutputForAttr(). If a mix has no output is is considered inactive.
Note that IN_REMOTE_SUBMIX do not save their input in the mix, the
input is queried by APM each time in its mAvailableInputDevices.
[Issue]
The issue is that in step (2), when an OUT_REMOTE_SUBMIX is
activated (thus for a MIX_TYPE_RECORDERS), no mix is matched because the
mix is of type IN_REMOTE_SUBMIX as it will be used to route AudioTracks
in step (5).
Thus no mix output is found in getOutputForAttr and the step (3) fails.
This is a recent regression as previously the type was not checked when
looking up for a mix in step (1).
The Change-Id of the patch that caused the regression is:
I4dc7f23bef19a7d47afc2998102da07dde41fbca, its sha1 is:
679172768d
[Workaround]
For now, given the release timing, implement a minimal fix that restore
the previous behavior for the OUT_REMOTE_SUBMIX output save lookup.
Aka, make sure to query for a IN_REMOTE_SUBMIX mix in step (2).
Step (4) is fine as the mix type is the same as the REMOTE_SUBMIX type.
As IN_REMOTE_SUBMIX do not attempt to save their output in the mix, no
issue is present on this code path.
A proper fix needs to be implemented on master, preferably by having the
same device save behaviour on both mix type.
Bug: 134068143
Test: Wifi calling call screening
Test: atest AudioPlaybackCaptureTest AudioHostTest
Change-Id: I1547948ae412dbdeb2d85cc62bf18f7ac5f1efc0
Signed-off-by: Kevin Rocard <krocard@google.com>
libhidltransport symbols are being moved into libhidlbase in order to
optimize linking/memory usage. libhidltransport will no longer be
required in the future (however removing references to it will come
separately).
Bug: 134961554
Test: boot
Change-Id: Ie8b9b03a53ae1f5672ce2565550768b4bcd321ee
Since vendor native clients don't have package names, appOps reporting
would be inaccurate for them. In order to avoid that, we stop appOps
reporting for vendor clients.
Bug: 132718220
Test: AImageReaderVendorTest, use hal client for cameraserver, GCA(sanity)
Change-Id: Ie6f80e8ab530aa755df57f8d25d9f1a15a20d7f7
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
Starting from HAL device version 3.5, the format and dataSpace for
IMPLEMENTATION_DEFINED pixel format uses original instead of overridden
values.
This makes HAL interface behavior consistent in that HAL doesn't need to
distinguish between first-time configureStreams and subsequent
reconfigure.
Test: Camera CTS and partner testing
Bug: 131864007
Change-Id: Ie5fdc7e9b6c11c1c96a069262b9458455855bcef
Prior to this patch, VolumeShaper state for direct
and offloaded tracks did not appear to advance for master mute
and all tracks did not appear to advance for stream mute.
Test: atest android.media.cts.VolumeShaperTest with and without muting
Bug: 133354056
Change-Id: I589f4e0837124a185509718f1175e06102a1be96
frameworks/av/services/audiopolicy/utilities does not exist,
remove it from audio service components' makefiles.
Test: build
Change-Id: I6c29052b449099d4b0942b7fc0a7ae68d0dc1ba7
Merged-In: I6c29052b449099d4b0942b7fc0a7ae68d0dc1ba7
This was fixed when converting to Android.bp in internal master, so
that's the Merged-In reference.
Test: treehugger
Change-Id: I6a503ac7f3c283b7ef6a657c100901469447a22b
Merged-In: I7061e99da18f5f7fad00527f01bf97ae6cebea2f
Modify AudioPolicyMixCollection to inherit from Vector instead
of KeyedVector so all so the collection of mixes stays in the same
order as the mixes were added.
Also make the mix selection take the deviceType into consideration,
not just the address to enable the same address to be associated to
different devices.
Bug: 131090322
Test: see bug for multi bus scenario
Test: atest AudioPlaybackCaptureTest
Change-Id: I4dc7f23bef19a7d47afc2998102da07dde41fbca
Upon startAudioSource -> connectAudioSource, the source client
is attached to the output.
Upon stopAudioSource -> disconnectAudioSource, the source client is
never removed.
As a result, if the same client is trying to call startAudioSource again,
asthe client is already attached, getClient will lead to bailing out in
connectAudioSource and the source will not be started.
The stopAudioSource if called would claim that the client refcount is already 0.
Any following call to start would fail again on outputDesc->start as invalid
as the profile fails on canStartNewIo.
This CL fixes this issue by removing the client source desc on disconnectAudioSource.
Bug: 133367802
Test: build & run
AudioPolicyEmulatorTests --gtest_filter=*AudioSourceEffectTest*
multiple consecutive times.
Change-Id: I78370be248ff24cf4135d51f709d965c5bfae4e8
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Do not check app ops for audio playback for services in
general, not just for audioserver or root user.
Bug: 133178934
Test: audio smoke tests
Change-Id: I3a34e6418dc750cc12ed35d465ca8874b0ce0f73
Fix regression in camera shutter sound when system stream
volume is 0.
Bug: 132696227
Test: repro steps in bug.
Test: regressions when camera sound is enforced
Change-Id: I76b4a5ee041f97c5f771c003bf4f99327d797096
This patch fixes several issues:
* Change the timing the acquire fence FD is closed: we used to
close the FD when the buffer is returned from HAL. This patch
changes that to after the request is sent to HAL (or failed
to send to HAL)
* Cleanup inflight buffer map if the request fails to be sent to
HAL
* With the CL, the acquire fence FDs are now closed by
- HalInterface::processBatchCaptureRequests if the HIDL
processCaptureRequests call succeeds and HAL is running
in binderized mode (for passthrough mode the FD is owned
by HAL if the HIDL call succeeds)
- Camera3Device::cleanupFailedRequests otherwise
Test: Camera CTS tests
Bug: 132594861
Change-Id: I5f67ae9e7b8008738bd9a24246d754a6a3669b0c
remove references that pull xaac codec into the build; the codec is
still considered experimental and not to be included in product.
Bug: 131342273
Test: compilation
Change-Id: Ic7ff3871c88555bd006c0c79beebada3732a8b8e
We no longer have code path running non-HIDL interface.
This cleanup also simplifies some logic needed for fixing
b/132594861
Bug: 132594861
Test: Camera CTS
Change-Id: If15ea359a1a59c5a8e7a59818ce4db8120000bc4
We add permissions for 'readlink' and 'open' for 32-bit targets.
These are used when grabbing bug reports, at least on some
32-bit devices.
Test: Tried this change on a 32-bit device that was getting fatal
aborts when taking bugreports, and confirm we no longer get fatal
aborts.
Bug: 132807384
Change-Id: I526217e9201d2a709baa2a6d9f078244578d678d
Fixes build issues with -O0, due to missing vtable entries.
Bug: 116873221
Test: Build with -O0
Test: make NATIVE_COVERAGE=true COVERAGE_PATHS=frameworks/av
Change-Id: Ice06940f4ccc55609abf0d820f9b3c6d4e43d2c6
(cherry picked from commit 24fe48807f)
Modify channel mask match rule for input profiles in order to
favor profiles with positional masks and less than 2 channels.
This reflects the audio HAL convention to not list index channel
masks for less than 2 channels.
Bug: 131943885
Test: repro steps in bug.
Change-Id: I85e06f3afc2833b6aa7d52675bfd1ffda524fbcf
Add check for privileged permission if attributes
flags BYPASS_INTERRUPTION_POLICY or BYPASS_MUTE are set.
Bug: 131873101
Test: Manual smoke tests for audio playback.
Test: Emergency cell broadcast in
Change-Id: I073cf669f606f0d081ff5c8d19f39b5e12efe297
Depth samples with low confidence can skew the
near/far values and impact the range inverse coding.
Avoid using such samples when searching for the near
and far points and clamp their values if necessary.
Bug: 132248813
Test: Camera CTS
Change-Id: I7dc134b50e46c664f9fc8750b9b9b37c416c9afe
Add below logical camera support to dumpsys:
- Physical camera id to stream info.
- Physical camera request/result metadata.
- Physical camera metadata in tag monitor.
Also fixed an issue of missing vendor tags in physical metadata.
Test: Run physical streams and observe dumpsys
Bug: 111940580
Change-Id: I02889b213ff5e7ec29506c0483ef40de9d107ccb
Audio mix rules that contain both a match and exclude for a uid
or usage are ignored for routing evaluation. The implementation
of the uid-device affinity caused uid matches and exclusions to
be added to any mixes, causing previously valid mixes to be
discarded in the routing logic.
The fix consists in implementing the uid-device affinity by only
applying uid exclusions on mixes that:
a/ are compatible with the concept (mixes of players that are
render only),
b/ do not route to the selected devices
c/ do not have a uid match rule (such mixes are already exclusive
to the uid to match)
d/ do not already have a uid exclusion for the uid
Fix removeUidDeviceAffinities() that skipped the wrong mixes.
Bug: 124319394
Bug: 131180578
Test: atest AudioHostTest#testUidDeviceAffinity
Change-Id: I813c4cfb15956e56599740948775c32562266c21
commit 74e01fa7 did not bypass app ops policy when flag
AUDIO_FLAG_BYPASS_INTERRUPTION_POLICY is set.
Bug: 131873101
Test: repro steps in bug
Change-Id: Idbce26cfdcddbb7a2ae8702ce3d135ef5a69f047
1. Return error when remote submix device is null. Remote submix device
could be null in some case, such as device address error. Returning
error to avoid native crash.
2. Unregister policy mix if set device connection fails. In that case,
get input device could fail when policy mix is not found.
Bug: 131906484
Test: Manually
Change-Id: I03ab2bf217341b672c14adfba96d92ad9b453b01
Override the oom_adj scores of vendor clients from to PERCEPTIBLE_APP_ADJ.
Override the process state of vendor clients to to PROCESS_STATE_PERSISTENT_UI.
This is in order for app processes to take priority over vendor clients.
For example, this could help in the case of the default camera app and
face auth contending for resources from the lock screen.
Bug: 132117718
Test: manual test on lockscreen, try to double press and open camera app
while a vendor client is connected to a contending camera device.
Change-Id: Ie5fabb59c876cb02eb706f3dda8f748c69e3c063
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
Restrict concurrent capture scenarii by not allowing 3rd party
applications to capture concurrently
Bug: 131758164
Test: manual test of main capture use cases
Test: CTS tests for audio recording
Change-Id: Ica17d6eea81671eeb872fe55c1e7e06ec9ad279b
* changes:
codec2: use media_codecs from apex and support variants/domains
media: add media_codecs.xml to apex module
media: expand media_codecs.xml to support variants and domains
media/omx: Make OMX software plugin an actual plugin
omx: only list existing OMX codecs in OmxStore
take the collected media.metrics (as they arrive) and push a copy over
to statsd, the statistics logging subsystem.
gather data, wrap in protobufs apppropriately, and submit it to statsd.
Bug: 118782504
Test: statsd's test_drive app
Change-Id: Ieb82c43633851075e9eaf65d2a95c8cba87441ea
HAL ZSL request may be out-of-order compared to normal/reprocess
requests. Allow such case to improve shot lantecy.
Test: Camera CTS, 3P camera app sanity test.
Bug: 120604717
Change-Id: Id994efbe392094cdae694afaa2d159bc9c49d5f0
Two fixes for multichannel playback over USB from
AAudio legacy streams:
1: AAudio use a channel index mask and not a positional mask
when channel count is greater than 2.
2: audio policy gives priority to an output mixer which can support
the requested channel mask without downmixing
Bug: 131685020
Test: play multichannel audio over USB
Change-Id: I13f2da48d47fcf81f522096d90ba59a89379cffb
Also fix a issue for finishConfiguration is unintentionally
delayed till first capture request.
Test: Camera CTS + partner device testing
Bug: 126390310
Change-Id: Ibca740a7160cbf41e01884dbcef8ba51eb4c75f7
Also fix a issue for finishConfiguration is unintentionally
delayed till first capture request.
Test: Camera CTS + partner device testing
Bug: 126390310
Merged-In: Ibca740a7160cbf41e01884dbcef8ba51eb4c75f7
Change-Id: Ibca740a7160cbf41e01884dbcef8ba51eb4c75f7
When the mixer status was MIXER_ENABLED twice in a row
zeroes were forced to the audio sink.
Test: aaudio test write_sine_callback -pl -n1 -r44100 -s20
and then use rapid volume changes.
Bug: 131767115
Change-Id: I24b41084138210c63e8c551ae4a5f3adddb9e607
Added code to removeUidDeviceAffinities in AudioPolicyManager.cpp
Bug: 131447931
Test: ran test in android auto multizone audio and policies were
correctly removed.
Change-Id: I70a8452d6c4ce5812f2c3f03ddf10b96cb0bb947
AAudioService would fail if a null client was passed.
Two null checks were added. One where we know the null
client first appears. And one where the client is first used
in case other calls are passing null.
Bug: 116230453
Test: Bug has a POC apk that triggers the bug.
Test: Look for messages like:
Test: AAudio : BnAAudioService::onTransact() client is NULL!
Change-Id: Id9c4fc154226ab40df97335da8bc9361cfc99a73
bug: 131328009
bug: 129426284
test: test on 32bit Android Go device and see mediaswcodec starts on boot
Change-Id: I21c2b3d228dfa4916bbdbe4f899024f69fd0c77e
Do not force audio device changed callback when the client
(AudioTrack or AudioRecord) registers to AudioFlinger but only when
it starts playback or capture. Doing so prevents a spurious callback
happing at registration time where a stale device
(previously selected by AudioFlinger thread) but irrelevant to this
client is indicated. This causes a disconnection of AAudio streams
despite no real device change.
Bug: 128630993
Test: CTS: android.nativemedia.aaudio.AAudioTests, android.media.cts.RoutingTest
CTS Verifier: Audio Input/Output Routing Notifications Test
Change-Id: Ia7f1d11490989b0287c97479466c1c07a223aab3
The client must provide a unique Record ID (RIID) when creating
an AudioRecord. This RIID is passed down to AudioInputDescriptor
in AudioPolicyManager which sends configuration updates
via IAudioPolicyServiceClient callback.
By supplying RIID, the Audio Service can coalesce start / stop
events coming from clients (apps) with recording configuration
update events.
For AAudio MMap clients everything is handled at the server
side because they correspond directly to audioserver objects.
Bug: 123312504
Test: android.media.cts.AudioRecordingConfigurationTest
AudioRecordTest#testAudioRecordInfoCallback
MediaRecorderTest#testAudioRecordInfoCallback
manual testing using Oboe and Solo test apps
Change-Id: I3d32241752d9a747736606dc4cb1e068e6b7aa3b
This CL aligns the engineconfigurable PFW top file to the convention
adopted within parameter-framework.
Bug: 130284799
Test: make
Change-Id: I146430a1a6618d73273dbfd85b060d9fd04a6f9a
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
This will more accurately track the read or write
position of the DSP.
The client sometimes aggregates multiple hardware bursts
to avoid waking up too often. This can make it look like the DSP has
processed a larger amount of memory than it really has.
With this change, the timing model will advance in sync with the hardware.
Bug: 117834966
Bug: 130911274
Test: see bug for repro steps
Change-Id: Id22f1f313e02f0514665ee5ac144cab4684e3bc1
OpPlayAudioMonitor was constructing a weak pointer to itself
in the constructor. This practice can lead to crashes due to
race conditions vs object destruction. This code is now moved
to onFirstRef method which is called when at least one strong
reference exists.
This change also reduces the number of created OpPlayAudioMonitor
objects by using a factory method.
Bug: 130038586
Test: enable / disable DND mode
Change-Id: I22e63a883ebaa25b9c96e79271bb9693b5ed75cd
The clear function of vector will release memory,
so mBins will use overflow.
Test: enable asan for cameraserver
Bug: 131103281
Change-Id: Iaaa353332d7ac3992f018aa667fb8ef20a810f20
Signed-off-by: zhangshuxiao <zhangshuxiao@xiaomi.com>
Do not systematically close all inputs when an input device is connected
or disconnected but only those affected by the change.
Also:
- refactor setDeviceConnectionStateInt() to align input and output
devices connection sequence
- remove unused "inputs" argument to checkInputsForDevice()
Bug: 126370328
Test: phone call, video call , camcorder, assistant, auto projected
Change-Id: I27734b32da97ad4790d6cd74eaaf866e414db211
Use only devices attached to primary HAL when capturing
for audio source HOTWORD as they have to be accessible by
the audio DSP.
Bug: 123311424
Test: capture use cases: phone calls, Duo, Camcorder, Assistant.
Change-Id: Ib54622b69612e6ed12f36193d4b1918ba892a2cd
AudioFlinger used to reject requests for the low latency FAST
path when the capacity was != mPipeFramesP2.
But if the caller requests < mPipeFramesP2 than we can just bump it
up to mPipeFramesP2 because the API allows that.
For example, on Pixel, mPipeFramesP2 is 4096
Bug: 80308183
Test: adb shell input_monitor_callback -pl -b4000 -m1
Test: should see performance mode 12 for LOW_LATENCY
Change-Id: I987067910de3194fb52370d0ea1626cffad6248c
This CL fixes the compilation issues met while generating configuration files.
@todo: TEMPORARY_DISABLE_PATH_RESTRICTIONS=true is still required to use
subprocess.Popen(["domainGeneratorConnector",...) on external/parameter-framework
@todo: CL mixing in parameter-framework leading to validation failure
Bug: 130284799
Test: make
Change-Id: I495026781af63f3c3a538b00fe467d39f58baa70
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Add pre processing effect management for concurrent capture scenarii.
When several clients on the same input stream have enabled audio effects,
only the effects attached to the top priotity client are active.
Other effects are suspended.
Add AudioFlinger API to suspend/restore audio effects build on top
of exisiting internal effect suspend mechanism.
RecordThread now supports more than one effect chain.
AOSP pre processing implementation supports more than one effect session
per input.
Refactor AudioPolicyManager::closeAllInputs() to call closeInput() on
all inputs instead of partially duplicated code.
Bug: 128419018
Test: make
Change-Id: I685286da4c2905a8894a4354679f9787b1400621
For a2dp hybrid mode, device retrieval is done through type / code pair.
When the device is connected, getDeviceDescriptor is called with allowToCreate
boolean. As a result, HwModuleCollection::createDevice will be called, invoking
getModuleForDeviceTypes as done laterly in setDeviceConnectionState.
This CL removes double call to these function.
Bug: 130284799
Test: make
Change-Id: I188f11e9325cfc6af2ae872e00485e00ccd9096b
Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
AudioPolicy used to hide activity of stream patch to prevent changing
the volume.
This CL replaces the filtering of the stream patch activity on the policy
by a full volume range within audio flinger.
It updates also product strategies example for automotive to add associated
strategy and full range volume.
Bug: 130284799
Test: make
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Change-Id: I6e77dc2cbed0289f0a1341f7597b1c25abee5f7d
No need to filter anymore the remote submix to engine as
both configurable and default engine take care of legacy remote
submix address (aka "0") and wont only care about type.
Bug: 130284799
Test: AudioPolicyEmulatorTests --gtest_filter=*.DynamicPolicyMixRecordInjectionTest.*
AudioPolicyEmulatorTests --gtest_filter=*.DynamicPolicyMixPlaybackReRoutingTest.*
Change-Id: Ia90c65ccfc51220a2344cecec2fbba7f2bad776a
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Reduce log spam and error logging as part of the Green Log effort.
Replace logging of addresses with integer IDs.
Bug: 36785118
Bug: 122073229
Bug: 130569151
Test: Open an AAudio stream at 44100 and look at logcat.
Test: adb shell write_sine_callback -pl -r44100
Test: adb logcat | grep -i aaudio | grep " E "
Test: Should see no "E" logs from AAudio.
Test: Should see no addresses from AAudio.
Change-Id: I1d4e0bc349095f818fad52603d2bb8e7317d3681
Merged-In: I1d4e0bc349095f818fad52603d2bb8e7317d3681
(cherry picked from commit 7ba46558fb)
Remove effect specific mutex (mEffectLock) in AudioPolicyService: Due to
concurrent capture (among other reasons), it is necessary that the audio
policy manager state preserved by mLock includes audio effects
registration and enabling.
Moved all audio policy API calls from audio flinger out of locked regions
for audio flinger, thread and effects mutexes to avoid cross deadlocks
between audioflinger and audio policy manager:
- centralized audio policy API calls in EffectModule::updatePolicyState()
- the enabled state now reflects the state requested by the controlling
handle, not the actual effect processing state: a suspended effect is
now considered enabled.
A new audio policy manager API moveEffectsToIo() is added to atomically
handle moving effects to a new input or output without having to call
unregister > register > enable sequence.
Also fix assert in setStreamVolume to match volume group refactoring
in audio policy manager.
Bug: 128419018
Test: CTS tests for audio effects.
Test: manual tests with Duo calls, Play Music, Youtube, notifications
with and without Bluetooth and wired headset.
Change-Id: I8bd3af81026c55b6be283b3a9b41fe4998e060fd
Add cpu hint for c2 sw codecs as well as omx.
bug: 130669553
test: manually test that when playing YouTube 1080pHDR
content, adb logcat shows traces from SchedulingPolicyService:
SchedulingPolicyService: Moving xxxx to group 5
Change-Id: Ie7afeb207fc0a898669bc7b98b270982471e6b65
- RAW capability can exist for multi-camera even if physical cameras are
of different sizes/capabilities.
- FOV for all processes streams must be the same regardless of logical
or physical streams.
- All metadata tags related to pixelArray/preCorrectionActiveArray/activeArray
needs to be mapped properly by the camera HAL.
- Do distortion correction mapping for physical subcamera as well.
Test: Build and read docs, camera CTS, ITS.
Bug: 118906351
Bug: 126220135
Change-Id: I29a61fc3a603561c1d74dc2261600ce4cd3d34cd
Allow at most one effect chain with same sessionId on mPlaybackThreads.
Test: poc, CTS effect tests
Bug: 123237974
Merged-In: Ide46cd23b0a9f4295f0dca2fea23379a76b836ee
Change-Id: Ide46cd23b0a9f4295f0dca2fea23379a76b836ee
(cherry picked from commit 1631f06feb)
(cherry picked from commit f963b2bfda)
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
Bug: 123237974
Merged-In: I690ea3cb942d1fdc96b46048e271557d48000f43
Change-Id: I690ea3cb942d1fdc96b46048e271557d48000f43
(cherry picked from commit 9aeb1770d4)
(cherry picked from commit 5945746bca)
Allow at most one effect chain with same sessionId on mPlaybackThreads.
Test: poc, CTS effect tests
Bug: 123237974
Merged-In: Ide46cd23b0a9f4295f0dca2fea23379a76b836ee
Change-Id: Ide46cd23b0a9f4295f0dca2fea23379a76b836ee
(cherry picked from commit 1631f06feb)
(cherry picked from commit f963b2bfda)
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
Bug: 123237974
Merged-In: I690ea3cb942d1fdc96b46048e271557d48000f43
Change-Id: I690ea3cb942d1fdc96b46048e271557d48000f43
(cherry picked from commit 9aeb1770d4)
(cherry picked from commit 5945746bca)
These things are ceaseless: /
code reviews, design docs - /
off-by-one errors making a mess
Test: atest CtsCameraTestCases
Bug: 129561652
Change-Id: I807d7ad4740ffe267053fe5da2080f9ecb45aa72
The haptic intensity for fast track should be initialized, or it will be
HAPTIC_SCALE_MUTE by default, which may result in no haptics.
Bug: 130312331
Test: play haptics stream with FastMixer enabled
Change-Id: If5a1ea12c563c4af1422b2e32451b80e69d2ef58
In call music played on remote is called an "exclusive" preferred
device. It may not be propagated to other client that may play locally.
The client of the exclusive preferred device is not routed as the
exclusive preferred device are ignored from findPreferredDevice helper.
This CL fixes the routing
Bug: 130284799
Test: AudioPolicyEmulatorTests --gtest_filter=FilteringExpliciRoutingTest*
Change-Id: Iec7e14cb170d0f67c8c0b231f8219c133d7d2185
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Engine is not only responsible of legacy remote submix for input
device selection (aka "0" adress) but also regular remote submix
with a given address. Filtering the remote submixes prevents engine
to select the remote submix for input stream in case a policy mix
rule has been set to record specific sources.
Bug: 130284799
Test: AudioPolicyEmulatorTests --gtest_filter=RecordInjectionSourceMatch/DynamicPolicyMixRecordInjectionTest
Change-Id: Iaafd1195b9ab5c82ad3bd2766061d982a10bb9da
Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
Clean up session effects in releaseOutput in case stopOutput
is not received before release.
Bug: 124689305
Test: start/stop cast screen while playing music
Change-Id: Ie0588dd3336d56d34c2d717268fcd0918cbf5717
The haptic data will be partially interleaved at the end of the buffer
after processing audio mixing. When processing audio effect, only audio
data will be handled. In that case, haptic data will be missed if there
is any audio effect. Copying haptic data directly from audio effect in
buffer to out buffer could help solve the problem.
Bug: 129956425
Test: play haptic with audio effect.
Change-Id: I2b48bb43bec10167d4eacbcaa5c27959e0d44c32
This reverts commit b4979c59d9.
Reason for revert: reland with fixes:
1) make OMXHarness use OMXClient, not directly IOMX wrappers.
2) fix ref of consumer listener interface in GraphicBufferSource.
bug: 129272021
Test: camera recording, aosp_x86 build
Change-Id: Idaaaf412c65cbe89c95a2cb54f3833ff1fc4c304
To improve camera launch performance, cache the proxy service
interface. System tracing indicates fetching the interface can take
up to 8-10 ms during real camera opens, which is a percent or two
of total camera startup time.
Test: atest CameraCtsTestCases
Bug: 130173970
Change-Id: Icdf5218b04f608b897dcbf2085f971b04a913f3b
This reverts commit 482f60cccc.
Reason for revert: b/130058749 camera recording hang
Bug: 130058749
Change-Id: I358bc9c62c48328c01c8611c7e6f77d16affff54
Using AUDIO_DEVICE_OUT_SPEAKER to replace AUDIO_DEVICE_OUT_SPEAKER_SAFE
for device match.
Bug: 129456342
Test: volume can adjust while previewing ringtone
Change-Id: I3015f811ac6d2e3f3cdd606f453348c4bc526935
Signed-off-by: Robert Lee <lerobert@google.com>
Fix a cross deadlock between thread and effect chain mutex introduced by
commit 446f4df5.
Bug: 130044136
Test: start/stop audio capture for voice communication in 2 different apps
Change-Id: I23bdbd203476d2bc0b3d8d87ab66e1a9c00f7bcd
- Make mediacodec service/libstagefright_omx not dependent
on libgui. Server should only reference bqhelper (which
currently still have a dependency on libgui, but could be
removed later as it's only used internally).
- Make libmedia_omx not dependent on libgui by moving the
IOMX wrapper code into a separately that's only used by
the platform.
- Move ConsumerListener references in GraphicBufferSource
to implementation only, so that other libs including
GraphicBufferSource doesn't need to link libgui.
- Remove bqhelper references from some client side libs.
- Remove IOMX ipc related code, as IOMX interface is no
longer used for ipc. It's only used as an interface on
client side.
bug: 129272021
test: builds;
atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small
Change-Id: I49d80bf72eba325ee80b223d4a5ba7b0c1ab4d35
As MMAP does not support APC, it is disabled when a render loopback
policy is installed.
Test: adb shell write_sine_callback -pl # mmap is used
adb shell audiorecorder --target /data/file1.raw &
adb shell write_sine_callback -pl # mmap is NOT used
Bug: 129948989
Change-Id: Ia90c24953890de7e19fd99485bf760788f81126d
Signed-off-by: Kevin Rocard <krocard@google.com>
(cherry picked from commit c1dde63140)