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
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
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
Do not allow changing volume on an output when
the specified device is not supported by the
corresponding output profile.
There is a similar sanity check in setOutputDevices()
but there was none in AudioOutputDescriptor::setvolume().
Bug: 153411189
Test: atest AudioManagerTest
Test: manual audio smoke tests
Change-Id: I539697c54d70c442ba1ce38d212b43cd3ef0138c
The list of possible paths for the audio configuration
files is now retrieved using audio_get_configuration_paths()
function. All duplicated lists of known configuration
directories have been removed.
Bug: 153680356
Test: test audio on built image working
atest VtsHalAudioV6_0TargetTest VtsHalAudioPolicyV6_0TargetTest
Change-Id: I8c369442f5ca7baa17df95e6a001396fc9de5681
Merged-In: I8c369442f5ca7baa17df95e6a001396fc9de5681
With HAL1-camera2 legacy implementation, the getCameraCharacteristics
may be called without camera permission. So the cameraserver's Uid is
used in that case.
AppOpsManager returns MODE_IGNORED when the cameraserver's Uid is passed.
Do not treat this as an error case.
Bug: 153511543
Test: On Pixel 2 device, run "adb root; adb shell setprop
persist.camera.HAL3.enabled 0; adb reboot", then "atest
cts/tests/camera/CaptureRequestTest"
Change-Id: I29aaa2045b14233537c737bf0738fbc32422540e
Duplicating outputs do not have an associated IOProfile and
getPolicyAudioPort() returns null.
Add a method to AudioIODescriptorInterface to query if the
input or output descriptor corresponds to MMAP IO profile or not.
Bug: 153849965
Test: repro steps in the bug
Change-Id: I300356880198f1785e3a5e1359ffd393c6ae4190
Scenario: startAudioSource (SW bridge) started, then stopped.
AF patch is released, so PlaybackThread has empty patch.
Next playback using the same sink will not recreate any patch
on AF as same device (and output desc has still valid patch handle)
Hence, ioconfichanged will get PORT NONE as sink device, no
onAudioDeviceUpdate cb can be fired.
This CL fixes this issue by reset of patch handle on the output
Bug: 136121584
Test: startAudioSource / stopAudioSource then playback on the same
sink. Ensure onAudioDeviceUpdate is fired
Test: atest RoutingTest
Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
Change-Id: Ia9c2570f687166f38335ed7efae28920f7acc474
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
If there is an issue where this is not loaded, we should know.
Bug: 146059841
Test: boot health check on devices
Change-Id: I3c50078b254e3caff5c824024909cb722dfb1aae
Camera metadata entries can become invalid
after updates. Avoid using the possibly
released entry pointer when extending
camera characteristics with dynamic depth
tags.
Additionally simplify rotate and crop
region checks.
Bug: 152240541
Test: cameraservice_test
Change-Id: I416739ed7e128f4ec94353ec2938b9bf226be182
add an interface to accept a list of additional policy files, instead of just a single file.
Also add TEST_MAPPING for presubmit.
Bug: 147914640
Test: boot with empty, 1, and 2 element lists, atest
Change-Id: I97e8e0ec7b68699838595c09a4a8e7c7eef657c3
Merged-In: I97e8e0ec7b68699838595c09a4a8e7c7eef657c3
(cherry picked from commit 11c1a68778c39564ed37e653d7af6881a2d11ea6)
Binder doesn't hold on to the death recipient.
This caused audio server to miss notifications about system server
death.
Fixes: 153080001
Test: Manual verification of killing the system process.
Change-Id: Iad1b2d4c5348d3d9917efc6838e86b736fa33094
Previously, audio policy client would call an method on the sound
trigger middleware service. This has been replaced by the sound
trigger service registering a callback, in order to avoid a cyclic
dependency between the services.
Bug: 146157104
Merged-In: I876461a7650d337d6dd05fbe80efaf08f8ef20dd
Change-Id: Ia8f674d7dd50f6dcdd6595bcbadec2f25fdb3561
This is a helper class for notifying a client of capture
state changes.
Bug: 146157104
Test: Compiles (further testing as part of the topic).
Merged-In: Ie27bc404805d319a6969290a6369d59fb68c1f38
Change-Id: I2902468c4692ba68e4bc9be0e5038d5505da7154
Initialize variable 'strategy' in
AudioFlinger::EffectBase::updatePolicyState.
Found by clang-tidy.
Bug: 152526318
Test: m
Change-Id: I5aad916a9873122eed0bb8e40bb26d677f338b16
The UID of the current InputMethodService (DEFAULT_INPUT_METHOD) is
pushed from AudioService to AudioPolicyService via AudioSystem.
Allow capture audio if:
- the UID is the current InputMethodService's UID,
- AND a RTT call is active,
- AND the source is AUDIO_SOURCE_VOICE_RECOGNITION.
Bug: 147037345
Test: use voice input with Gboard 9.1.4 during a simulated RTT call.
Change-Id: Ib32ec25e962833eddd0320742e177e3c1e0e5c05
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