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>
* Remove unused local variable or suppress the warning.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I4d7b4f2e9e7e6c60d8bfc209f47e6f1d33720165
Test: builds with BOARD_VNDK_VERSION := current
Test: (sanity) Boots and works on internal marlin.
Bug: 33241851
Bug: 29915755
Change-Id: Ic355174a67860afa13377bc9d8f0a140f59ec34e
The commneted code is the only place in AOSP that still reference
BOARD_HAVE_BLUETOOTH and BOARD_USES_GENERIC_AUDIO. Delete it
to make things cleaner.
Test: Build
Change-Id: I37e3135bf2db2c6d46eb59d5a0de49d02c1a036d
Signed-off-by: Bin Chen <bin.chen@linaro.org>
The headers for these libraries include headers from libmedia,
which means they need access to the full libmedia include path.
Bug: 27804373
Test: These libraries compile when libmedia's compilation path changes
slightly.
Change-Id: I201c82c85a1513b4165c7565dfac4f4371d6fe5c
Fix some (note the fun infinite recursion bug from the dawn of time,
apparently no one has called that function), silence those that are
style choices.
Bug: http://b/26936282
Change-Id: I99fa342abf9d134fb729ed8d906e60c011120e89
Remove a systemTime() function from power/power.c that
doesn't appear to be called anywhere, and make several
audio/ files explicitly include utils/Timers.h for the
libutils version of systemTime(). (They appear to have been
transitively getting it via utils/threads.h's include of
utils/Condition.h.)
Change-Id: I432bb1cf1100f5829df307a146076acf035a0bdc
New stream types have been added, so make sure that
legacy implementation uses legacy stream definitions
Bug: 18067208
Change-Id: I8042ebe9ac3e7eda380b8c91650f2ac16b44bc34
Pass device address (and audio source for inputs) to
open_output_stream() and open_input_stream() audio HAL functions.
Bug: 14815883.
Change-Id: Ib1c3e98518733fa5eab54cbca4220e388d3f6211
Fixes a race condition whereby two requests attempt to change the audio stream
(and interrupt each other). For example, a user space app makes a call through
the audio API and before completion, a kernel function such as jack removal is
detected and is serviced. In this case, you have a nullified audio route that
needs to be re-routed.
In order to know a routing update is needed, a boolean member mForceRouting
has been introduced to enforce routing for the next attempt to set audio output
with a non-null device.
Change-Id: Ia0aa2f27fe63c39f0980dec2e1e79dbc26b81e56
Author: Vincent Becker <vincentx.becker@intel.com>
Signed-off-by: Vincent Becker <vincentx.becker@intel.com>
Signed-off-by: Zhi Jin <zhi.jin@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Robert Beatty <robert.m.beatty@intel.com>
AudioService now indicates in and out device connection
separately in case of combined devices like wired headset
or BT SCO headset.
Change-Id: Id20e02bb351cc732ceddccf597742ced049671a8
The existing openOutputStream API did not allow passing stream flags even
though its audio hardware interface's open_output_stream counterpart does take
a "flags" argument. This means that, when the audio hw_module is implemented
using libhardware_legacy, the output flag was lost.
This commit adds an API in libhardware_legacy's audio module, allowing to pass
the flag, and updates the default wrapper in order to call this new API instead
of the old version that missed the flag.
Change-Id: I20c102d32b489f87fabbd7d02aa0b28fae13948b
Signed-off-by: David Wagner <david.wagner@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Fix a few 64-bit warnings and set -Wno-unused-parameter, which makes
the directory warnings-clean on 32-bit and 64-bit.
Remove LOCAL_32_BIT_ONLY.
Change-Id: I688b31683f1a6598419866d9b7b6bc27a7056f4a
This commit adds AUDIO_DEVICE_IN_USB_DEVICE to sDeviceNameToEnumTable[],
It had to be added here, when it was defined in system/core/include/system/audio.h
AudioPolicyManagerBase::loadHwModule() fails to parse device type of
AUDIO_DEVICE_IN_USB_DEVICE in audio_policy.conf.
By applying this commit, AUDIO_DEVICE_IN_USB_DEVICE can be used for
audio policy customization.
Change-Id: I0165956334d7105129dca4c746372dbca0d9e324
When a new output stream is opened upon device connection,
always send mandatory configuration parameters
(A2DP device address, ALSA card and device number etc...)
immediately after opening the output.
Change-Id: Id1fc1d99d3b30e2ef907dcb231a6a9e70560ecae