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
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>
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
The V5 HAL is identical to V4 for now.
Difference will be added in followup patches.
Bug: 118203066
Test: compile
Change-Id: I3db5d62cc2412766d8d0a78dab57455236a5019e
Signed-off-by: Kevin Rocard <krocard@google.com>
Merge the two versions and ifdef the few
parts still different.
Test: playback music, assistant
Change-Id: I750f5d18ba34236637c18a87e2daa54a7c446d91
Signed-off-by: Kevin Rocard <krocard@google.com>
The difference between the 2.0 and the 4.0 is very small
by design and most of the modification have been made in a
retro compatible way
The intent is to be able to merge the two implementation
but it could not be done in this patch due to time constrains.
Bug: 38184704
Test: compile
Change-Id: I4738928313b7fd1f6332c0f22bb802d4fba41d82
Merged-In: I4738928313b7fd1f6332c0f22bb802d4fba41d82
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
The difference between the 2.0 and the 4.0 is very small
by design and most of the modification have been made in a
retro compatible way
The intent is to be able to merge the two implementation
but it could not be done in this patch due to time constrains.
Bug: 38184704
Test: compile
Change-Id: I4738928313b7fd1f6332c0f22bb802d4fba41d82
Signed-off-by: Kevin Rocard <krocard@google.com>
audio.h and its dependencies (audio-effect.h, sound_trigger.h...)
used to be shared between system and vendor code.
This led to multiple problems:
1) Such sharing contradicts the Treble policy of
strict independence of framework and vendor code.
2) When audio.h was changed, every vendor needed to update
its code in the next release. This meant that audio*.h
headers were mostly changed in backward compatible manner.
Nevertheless, for P the HIDL interface and thus the audio.h
interface are changed in backward incompatible way.
(Some enum are becoming 64 bit long).
3) As the headers were common, some API used only by the framework
needed to be visible to the vendors (mostly enum values).
4) Treble policy is to support at least one previous HAL version
As a result the audio*.h headers are now duplicated,
one set for the framework, and one for the vendor.
Each set will evolve independently. After this split,
the framework-only APIs will be removed from the vendor headers
and vice versa.
The split is implements as such:
+ for system code
- NOT moving the libaudio_system_headers
Eg: system/audio.h and system/audio_effects/effect_equalizer.h
are still in system/media/audio
- the legacy audio HAL API that were in libhardware headers
are now in libaudiohal_legacy_headers
Eg: hardware/audio.h and hardware/audio_effect.h
are now in frameworks/av/media/libaudiohal/legacy/
+ for vendor code
- moving libaudio_system_headers and the legacy audio HAL API
that were in libhardware_headers in
android.hardware.audio.common.legacy@2.0
Note that those headers are now versioned, so migrating to a @4.0
HIDL HAL will mean changing the legacy dependency too.
Eg: system/audio.h, system/audio-effect.h, hardware/audio.h
are now in hardware/interfaces/audio/common/2.0/legacy
- the legacy audio effect HAL API that was in libaudioeffects
is now moved in android.hardware.audio.effect.legacy@2.0
Eg: audio_effects/effect*.h are now in
hardware/interfaces/audio/effect/2.0/legacy
- the legacy sound trigger HAL API that were in libhardware_headers
is now moved in android.hardware.soundtrigger.legacy@2.0
Eg: hardware/sound_trigger.h is now in
hardware/interfaces/audio/effect/2.0/legacy
libaudioutil being used by both system and vendor, had
to be renamed for system to libaudioutil_system.
Vendor libs that now depend on the audio.h of a specific
version and are not extensively referenced in non google code,
append @2.0 to their name.
Note that headers that are not expected to change in the 4.0 HAL are
left in all-versions folder to avoid duplication.
This is an implementation detail as the versioned libraries export
the all-versions headers.
Note that strict vendor-system separation is enforced by the
build-system. The system headers are not available for vendor
libs and vice-versa.
Note that this patch is split between numerous git repository (>10),
all the commits having the same Change-id for searchability.
Note that audio_policy.h is no longer exposed to vendors
as the legacy audio policy HAL API was never officially supported.
As a result the audiopolicy stub implementation has been removed.
Test: compile taimen-userdebug walleye-userdebug
sailfish-userdebug marlin-userdebug
gce_x86_phone-userdebug gce_x86_phone
full-eng aosp_arm aosp_x86-eng
Test: check that the emulator booted and played audio
Test: full QA on sailfish-userdebug and taimen-userdebug
Bug: 38184704
Change-Id: I950f4e0a55613d72e32eba31bd563cb5bafe2d1a
Signed-off-by: Kevin Rocard <krocard@google.com>
Both core and effect Hal now have one single point of entry.
This point of entry is their respective factories:
- DevicesFactoryHalInterface::create
- EffectsFactoryHalInterface::create
Each entry point looks for their respective services supported
version, starting from the highest (currently only 2.0) and
returning the subclass wrapping this version to the most recent audio.h
framework api.
Note that EffectBufferHalInterface were previously created from static
methods (mirror and allocate) which broke the single point of entry
requirement.
As a result, buffers have now to be created from the factory like the
other classes.
Note that the death handler also need to be its own library as it is
used by versioned code and is version independent.
Bug: 38184704
Test: compile
Change-Id: Iac9b1fda561bb486193d5b9e025a870f50cda530
Signed-off-by: Kevin Rocard <krocard@google.com>
This will allow for an easy review of the next patch that splits the
implementation to support multiple version.
Bug: 38184704
Test: compile
Change-Id: I3e8fc3b41aaf2dd8061bd2a3566810efa67c7f9f
Signed-off-by: Kevin Rocard <krocard@google.com>
See build/soong/README.md for more information about Soong.
USE_LEGACY_LOCAL_AUDIO_HAL isn't supported directly with this model, you
would need to change the defaults: [] line to point to the other
cc_defaults module.
Test: mmma frameworks/av/media/libaudiohal
Change-Id: I4244d085a4856232fd8230ce0663da2f3fb78a53
This client requires both HIDL client and server to be of the same
ABI version (e.g. 32-bit).
EffectHalHidl::process and EffectHalHidl::processReverse are stubs.
Some extra warnings are logged due to unimplemented functions
in the legacy HAL.
Bug: 30222631
Change-Id: Id074131dec6d6c4f1031695abcf3ea066e92a5af
Test: Play Music (play / EQ), YouTube, Loopback RTLT, Ok Google on N5X