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
- 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>
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
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
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
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
getMicrophones() should return aggregated mic information
from all HW modules, not just primary.
Also:
- Fix assignment of mPrimaryHardwareDev that should be
first from HW module name and then according to primary output
if no module with name "primary" is loaded.
- Make sure we do not dereference mPrimaryHardwareDev if null.
Note that this should not happen with current rule that a primary module
must be present.
- Implement consistent locking scheme where both mPrimaryHardwareDev and
mAudioHwDevs are guarded by mHardwareLock
Bug: 154772890
Test: AudioManagerTest#testGetMicrophones
Change-Id: I7c9449bb705a6fbebdc0642166e58348d47b7ee8
Only the primary HAL has to support mic mute function.
Ignore errors returned by other HALs in setMicMute() and
only report mic mute state from primary HAL in getMicMute().
Bug: 153103117
Test: CTS AudioManagerTest.testMicrophoneMute
Test: manual phone call and verify microphone mute.
Change-Id: Ic121c49e7e7cd75eeee9342249271c7fca7c1c2a
Initialize variable 'strategy' in
AudioFlinger::EffectBase::updatePolicyState.
Found by clang-tidy.
Bug: 152526318
Test: m
Change-Id: I5aad916a9873122eed0bb8e40bb26d677f338b16
In aaudio, when adding tracks to mixed stream, it is needed to update
audio attributes to HAL whenever the tracks are added or removed.
Currently, only the audio attributes used to open the stream will be
sent to the HAL. In that case, adding audio attributes of the clients
when starting the stream can help solve the problem. In audio flinger,
the client's audio attributes will be used to create MmapTrack.
Test: play multiple aaudio tracks, add log
Bug: 77279923
Change-Id: Ic1c536049e194a2bb7513425ee4828d52769d27f
Initialize variable 'io' in
AudioFlinger::EffectBase::updatePolicyState.
Found by clang-tidy.
Bug: 152526318
Test: m
Change-Id: Ib8c71eaf83dc140874d3e65a094e52e36918160f
Add an argument to IAudioFlinger::createEffect() API to
ask AudioFlinger to just run the pre flight checks but not
create the actual audio effect instance and allocate resources.
This is the basis of an API for apps to query if a given
effect can be created without having to allocate the resources
and risk an exception when calling the constructor.
Bug: 150699608
Test: CTS and GTS Tests for audio effects
Change-Id: Ibdda22fd945c88c33e3c7342a7a5ed3e02d399ac
* changes:
Plumb the notification about audio HAL services update to APM
libaudiohal: Allow late registration of HIDL HAL services
Allow for late audio module discovery in APM
AudioFlinger registers a callback with libaudiohal to receive
notifications when new HAL services get registered. It relays
the notification to AudioPolicyManager via AudioSystem /
IAudioPolicyService interface.
Because AF / APM only interact via Binder interfaces and APM's
interface gets registered later than AF's, the notification
from AF is made asynchronous.
Bug: 149854039
Test: audio test on a regular phone configuration
audio test on a phone with MSD audio HAL module
Change-Id: I158e941b8f75e2a4614b9d84ca798b0f1f47aa6a
If effect chain has non-offloaded effect, and is enabled for direct
output, when there's no volume control for all the effect modules
within this chain, volume should still be set to HAL.
Test: Play Music, Videos with effects
Bug: 149899134
CRs-Fixed: 2625597
Change-Id: I77bd0d456d5fa4e88afb283002a5eb1e2b704ca8
When creating native audio track, a IAudioTrackCallback will be created
systematically. All callbacks will be cached in Threads and protected by
a lock. Whenever there is a callback event from audio HAL, it will
finally trigger callback to native audio track. Currently, there is only
one callback event, which is codec format change.
Bug: 150301890
Test: manual
Change-Id: I32293627ed923b17dd25f11f0ee0a0c35cd7c01f
The access to call audio (record and play) will be granted only to the app associated with Dialer role, who also includes a new system permission.
Test: Compilation and manual tests
Bug: 135197853
Change-Id: I65ca823c235d4d3420630837427103783ad1d1b0
This code has null checks with intervening unconditional dereferences of
the potentially-null variable.
It's not clear that `mOutput` can ever be null to begin with. If it can
be, we have a few dereferences to guard. :)
Caught by the static analyzer:
frameworks/av/services/audioflinger/Threads.cpp:2671:19: warning: Called
C++ object pointer is null [clang-analyzer-core.CallAndMessage]
frameworks/av/services/audioflinger/Threads.cpp:2852:9: warning: Called
C++ object pointer is null [clang-analyzer-core.CallAndMessage]
Bug: None
Test: TreeHugger
Change-Id: I456581204718390088998a1fe2514dff63f6578f
Routing strategy call assistant was added without
associated volume stream and wass reusing AUDIO_STREAM_PATCH.
This is violating the rule that two strategies cannot
share the same volume stream.
Bug:148588565
Test: play music and check volume
Change-Id: Ib3fb2a1b7b5f3118bf16a3cc9d8e578fa0431645
In order to avoid subsequent tracks using stale kernel timestamps while
computing track timestamps, clear the timestamp info upon flush.
Change-Id: I2b8af33b287aee986871b6415b89f9c53d92f3a6
Main problem was in AudioFlinger::EffectChain::EffectChain(), where
the thread* argument could possibly have been destroyed before the
creation of the weak pointer
(AudioFlinger::EffectChain::EffectCallback::mThread) around it.
While here, cleaned up a bunch of other pointer-related operations
in order to avoid trafficking in raw pointers to RefBase subclasses.
Bug: 147770363
Change-Id: I508ca94dd38a04e13f1a1c413f548001b961c721
* clang-tidy segmentation fault
Test: make with WITH_TIDY=1 and tidy checks for nightly builds
Bug: 146435095
Change-Id: Id9d5a10ebe73d902098d23c1a74954f82fef0607
Add management of audio effects applied to a specific input
or output audio device.
A new class DeviceEffectProxy derived from Effectbase is added
to represent an effect attached to a particular audio device type and
address. This proxy manages one or more actual EffectModule instances
automatically added to a playback or capture thread or directly to the
audio HAL when the targeted audio device is used by an audio patch.
A new DeviceEffectManager class is added to manage creation and release
of DeviceEffectProxy instances and monitor creation and release of audio
patches and create or release actual effect instances accordingly.
Bug: 136294538
Test: make
Change-Id: I23b9f9db4459136039c5ee327cf3b1aefa7db5af
Merged-In: I23b9f9db4459136039c5ee327cf3b1aefa7db5af
The pass thru software patch is normally used with the MSD module.
There is no need to establish a peer reference from PatchRecord
because its I/O code only gets executed by PatchTrack
initiative. In fact, this also means PassthroughPatchRecord
can't be stopped synchronously, so the usual software patch tear
down logic in PatchPanel leads to a null pointer dereference
because it races with PatchTrack I/O activity on a separate
thread.
Fix by skipping the sp<> setup / clear logic in PatchPanel
for PassthroughPatchRecord.
Bug: 147599144
Test: force teardown of MSD patch, check logcat for crash
Change-Id: I4a2abc16ad705244767b33ea529e1ace2213d19f
Introduce a class EffecBase as a parent class of
EffectModule with default implementation for handles management,
basic properties storage and state management.
Bug: 146177259
Test: CTS: AudioEffectTest, EqualizerTest, VisualizerTest,
AudioPreProcessingTest
Test: manual test: Play Music EQ settings, Duo EAC and NS
Change-Id: Id91cef9db6b4f6be0d2e77a8b4afcbdc7234e519
Merged-In: Id91cef9db6b4f6be0d2e77a8b4afcbdc7234e519