* 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
DevicesFactoryHalHidl registers a notification callback
with a service manager to get notified about registration
of new HAL services.
The specific code for the MSD HAL has been removed,
this HAL service is now handled using the added generic
mechanism.
Bug: 149854039
Test: make
Change-Id: I2f7f83dec11ac2390f674afd9e4451ef46dde04e
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
Remove static linking to libaudiohal@N.0.so libraries.
Instead, use HIDL IServiceManager to figure out the actual
version used by the device and load the appropriate library
dynamically.
Bug: 142480271
Bug: 148118201
Test: make and check audio on the device
Change-Id: I8e6eb9eeef3335da516d983d5d4f0f1b128ef0a6
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
Add the possibility to specify a target audio device when
creating an audio effect by passing its audio port handle
to createEffect API.
Bug: 136294538
Test: make
Change-Id: I32a6400278496653b4204175cd8a16d81f9724a0
Merged-In: I32a6400278496653b4204175cd8a16d81f9724a0
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
Use new method IDevice::updateAudioPatch when the patch handle
passed to DeviceHalHidl::createAudioPatch is not "NONE" instead
of releasing and re-creating the patch.
Bug: 79248321
Test: audio "smoke" test on coral
Change-Id: Ifa37d828eb7817105d14d6451ed6121e9d6bb48f
This flag used to be framework only. To simplify constants
management it's better to have it defined at all layers.
Currently it is only used for MSD module but potentially
can be used for HDMI inputs.
Bug: 141273649
Test: use AOSP MSD on Pixel
atest VtsHalAudioV6_0TargetTest
Change-Id: I19f6fdb2772878c93e41b635dc6adae83a9fecb0
Add the possibility to specify a target audio device when
creating an audio effect by passing its audio port handle
to createEffect API.
Bug: 136294538
Test: make
Change-Id: I32a6400278496653b4204175cd8a16d81f9724a0
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
As audio device type can not be used as bit mask any more, refactoring
audio device type usages in conversion from/to HAL. Use a set of audio
device types instead of bit mask.
Bug: 135621476
Test: atest AudioPlaybackCapture
Test: play and capture audio with BT and usb headset
Change-Id: If4a5c5002d6d4ccb7aaf823111b371d417784b19
Merged-In: If4a5c5002d6d4ccb7aaf823111b371d417784b19
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
As audio device type can not be used as bit mask any more, refactoring
audio device type usages in conversion from/to HAL. Use a set of audio
device types instead of bit mask.
Bug: 135621476
Test: atest AudioPlaybackCapture
Test: play and capture audio with BT and usb headset
Change-Id: If4a5c5002d6d4ccb7aaf823111b371d417784b19
Call IDevice.close when the client doesn't need the device.
Bug: 114451103
Test: adb shell stop
Change-Id: I486db716be59cd4ea0f6d75d0e366f802ee9b06d
Merged-In: I486db716be59cd4ea0f6d75d0e366f802ee9b06d
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
Test: push V6 to device and check audio works fine
Bug: 134940862
Change-Id: Ied5aeccdf8f1e9a085ed9cac9d696271b7a1bb63
Merged-In: Ied5aeccdf8f1e9a085ed9cac9d696271b7a1bb63
Signed-off-by: Kevin Rocard <krocard@google.com>
Bug: 134940862
Test: run on target
Change-Id: Ia884d0e926569d983ba12952817d2cecc8d8d34f
Merged-In: Ia884d0e926569d983ba12952817d2cecc8d8d34f
Signed-off-by: Kevin Rocard <krocard@google.com>
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
Test: push V6 to device and check audio works fine
Bug: 134940862
Change-Id: Ied5aeccdf8f1e9a085ed9cac9d696271b7a1bb63
Signed-off-by: Kevin Rocard <krocard@google.com>
Since these were combined into libhidlbase.
Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: I6cc85a91afb603e31b85090917f9f3b59d82a4d1
Move ExtendedAudioBufferProvider.h to libaudioclient. This is
a more appropriate location because EABP extends AudioBufferProvider.
Move SingleStateQueue.h to libnbaio_mono. This is a more appropriate
location because SSQ is a non-blocking queue.
This allows to remove the dependency of libnbaio on libmedia
which is a good thing because libnbaio provides more low-level
abstractions than libmedia.
Also, replace a dependency of libnbaio on libbinder with
a dependency on libaudiohal header library.
Test: make
Change-Id: Ie48b523790cd8230695ec2e4710e50981b616289
Add workaround for missing patch handle in HIDL
interface createAudioPatch() method signature.
The legacy HAL implementation has the convention of releasing
previous audio patch when a valid patch handle is passed.
The framework relies on this optimization and does not release previous
patch explicitly when just updating the sinks of an existing patch.
Bug: 117744819
Test: repro steps in bug
Change-Id: I93e19e4b16b0beac31438cffd0553f5db3117a1e
The implementation uses IBase::debug() method which can write
debugging info into the provided file descriptor (same model
as used for devices and streams).
Bug: 69939533
Test: adb shell dumpsys media.audio_flinger
Change-Id: I02a74b51977d105edf6f7e624ea26f866c965708
get/setMasterVolume are defined on IDevice, but DeviceHalHidl
was restricting calls to it only for IPrimaryDevice. This seems
like a bug lingering from the initial implementation of the shim.
Test: make
Change-Id: Ia028959690a5ab71aade14d12d5c12488dc83e41
Using 'exit' from an RPC threadpool thread is not safe, as 'exit'
runs atexit handlers that destroy global objects. This can interfere
with code still running on other threads.
'_exit' does not run atexit handlers, just terminates the process.
Bug: 116665972
Test: kill android.hardware.audio@2.0-service, check logcat
Change-Id: I5391a659e359e0ca5bba580f1c51dea5df3ea562
(cherry picked from commit 5beb481006)
(cherry picked from commit 06c5d53533)
When opening an input stream for a software patch, pass in
the downstream destination device info. This helps the intermediate
module to set up any device-specific processing.
Note that the intermediate module must implement Audio HAL V5.0
in order to be able to receive this information. It's not available
on the legacy audio HAL API either.
Bug: 120859615
Test: make
Change-Id: I542a47d2c299fe19f576d5f5c2b237cc00ae5b93
In Audio HAL V5.0 SinkMetadata receives a new member: optional
DeviceAddress. Use per field initialization to leave
the safe_union in an uninitialized state.
Bug: 120859615
Test: make
Change-Id: I358b9abbcb0690aebb2c658a72adb287ceec22b5
Use namespace import in ConversionHelperHidl.cpp.
Test: try moving types between audio/types.hal and common/types.hal.
Change-Id: I7ffab98d0e3b8bbc82ab94b8d99b7d05e224e1e4
Using 'exit' from an RPC threadpool thread is not safe, as 'exit'
runs atexit handlers that destroy global objects. This can interfere
with code still running on other threads.
'_exit' does not run atexit handlers, just terminates the process.
Bug: 116665972
Test: kill android.hardware.audio@2.0-service, check logcat
Change-Id: I5391a659e359e0ca5bba580f1c51dea5df3ea562