- Handle various corner cases with regard to REQUEST_ERROR, RESULT_ERROR, and BUFFER_ERROR.
- Drain the codec outputs in case the input buffer isn't dropped.
- Allow APP_SEGMENT to drop while still producing valid output image.
- Add a status tracker to manage active/idle state.
- Use frame number as key for pending input frames since with ZSL, 2
capture result could have the same timestamp.
- Also removed some deprecated variable/methods.
Test: CTS, vendor testing
Bug: 145579077
Change-Id: I9c3e929469b8fb75b32b016f9006036c954f663f
Bug: 155096545
Test: adb shell dumpsys media.audio_flinger | more
Test: then search for "Device"
Test: There should be no garbage characters on the next line.
Change-Id: I798d914cede3f45151f97178de3ceee09b4e24c0
When a new device is attached to hardware module, query the HAL to get
the supported encapsulation modes and metadata types.
Test: atest EnumDevicesTest, manually
Test: atest audiofoundation_parcelable_test
Bug: 155799506
Change-Id: I903e46e35a44416c9f2d206c128face8a6c61dcb
Spawn a thread to handle the disconnects for onRoutingChanged()
and onTearDown(). This is to prevent deadlocks when calling back into
AudioFlinger.
Bug: 155819038
Test: See bug for repro steps with OboeTester
Test: Also run TEST DISCONNECT in OboeTester. It was failing.
Test: atest CtsNativeMediaAAudioTestCases
Change-Id: I83212fea140d3b6beca9aa737606a77a7c97b007
- Trigger audio power usage logging when
1. endAudioIntervalGroup event for track/record
2. setMode to NORMAL for telephony
- Aggregate audio usage by type and device
- Send audiousage data every 24hrs by default, using property
persist.media.audio_power_metrics.interval_hr to config the interval
- Add property persist.media.audio_power_metrics.disable to disable
audio power metrics
Bug: 121318157
Bug: 140909217
Test: atest mediametrics_tests
Test: adb shell dumpsys media.metrics --all
Change-Id: I94ff00a5609a49c96a14827d3260d481c1310abe
Signed-off-by: Robert Lee <lerobert@google.com>
Modules contributing mainline modules (APK/APEX) should set
min_sdk_version as well as apex_available.
For now setting min_sdk_version doesn't change build outputs.
But build-time checks will be added soon.
This is second part of two CLs: covers non-mainline files
Bug: 152655956
Test: m
Change-Id: I55336e644990d3f175e0c011856b52ec600e452a
Force DIRECT flag if current playback thread is direct output thread.
This can happen when the playback is re-routed to direct output stream
by dynamic audio policy.
Bug: 130296239
Test: manual
Change-Id: I24efd87f74bacf6b769d3663e9521eb27b1704e9
An app (B) that asks for an exclusive stream can steal
an exclusive stream from an earlier app (A).
App B will be given the MMAP resource as a SHARED stream.
The stream for app A will be disconnected and released
by the service.
If app A reopens a stream then it will get a SHARED
stream.
The order of the opening of the streams is controlled by using a
recursive_mutex in AAudioService::openStream().
Bug: 129846760
Test: media/libaaudio/tests/test_steal_exclusive.cpp
Test: also
Test: Launch AudioTroubleMaker. It should say "EXCLUSIVE".
Test: Press Home button.
Test: Siren sound from AudioTroubleMaker should continue.
Test: Launch OboeTester
Test: TEST OUTPUT, then Open, Start
Test: You should get an MMAP SHARED stream on Pixel.
Test: Go back to AudioTroubleMaker. It should say "SHARED".
Change-Id: I7f8339d8ed62546520a9b46ed398418b41ca2832
Revert "Add isUidActiveOrForeground() for camera/audio to use."
Revert "Add isUidActiveOrForeground for camera/audio to use."
Revert submission 10829580-isUidForeground
Reason for revert: In CameraService.cpp, before this change, around "am.isUidActive", there was up to 300 ms retry. After this change, the code could move forward fast without retry, but at "mAppOpsManager->startOpNoThrow" call, for the same reason as uid is not updated fast enough, "mAppOpsManager->startOpNoThrow" could also fail.
This CL does not really fix the root cause, but it changes the timing and now the code fails at "mAppOpsManager->startOpNoThrow" call.
Also the timing change may also cause recent multiple CTS test failures.
Bug: 154570809, 155032617, 154849083
Reverted Changes:
Iffed63293:Add isUidActiveOrForeground() for camera/audio to ...
I3685e0c8d:Add isUidActiveOrForeground() for camera/audio to ...
I51ed1fe78:Add isUidActiveOrForeground for camera/audio to us...
Change-Id: I8acde2524201b6c6d0d5c0ff9cfb2053ffbcb8ef
Handle the case where the HAL doesn't advertise
preCorrectionActiveArraySize by initializing it to activeArraySize.
Test: "dumpsys media.camera" before and after the change
Bug: 145300768
Change-Id: I1281686d9b324793a4a99c6a4ddf5d693172507b
For easy transition from SchedTune to UtilClamp, direct access to these
cgroups should be abstracted by using task profiles. Replace writepid
commands with new task_profiles command.
Bug: 155419956
Test: change .rc file and confirm task profile is applied
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Id00370b25af973a4b3813a4a1d6ccbd1e555c87f
Merged-In: Id00370b25af973a4b3813a4a1d6ccbd1e555c87f
Enable clang thread safety analysis. Convert comments on TS
into directives. Fix missing lock acquisitions. Add missing
default initializers for the fields of UidPolicy and
SensorPrivacyPolicy
Also remove unused fields mpAudioPolicyDev and mpAudioPolicy
from AudioPolicyService.
TODO: Consider protecting pointers to command threads,
APM instance and the client, and system usages with a separate
lock.
Bug: 70398235
Bug: 155336464
Test: make, flash, and test audio on device
execute "adb shell cmd media.audio_policy" commands
Change-Id: I47b132c8b5c977812fad5c89fa57882a37779c18
Merged-In: I47b132c8b5c977812fad5c89fa57882a37779c18
When ECHO_REFERENCE audio source was added, it was omitted
from the list of virtual audio sources (sources protected by privileged
permission not accessing the mic). This prevents from capturing echo
reference at the same time as the input from mic.
Bug: 154639757
Test: test app on yukawa
Change-Id: Ib12e8c817dec7c3f4d3f3f7e7403330c88cead52
Compute summary statistics based on the current device
rather than the entire Audio Thread duration.
Test: adb shell dumpsys media.metrics
Bug: 149850236
Change-Id: Ie6d459b06b4a469401ee9e0c194e45ea5ce380c6
Compute summary statistics based on the current device
rather than the entire AudioTrack or AudioRecord duration.
Test: adb shell dumpsys media.metrics
Bug: 149850236
Change-Id: Ia3a5707c43c4530f5a6ac90f52901bd2e0bd0bab
Fix crash in getOutputForAttrInt() if the output corresponding to
the mix returned by AudioPolicyMix is not opened and the device
selected by the mix is not attached.
Before commit c529cf6f, a policy mix without opened output would not
be retuned by AudioPolicyMix.getOutputForAttr(). With direct
output suppoort, this is possible but should be ignored if the device
selected by the policy mix is not attached.
Bug: 155430290
Test: AudioHostTest
Test: AudioServiceHostTest
Test: audiopolicy_tests
Test: manual mirroring and car projection tests
Change-Id: I66be4a3c5fb8b9ae0674c0f1e6e39de7f18ed2fb
Fix areAllDevicesSupported() where HwModules.getDeviceDescriptor()
must be called with matchAddress == true: if the caller does not want to
distinguish on address it can leave the address field empty in the
AudioDeviceTypeAddr passed which has the same effect as using
matchAddress == false.
Also fix places where device_distinguishes_on_address() was improperly
used in place of audio_is_remote_submix_device().
Bug: 155224229
Test: build and launch car emulator
Test: AudioHostTest
Test: AudioServiceHostTest
Test: audiopolicy_tests
Test: manual mirroring and car projection tests
Change-Id: I74295de95bcd82e7fa439c396ae32749b9c70c05
Session parameter application may require an internal stream
re-configuration. Sometimes clients can abandon one ore more
registered outputs before changing a session parameter value.
Even if the new capture request doesn't reference the
abandoned surfaces the session parameter cannot be properly
configured. Keep the camera service behavior consistent with
older versions by skipping the internal stream
re-configuration.
Bug: 113513019
Test: Camera CTS
Change-Id: I8fb49b59ae0aecf537484a7238fe7a8a5d3efe64
After refactoring audio device type, the output devices will only be set
when create/release audio patch. In that case, the output devices are
empty when creating the thread. If the "ro.audio.silent" is set, it will
make master muted if the output devices are empty. To fix the issue, do
not check silent mode when the output devices are empty, but check
silent mode when output devices are updated.
Test: atest AudioHostTest with setting "ro.audio.silent"
Bug: 154037767
Change-Id: I6cb219353e541ba99ba9acebd6ce853128d963d3
At async release, set to stub surface to free up the current surface.
Bug: 129008570
Test: atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small
Test: manual app test
Change-Id: I2d90bd37b2be5324199410e1f776afb9cb19d662
when underrun duration is over 3 sec, overflow happens
for multiplication of nsec=sec*1000000000. Use correct format transform
to solve it.
Bug: 135075416
Test: run MTBF test
Change-Id: I0a09ca41f2fad055ce0cfa18f936131b7a630f52
Add support for direct outputs with RENDER audio policy mixes.
A mix of type render can be registered even if no corresponding
output is opened to reach targeted device provided a direct output
profile exist for this device.
Also:
- Fix setUidDeviceAffinities(): was not closing direct outputs
opened by checkOutputsForDevice() and was not re-evaluating routes
- Fix removeUidDeviceAffinities(): was not re-evaluating routes
- Implement consistent sanity checks on selected devices in
setUidDeviceAffinities(), setUserIdDeviceAffinities() and
setPreferredDeviceForStrategy().
- Fix onNewAudioModulesAvailableInt(): attached devices reachable only
via direct outputs were not loaded.
Bug: 130296239
Test: AudioHostTest
Test: AudioServiceHostTest
Test: audiopolicy_tests
Test: manual test: Auto projection over USB, screen mirroring
Change-Id: I54470b61b4bc7e041e3a295764d368c5ded21268
Log events from service.
Log start, stop, disconnect and other events.
Log underruns and bufferSize.
Bug: 154543374
Test: adb shell dumpsys media.metrics --clear
Test: run an app that uses MMAP, like OboeTester
Test: adb shell dumpsys media.metrics
Test: Expect to see lots of "audio.stream" events.
Change-Id: I690e5226b695d53d038d644f4438c759e08f9fbb