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)