New stream type: AUDIO_STREAM_ASSISTANT
This is intended to be used by a virtual assistant like
Google Assistant, Bixby, etc.
The audio stream has own volume alias and the volume
does not change by volume changes of other streams.
Bug: 123745215
Test: make
Change-Id: I17ec0480cad4c3507a97454ccb832255adda9897
Merged-In: I17ec0480cad4c3507a97454ccb832255adda9897
Signed-off-by: Baekgyeong Kim <baek.kim@samsung.com>
AUDIO_SOURCE_DEFAULT is translated to AUDIO_SOURCE_MIC in
AudioPolicyManager. That means AUDIO_SOURCE_DEFAULT should behave
as same as AUDIO_SOURCE_MIC.
In this commit, argument for addInputEffects() is translated for
avoid different behavior between AUDIO_SOURCE_DEFAULT and
AUDIO_SOURCE_MIC.
This means same preprocessing effects are applied for both Sources.
Bug: 137898521
Test: Add pre-processing effect for AUDIO_SOURCE_MIC then check if
it works for AUDIO_SOURCE_DEFAULT as well
Change-Id: I3df1bcc7309dc535a721113cc4465b20733b4058
Merged-In: I3df1bcc7309dc535a721113cc4465b20733b4058
DIRECT and OFFLOAD Audio threads use the mixer when using SW effects.
This requires them to use the default sample rate.
Test: vendor specific, see bug
Bug: 147209612
Merged-In: I553fe43695d64160dd64808e18299699a4047225
Change-Id: I553fe43695d64160dd64808e18299699a4047225
If ENFORCED_AUDIBLE is set for a stream, it should output
to Speaker and not select output device(s) for VOICE_CALL.
Bug: 147209610
Change-Id: I9553efd677979351ed6f7191079da84dac2a7ed1
`realloc` doesn't deallocate `param` if it fails. Since the loop ends in
a `free`, we just need to avoid overwriting `param` until after the
check.
Caught by the static analyzer:
frameworks/av/services/audioflinger/Effects.cpp:1868:9: warning:
Potential leak of memory pointed to by 'param'
[clang-analyzer-unix.Malloc]
Bug: None
Test: TreeHugger
Change-Id: I58fe4319927b3ea99989e1fb1dc2dabe89c72ef8
For the formats compatible with IEC61937 encapsulation, assume
that the record thread input from MSD is IEC61937 framed (for
proportional buffer sizing). Add the
AUDIO_OUTPUT_FLAG_IEC958_NONAUDIO flag so downstream HAL can
distinguish between raw and IEC61937 framed streams.
Test: manual test on BCM TV device
Change-Id: I8f09f936ccce63985df4ad00433299b063769419
As we described "libavservices_minijail" in Andorid.bp, we don't need
to keep "libavservices_minijail_vendor" as a workaround, but may make
"libavservices_minijail" vendor_available and remove
"libavservices_minijail_vendor".
We will keep "libavservices_minijail_vendor" until we replace
"libavservices_minijail_vendor" to "libavservices_minijail" from all
vendor modules.
"libavservices_minijail_vendor" will be removed once the vendor
modules are cleaned up.
Bug: 146313710
Bug: 145580164
Test: build and boot
Change-Id: Iffb16c10ddc93e645d5839ac8aa320353e46d224
This patch avoids pseudo LCM buffer calculation oversized buffer
causing posix_memalign error in cases of large play/record frame
counts (such as 24596) for PassthruPatchRecord patches.
Test: MSD to Primary audio patch with play/record frame counts
of 24596.
Change-Id: I3a2f3795330e99984388b01033d8e7c1685d01f2
Functions called by RequestThread::threadLoop must not hold
mInterfaceMutex since the following deadlock scenario may occur:
T1: disconnect() -> holds mInterfaceMutex and waits for RequestThread to
exit
T2: RequestThread::threadLoop()->reconfigureCamera (or any other function) that waits on
mInterfaceMutex
leading to a deadlock
Bug: 143513518
Test: GCA
Test: CTS
Change-Id: I4bd856e5263934a54cd7087a01d35cfe10936196
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
Audio policy engine supports receiving a preferred device to use
for a given strategy (Engine superclass). Use of the preferred
device intervenes at the level of the each engine implementation,
here in the default engine in getDevicesForProductStrategy() method
so it is saved in the routing cache, and respects existing routing
priorities.
Refactor the loops for call and output rerouting into a new
updateCallAndOutputRouting() method.
Bug: 144440677
Test: atest AudioServiceHostTest#testPreferredDeviceRouting
Change-Id: Ic4c690e1b0d8020c4335979e40e14e6df5887879
Merged-In: Ic4c690e1b0d8020c4335979e40e14e6df5887879
The added files were using DOS EOL symbols (CRLF) instead
of UNIX (LF only). Removed CR symbols.
Bug: 135749685
Test: m
Change-Id: Iba36aaef0ea8d9bcb3bd8e2d476a7b0588bd70ee
When connecting multiple audio devices,
Media and Sonification sounds comes out of the last connected device,
not a high-priority device.
Test: play music
Test: connect wired earphone // sound : wired earphone
Test: connect usb earphone // sound : usb earphone, not the wired earphone(high-priority)
Test: connect bluetooth headset // sound : bluetooth headset
Test: disconnect bluetooth headset // sound : usb earphone, not the wired earphone(high-priority)
Bug: 135749685
Change-Id: I579a04a04c97cc846b88e54fa83cdf3dad0b5cee
Signed-off-by: Baekgyeong Kim <baek.kim@samsung.com>
Add request to create tombstones of audio HAL servers before restarting
audioserver process when the watchdog triggers.
Add audio device factory HAL interface API to retrieve HAL process pids when
possible (on debug builds).
Add AudioFlinger service API to set audio HAL process pids from
JAVA AudioService.
Bug: 141528385
Test: Force watchdog and verify tombstone creation
Change-Id: I68c1e8fb4db23e5952ad0c93d7d0b9d121b8ec18
Merged-In: I68c1e8fb4db23e5952ad0c93d7d0b9d121b8ec18
* changes:
Refactor for audio device type in conversion.
Use AudioDeviceTypeAddr when setting device for effects.
Add constructor with type and address for DeviceDescriptor.
Separate SET_DEVICE and SET_INPUT_DEVICE command in effects as it can
be multiple devices for output case, but only single device for input
case.
Use AudioDeviceTypeAddr instead of just audio device type as address
can be useful to identify audio device if there are multiple devices
with the same device type connected.
Bug: 135621476
Test: atest AudioEffectTest BassBoostTest DynamicsProcessingTest
Test: atest EqualizerTest VirtualizerTest VisualizerTest
Change-Id: Ie9df88e3338730392abbc3efae5daadc70398ff7
Merged-In: Ie9df88e3338730392abbc3efae5daadc70398ff7
Type and address are used to distinguish a device, it makes more
sense to set device type and address when creating a DeviceDescriptor.
Bug: 135621476
Test: make, atest audiopolicy_tests
Change-Id: I5f9063bd8c756ace77c162e86a8c0dd685da79b4
Merged-In: I5f9063bd8c756ace77c162e86a8c0dd685da79b4
Before, in Android 10, this would have been a small leak because
unlinkToDeath is not called, but now, objects are automatically
unlinked. However, this presents a problem since you must hold onto
a binder in order to linkToDeath. This now holds onto the binder
and is relying on the automatic-unlinkToDeath behavior.
Fixes: 145675653
Test: atest CtsNativeMediaAAudioTestCases
arm64-v8a CtsNativeMediaAAudioTestCases: Passed: 122, Failed: 0, Ignored: 0, Assumption Failed: 0
Test: after using app and killing which uses AAudio MMAP stream,
dumpsys output for media.aaudio is cleaned up:
------------ AAudio Service ------------
Stream Handles:
AAudioClientTracker:
AAudioEndpointManager:
Exclusive MMAP Endpoints: 0
ExclusiveSearchCount: 3
ExclusiveFoundCount: 0
ExclusiveOpenCount: 1
ExclusiveCloseCount: 1
Shared Endpoints: 0
SharedSearchCount: 1
SharedFoundCount: 0
SharedOpenCount: 0
SharedCloseCount: 0
Change-Id: I2ef141320dc3ef0135fb7ef002d85377d06a75c2
As audio device type must not be used as a bit mask, there is a
requirement to refactor the code in audio flinger. This CL includes:
1. Use DeviceTypeSet for recording output devices in Threads. The input
and output device types in Threads will only be updated when creating
an audio patch.
2. Use helper functions in audio flinger for checking whether an audio
device type is a certain category.
3. Use DeviceDescriptorBaseVector as vector of DeviceDescriptorBase.
DeviceDescriptorBaseVector will be used in RecordThread to record output
devices, which will be used in audio effect.
4. Do not use set parameters when communicating output devices to
RecordThread. Instead, adding a new event in Thread to update output
devices directly.
Bug: 135621476
Test: atest AudioTrackTest AudioRecordTest AudioPlaybackCaptureTest
Test: atest AudioHostTest AudioServiceHostTest RoutingTest
Test: atest AudioEffectTest BassBoostTest DynamicsProcessingTest
Test: atest AAudioTests
Test: audio smoke test, run OboeTester
Change-Id: I87f3e59fd01b0b100232d61a9abbc471c61110c4
Merged-In: I87f3e59fd01b0b100232d61a9abbc471c61110c4
Refactor interface between audio flinger and audio policy. Use device
descriptor instead of audio device type and address. DeviceDescriptor
can contain more information that may be useful when opening an output
stream.
In audio policy, if multiple audio devices are passed in when opening
an output stream, one device is extracted using the same strategy as
when selecting a device for volume application. When starting source,
audio policy manager will call audio flinger to create audio patch. In
that case, multiple devices will still be patched to the output stream.
Test: atest AudioTrackTest AudioPlaybackCaptureTest
Test: atest audiopolicy_tests, audio smoke test
Change-Id: I46dc2da621614f8716c6c73cf807fe7d2d672cda
Merged-In: I46dc2da621614f8716c6c73cf807fe7d2d672cda
This change mainly aims at refactoring libmediahelper. Libmediahelper
doesn't need to be stored in media folder. In that case, move
libmediahelper related file to a new folder. In the meantime, move
AudioParameter.h from libaudioclient to libmediahelper. There is no
need to keep AudioParameter.h in libaudioclient while AudioParameter.cpp
is in libmediahelper.
Test: make
Bug: 135621476
Change-Id: Icce6615b7e3a68be8b7492f2a91922ab04464ca2
Merged-In: Icce6615b7e3a68be8b7492f2a91922ab04464ca2
AudioDeviceTypeAddr is moved to libaudiofoundation. In that case, it can
be used in DeviceDescriptorBase.
Bug: 135621476
Test: make, atest audiofoundation_parcelable_test
Test: play music, record audio
Change-Id: Ia66dce29c8fb9d25c40598d9bada6eb295313884
Merged-In: Ia66dce29c8fb9d25c40598d9bada6eb295313884
Move AudioDeviceTypeAddr from AudioPolicy.h to libaudiofoundation.
AudioDeviceTypeAddr is a class that contains audio device type and
address. It can be used not only in audio policy, but also other places.
Bug: 135621476
Test: make, atest AudioHostTest
Change-Id: Ib257859891c647c07f22771012efdada438a4ff5
Merged-In: Ib257859891c647c07f22771012efdada438a4ff5
* changes:
Add parcelable test for classes in libaudiofoundation.
Add export header lib headers to libaudiofoundation_headers.
Add equals functions for classes in libaudiofoundation.
Make audio stuff parcelable.
Clear up bit mask usage in audio policy.
Make AudioGain parcelable.
This change includes:
1. Use DeviceTypeSet to represent a combination of audio device types.
2. Add helper functions for DeviceTypeSet
3. Stop using audio device type as a bit mask in DeviceVector
Test: atest AudioTrackTest AudioRecordTest AudioPlaybackCaptureTest
Test: atest AudioHostTest AudioServiceHostTest audiopolicy_tests
Test: audio smoke test
Change-Id: If80513b689848bcab6094f70a572f053856afa82
Merged-In: If80513b689848bcab6094f70a572f053856afa82
First test for audio health check. The test checks if all declared
devices found by checking if the audio device types of attached devices
can be seen by audio policy.
Bug: 141580284
Test: atest audio_health_tests audiopolicy_tests
Change-Id: I0374f382eaab7b36ab623b11a59e0634565f2187
Merged-In: I0374f382eaab7b36ab623b11a59e0634565f2187
Enable static check for audio arrays so that it can be earlier to catch
if there is any error within the audio arrays.
Bug: 135621476
Test: make
Change-Id: I598311e0853ca77dff83fb97974e534adb238567
Merged-In: I598311e0853ca77dff83fb97974e534adb238567
Bug: 135621476
Test: atest AudioHostTest, AudioPlaybackCaptureTest
Test: atest AudioServiceHostTest, audiopolicy_tests
Test: listen to music, make phone call with BT device
Test: test play music via Android Auto emulator
Change-Id: I154555579b0ebb8b020d00e9c05c8b9f79a08db4
Merged-In: I154555579b0ebb8b020d00e9c05c8b9f79a08db4
This CL added test audio device type helper functions, which expect a
single audio device type as a parameter.
Bug: 135621476
Test: atest systemaudio_tests
Change-Id: I5dac8eab93ab2251eea62b3b8d797f504bf538e4
Merged-In: I5dac8eab93ab2251eea62b3b8d797f504bf538e4
* changes:
Create DeviceDescriptorBase.
Copy DeviceDescriptor to libaudiofoundation.
Rename AudioPort and PolicyAudioPort accordingly.
Make audio port in policy not derive from audio port base
Rename AudioProfileVector.h as AudioProfileVectorHelper.h
Leave AudioProfileVector only in libaudiofoundation.
DeviceDescriptorBase is a class that derives from AudioPort and
AudioPortConfig and contains extensions to describe a audio port that is
a hardware device. DeviceDescriptor derives from DeviceDescriptorBase
and contains policy related stuff.
Test: atest AudioTrackTest AudioRecordTest AudioManagerTest
Test: atest AudioPlaybackCaptureTest AudioHostTest audiopolicy_tests
Test: audio smoke test
Bug: 135621476
Change-Id: I70ebe6bca70a77bbfc8f6855de3fd4c4ffa1c487
Merged-In: I70ebe6bca70a77bbfc8f6855de3fd4c4ffa1c487