Commit graph

19 commits

Author SHA1 Message Date
Eric Laurent
472c7ed05f Audio effect HAL: Add create effect API with device ID
Add the possibility to specify a target audio device when
creating an audio effect by passing its audio port handle
to createEffect API.

Add new create_effect_3_1() function to audio_effect_library_t
interface for interface version to 3.1.

Bug: 136294538
Test: make
Change-Id: Ia84eaf32f2a7c0cc73a43075c84902a395bafe58
2019-12-06 17:23:18 -08:00
Kevin Rocard
c6ec9486d8 Revert "Audio V4: Split system and vendor Audio.h"
This reverts commit fc9e212f01.

Reason for revert: Breaks multiple devices

Change-Id: I816671fd92246f85c97d00819858a74e36e2929d
2018-01-24 06:04:27 +00:00
Kevin Rocard
fc9e212f01 Audio V4: Split system and vendor Audio.h
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>
2018-01-20 21:39:40 -08:00
Mikhail Naganov
04b5b39a57 Move consts and structs used by framework to system/audio_effect.h
A lot of code (including clients of AudioFlinger) use constants
and structs from hardware/audio_effect.h for convenience, without
actually interacting with HAL. Thus these definitions are more
like the ones from system/audio.h and need to be moved to system/.

Test: make

Change-Id: I17a210fc7bde96380be42b50c60f10f2b1017e3a
2016-10-13 14:11:07 -07:00
Eric Laurent
4725741d0e audio effect: add flag for effects without actual processing
Add a flag for effect descriptor indicating that the effect does not
implement a process function. This tells the framework that no
latency or performance penalty comes with enabling this effect.
When this flag is set, the process function does not have to be implemented
by the effect implementation.

Bug: 31491112
Change-Id: I69e6959eb17e04266f4de3f2943c226e34868b1f
2016-09-15 11:52:22 -07:00
Glenn Kasten
6b6f19d0a8 Line length 100
Change-Id: Iaef5bcaec19a9e383432c8c8460bcdf1115f1072
2014-12-30 08:32:04 -08:00
jpadmana
45e6939f7d am 935799d6: Addition of EFFECT_CMD_OFFLOAD for effects offload
* commit '935799d63f0d654f350a640001077616572a4b63':
  Addition of EFFECT_CMD_OFFLOAD for effects offload
2013-08-29 14:09:31 -07:00
jpadmana
935799d63f Addition of EFFECT_CMD_OFFLOAD for effects offload
Added EFFECT_CMD_OFFLOAD command to audio effect control
interface. It is used by the framework to indicate if
the playback thread the effect is attached to is offloaded
of not.

Added effect flag EFFECT_FLAG_OFFLOAD_SUPPORTED indicating if
the effect implementation supports offloading to a DSP.

Change-Id: I26553576657d3aa9cd0cdcd5785c813b02f48136
Signed-off-by: jpadmana <jayashree.r.padmanaban@intel.com>
Signed-off-by: Eric Laurent <elaurent@google.com>
2013-08-28 17:52:03 -07:00
Glenn Kasten
6367c2ca3e Fix typo and remove executable bit on source code files
Change-Id: I0ac46bf80a4708d190c148f8b72bfcf4ea1168b1
2013-07-30 10:09:51 -07:00
Eric Laurent
099e61508e audio effects: fix link problem with NULL UUID
A special value for NULL effect UUID is declared as const
in audio_effect.h. This prevents several modules including
audio_effect.h to be linked together.

The fix consists in declaring the value as static const.

Change-Id: I86e74dc9da8eaed13a3ad44765abb9cd1e80f316
2013-02-07 11:35:29 -08:00
Marco Nelissen
b0acad33a7 Remove unused methods from fx library API
Change-Id: Ifb1d8b596a34f8413819279c46cb236fd7fb04f4
2012-10-25 11:03:22 -07:00
Eric Laurent
a07ef69482 audio effects: add audio source indication
Added a command to audio effect API to indicate the
audio source to audio pre processings.

Change-Id: Ia9d68bc095b8bc5d3cf847a406ec0a719a1c14ac
2012-08-31 18:42:35 -07:00
Glenn Kasten
a635449697 Use audio_channel_mask_t consistently
Change-Id: Ib832c0b707b1e0b82adf4ab3d4d18a2dc459d240
2012-06-25 10:45:43 -07:00
Jean-Michel Trivi
a9a5f5d57f Update comments to reflect audio channel mask type name change
Replace references to "audio_channels_t" by "audio_channel_mask_t"

Change-Id: If779a4c24e40c0fcdab8376b479bd20040d686da
2012-03-05 11:44:30 -08:00
Glenn Kasten
75a8b8f949 Effect UUID inputs passed by pointer are const
Change-Id: I3ef6d83ae539aef32f2a251660b2e2f9646eace5
2012-01-30 11:26:28 -08:00
Eric Laurent
66861e3740 audio effects: add auxiliary channel feature
Added API to query and configure effects supporting auxiliary channels.
An auxiliary channel contains an additional audio signal helping in the
processing of the main channel. An example is a dual mic noise suppressor
were the main channel contains the signal from the main mic and the aux channel
containss the signal from the sub mic.

Change-Id: Ibb7a19d7f492720ebad0be45f78f996e0beba272
2012-01-13 15:18:47 -08:00
Eric Laurent
922f9e6e5f audio effects: rename configure command
Renamed audio effect library interface command for audio format
configuration from EFFECT_CMD_CONFIGURE to EFFECT_CMD_SET_CONFIG.
This makes the naming more consistent with other exixsting commands
and allow adding new a command to get the configuration (EFFECT_CMD_GET_CONFIG).
Same change for reverse channel configuration renamed from
EFFECT_CMD_CONFIGURE_REVERSE to EFFECT_CMD_SET_CONFIG_REVERSE.

Change-Id: I1cc462aa50e58ceec900b3da9bd3873d2d098098
2011-12-19 16:23:10 -08:00
Eric Laurent
f3008aa707 Audio HAL: added interface for audio preprocessing
Change-Id: I032f6dd8f9ad11283a3f0a6721018dabfd12236d
2011-07-08 09:59:52 -07:00
Eric Laurent
fcc446f42c Modified audio effect API.
Moved and renamed media/EffectApi.h to hardware/audio_effect.h
Modified the effect library API to expose a library info structure
containing an interface functions table.
Also removed enums for audio channels, audio format and devices
from effect API and use values from system/audio.h instead.

Change-Id: I32fd752e449337410115121c1c60c699d95247c2
2011-05-27 15:18:05 -07:00