Commit graph

242 commits

Author SHA1 Message Date
Mikhail Naganov
8613f809fa audio: Parametrize core VTS tests
Parametrize tests to accept IDevicesFactory instance name
and IDevice instance name. For audio HAL versions 2..5
the factory instance name is taken from the VTS environment,
and the device is always "primary". For the next versions
the factories are discovered by the test, and the devices
are taken from the audio policy configuration
(to be implemented, see added FIXME comments).

Split the Environment class into two versions: for HAL 2..5
and for next versions. They use different base class.

Move device factories and device caching into dedicated
classes DevicesFactoryManager and DeviceManager. They deal
with instance caching and proper release of server resources.

Bug: 141847510
Bug: 141989952
Test: atest VtsHalAudioV5_0TargetTest
      atest VtsHalAudioV6_0TargetTest
Change-Id: I92c44e0c3f900164dded7e9c4bfc642ca2c335db
2019-10-24 16:56:33 -07:00
Mikhail Naganov
d306cccd0b audio: Extract utility functions
Move common code out of the test source.

Test: atest VtsHalAudioV5_0TargetTest
Change-Id: I86cf399029a0a5f3f08c7e82713ae62df03dee3f
2019-10-24 09:09:09 -07:00
Kevin Rocard
0349c2f03d Introduce Audio V6
Generate with ./newHal.sh 5.0

+ some typo fix in the .hal
+ some clang-tidy run

This new HAL is an exact copy of the V5.
It will be modified in following patches while R is developed.

Test: push V6 to device and check audio works fine
Bug: 134940862
Change-Id: Ic25d30175032e76e0d3208fb876451de9ae6b7b4
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-10-08 11:07:27 +01:00
Kevin Rocard
5bc18d6538 Script to generate new audio HAL version
Mostly automated script to generate a new Audio HAL major version.

Test: push V6 to device and check audio works fine
Bug: 134940862
Change-Id: I0da621e747eb48e75901a2a10cfc224f33864c3b
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-10-08 11:07:27 +01:00
Kevin Rocard
c69e3e997f Change some formatting for better script parsing
Test: Compile
Bug: 134940862
Change-Id: Ibbafdcaa6e0bfa8fd2b80f4a6c9ac6ac95058f93
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-10-07 17:58:15 +01:00
Kevin Rocard
de7d06babb Convert audio HAL service mk to bp and rename the service
The service supports multiple versions and its name should not be
version dependant.

For backward compatibility, keep the target name
android.hardware.audio@2.0-service (32bit only), existing
PRODUCT_PACKAGES do not have to be updated.
New products should depend on android.hardware.audio.service:32.

Additionally migrate to Android.bp, dropping support for
AUDIOSERVER_MULTILIB. Previously the HAL service architecture (32 vs 64)
would be the same as the audio server. This in not wanted as all android
audio HAL are 32 bits.

Bug: 121208203
Test: # Compare following commands before and after patch:
      find $ANDROID_PRODUCT_OUT/vendor -name 'android.hardware.audio*'|xargs file
            adb shell reboot # check device boots to UI and
      # check the HAL restarts after the audioserver is killed
      adb shell ps |grep audio; adb shell killall audioserver; adb shell ps
Change-Id: I25f41735175a6687a051ca1e5a7fee670eb8115e
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-10-07 16:34:26 +01:00
Steven Moreland
38c46d0b98 Merge "Remove libhwbinder/libhidltransport deps" am: 6b62c58a9a am: 8c22c3862f am: 6684ee8c36
am: 9a5ffa3196

Change-Id: I3a80895d10767fe68e90a907312a83ded976cbcc
2019-09-06 16:06:13 -07:00
Steven Moreland
b3a4d3832e Remove libhwbinder/libhidltransport deps
Since these were combined into libhidlbase.

Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: I075670b64eebbbbd6a6ae0e84ad51bf1c6f5ba36
2019-09-06 01:07:02 +00:00
Daniel Norman
5882424812 Merge "Replaces 'oneshot' and 'interface' with 'onrestart restart audioserver'." am: 5bb99e24ad am: 3a6c4696bd am: 1fd3dbe764 am: e7342a0d84
am: a32fd4493c

Change-Id: Id238bef3dd78181dd04b5d8a50b450e280a3a653
2019-07-31 16:24:50 -07:00
Daniel Norman
3a6c4696bd Merge "Replaces 'oneshot' and 'interface' with 'onrestart restart audioserver'."
am: 5bb99e24ad

Change-Id: I38708e1b102546d6024a1f80d2c7d7a7e1c18ee9
2019-07-31 15:21:08 -07:00
Daniel Norman
fb4aadf622 Replaces 'oneshot' and 'interface' with 'onrestart restart audioserver'.
This default service should still restart on audioserver restart because
audioserver uses 'onrestart restart vendor.audio-hal-2-0' for restarts.

Bug: 138114550
Bug: 80227481
Test: for i in {0..100}; do \
      adb shell 'ps|grep audio;killall audioserver;ps|grep audio' \
      && sleep 2; \
      done
Test: Ran steps mentioned in http://b/80227481#comment1, device did not
get stuck in boot animation. Killing either audioserver or audio-hal
caused both to restart (just once) and the device booted correctly after
the sleep finished.
Change-Id: Ice128b51f79d3a9de22a719e6d897c8dca915e28
2019-07-31 21:08:02 +00:00
Kevin Rocard
5261dce877 Audio service: Refactor register interface
Remove all per interface version boilerplate.
Adding a new version now requires only including the file
and adding the version name to the list.

Bug: 134940862
Test: adb shell lshal
Change-Id: Ib6b99d7a2c2079d914970fbe804aaf3c78c143ce
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-07-01 17:41:58 -07:00
Kevin Rocard
db834f4e76 Merge "Audio: Document channel order convention" into qt-dev am: d05b62368b
am: b47e60a90d

Change-Id: Ia206fae0f489ae12cd84a86c5f1e7ae066fffd29
2019-05-28 21:12:13 -07:00
Kevin Rocard
d123e015b2 Merge "Audio: Document channel order convention" into qt-dev
am: d05b62368b

Change-Id: Ic63ff46c6461aa2bec27c4ca1d562a348d3d0f53
2019-05-28 21:07:12 -07:00
Kevin Rocard
64a35d0d16 Audio: Document channel order convention
This patch restores the documentation on the channel order convention
that was present in the Audio HAL 2.0 but remove by mistake in 4.0.

This is a vendor feedback.

Test: mm
Bug: 133453897
Change-Id: I8eabd8883612d39ced21481fc44661b0808754bb
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-05-29 00:34:38 +00:00
Kevin Rocard
c07520cf65 Merge "Validate HAL mic input" into qt-dev am: 91309a04c8
am: fef2098b48

Change-Id: Ib1fc4bbbcc43667a3555fe0a9afedf91260b160b
2019-05-20 22:05:45 -07:00
Kevin Rocard
d1e4213133 Merge "Validate HAL mic input" into qt-dev
am: 91309a04c8

Change-Id: I687415ab199765c83c130d81e948f6051c3a5e9c
2019-05-20 21:23:07 -07:00
Kevin Rocard
dbb7d0d304 Validate HAL mic input
Input value were not checked, resulting in out of range input accepted.
This was checked by test but never implemented in the default HAL.

Bug: 133105753
Test: atest VtsHalAudioV5_0Target
Change-Id: Ie6dae638b60daff6923668dc9637067f29e48b21
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-05-21 00:27:09 +00:00
Steven Moreland
6d494b2346 Merge "Update hidl makefiles for bpfmt" am: ff0bd741ca
am: 96f40f7b02

Change-Id: Idbf030e4993067bdb8181321bca2de00c9b6f7ef
2019-04-18 14:34:45 -07:00
Steven Moreland
1ae4615d9f Update hidl makefiles for bpfmt
hidl-generated makefiles are now generated such that bpfmt(file) == file.

Bug: 67417008
Test: enable bpfmt hook
Change-Id: I1f69d292bc23a7cc293a66110cb02d597e1019ad
2019-04-17 09:38:50 -07:00
Eric Laurent
872ace84c6 audio HAL: restore HOTWORD audio source
HOTWORD audio source was removed from HAL V4.0 by mistake.

Bug: 129001649
Test: make
Change-Id: I664eb6ca2a6c30bc6f48a752cb7300aac6c4294b
2019-03-20 15:58:38 -07:00
Aniket Kumar Lata
aa5d491075 audio: Add APTX_TWSP audio format
Add APTX_TWSP audio format support.

Bug: 111812273
Bug: 128825638
Test: make
Change-Id: Id8ba35d8aeea3d0c02be6c63ed3d05b039b0bb4f
2019-03-19 10:39:56 -07:00
Mikhail Naganov
ce6f1cf448 audio: Fix and enhance channel mask enums
Add AUDIO_CHANNEL_INDEX_MASK_{9..24}

Fix channel order for AUDIO_CHANNEL_OUT_3POINT{0,1}POINT2

Bug: 126455009
Test: make
Change-Id: I36a89c9903ad1702c5c0bdb0632c3f3234bb75d7
2019-03-08 16:31:28 -08:00
Steven Moreland
7f4e21adda Merge "Update makefies: no 'types'" am: 4ee5ec1469 am: bab622f6a6
am: 7224bc9bcf

Change-Id: I434939e0770afa436c532a945542fce30a71ef7d
2019-03-04 16:05:59 -08:00
Steven Moreland
a878aee9ab Update makefies: no 'types'
Bug: 123976090
Test: N/A
Change-Id: I30fb04c81889b62775e1b764b965fdb0f893de17
2019-03-04 11:27:17 -08:00
Kevin Rocard
c3a712bef4 Audio HAL: add address documentation am: 3cdb31ee57 am: 6420797904
am: 7e2aa9b955

Change-Id: I205bd30ffa969b090d507ea5791b0413bc0e4ff4
2019-02-26 09:18:58 -08:00
Kevin Rocard
3cdb31ee57 Audio HAL: add address documentation
Test: compile
Change-Id: I108d512cf3381c5b87c76d152252050d309e46a6
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-02-26 09:00:23 -08:00
Eric Laurent
955b94e1d5 [Master port]audio: add new audio formats
This patch ports a change to the HAL interfaces done in master in
order to have the same Audio common HAL interface in both AOSP and master.
This is needed as the Bluetooth HAL uses the audio common HAL and needs
to be frozen in the same state in both AOSP and MASTER.

Add audio format for LHDC Bluetooth codec.
Also add missing audio sources and devices in xsd.

Bug: 124247199
Bug: 120395342
Test: make
Change-Id: Ib55c7d351074d8ef75747bcb1195e1ce15ed8b20
Merged-In: Ib55c7d351074d8ef75747bcb1195e1ce15ed8b20
2019-02-15 01:52:02 +00:00
Eric Laurent
36274db4e5 [Master port]audio: add new audio formats
This patch ports a change to the HAL interfaces done in master in
order to have the same Audio common HAL interface in both AOSP and master.
This is needed as the Bluetooth HAL uses the audio common HAL and needs
to be frozen in the same state in both AOSP and MASTER.

Add AAC_LATM*, CELT and APTX_ADAPTIVE to the list
of audio formats.

Bug: 124247199
Bug: 123082414
Test: make
Change-Id: Id75e1f5016929d5a67e777774aaa892df6f91e78
Merged-In: Id75e1f5016929d5a67e777774aaa892df6f91e78
2019-02-15 01:51:45 +00:00
Eric Laurent
c32a993999 [Master port]Add new audio sources for audio capture
This patch ports a change to the HAL interfaces done in master in
order to have the same Audio common HAL interface in both AOSP and master.
This is needed as the Bluetooth HAL uses the audio common HAL and needs
to be frozen in the same state in both AOSP and MASTER.

This commit adds the following audio capture sources:
- AUDIO_SOURCE_VOICE_PERFORMANCE: for real time live performances like Karaoke.
- AUDIO_SOURCE_ECHO_REFERENCE: for capturing the reference signal to suppress by an echo
canceller. Protected by privileged permission CAPTURE_AUDIO_OUTPUT.

Also added device AUDIO_DEVICE_IN_ECHO_REFERENCE selected when the requested
capture source is AUDIO_SOURCE_ECHO_REFERENCE.

Bug: 124247199
Bug: 118203066
Test: CTS tests for audio capture
Change-Id: Ia93550b278733ae9cc5cda731b014421002fde35
Merged-In: Ia93550b278733ae9cc5cda731b014421002fde35
2019-02-15 01:51:23 +00:00
Mikhail Naganov
9c140b452a [Master port] Audio HAL: Add optional Destination to SinkMetadata
This patch ports a change to the HAL interfaces done in master in
order to have the same Audio common HAL interface in both AOSP and master.
This is needed as the Bluetooth HAL uses the audio common HAL and needs
to be frozen in the same state in both AOSP and MASTER.

Currently this is used to indicate the output device
when the input stream is from an intermediate processing
module like MSD.

Bug: 124247199
Bug: 120859615
Test: make
Change-Id: I60bac5c24a263ab0b8965e9dbf9514445e88c270
Merged-In: I60bac5c24a263ab0b8965e9dbf9514445e88c270
2019-02-15 01:50:58 +00:00
jiabin
d42361e3d1 [Master port] Add haptic channel mask.
This patch ports a change to the HAL interfaces done in master in
order to have the same Audio common HAL interface in both AOSP and master.
This is needed as the Bluetooth HAL uses the audio common HAL and needs
to be frozen in the same state in both AOSP and MASTER.

Bug: 111454766
Bug: 124247199
Test: build
Change-Id: I00c28aa02473ce83b0d9b404b5cf33410c73a2c8
Merged-In: I00c28aa02473ce83b0d9b404b5cf33410c73a2c8
2019-02-15 01:50:28 +00:00
Cheney Ni
3899315c00 Merge "Register Bluetooth Audio Hal v2 within Audio HAL" am: f7b6c73725 am: 6cef9b0a49
am: 1c9ef33a17

Change-Id: I1868f8093259855c2331231678dc71f3f2522735
2019-02-06 19:14:51 -08:00
Treehugger Robot
f7b6c73725 Merge "Register Bluetooth Audio Hal v2 within Audio HAL" 2019-02-07 02:51:28 +00:00
Cheney Ni
4f6882ff4b Register Bluetooth Audio Hal v2 within Audio HAL
Register Bluetooth Audio Hal v2 by Audio HAL service so Bluetooth stack
can fetch the service interface as well.

Bug: 111519504
Test: manual

Change-Id: I3ac8c0472c58dd4d8a9b1ad8408313b80282cc85
2019-02-06 23:30:26 +00:00
Steven Moreland
941f105b60 Update makefiles.
Some of these are out of date.

Bug: N/A
Test: N/A
Change-Id: Ibf87fad9981d4e430a0bf797feadbb0bede232fc
2019-02-05 13:14:26 -08:00
Eric Laurent
f2b77b0705 audio: add new audio formats
Add audio format for LHDC Bluetooth codec.
Also add missing audio sources and devices in xsd.

Bug: 120395342
Test: make
Change-Id: Ib55c7d351074d8ef75747bcb1195e1ce15ed8b20
2019-01-22 15:45:05 -08:00
Eric Laurent
1f702cac1f audio: add new audio formats
Add AAC_LATM*, CELT and APTX_ADAPTIVE to the list
of audio formats.

Bug: 123082414
Test: make
Change-Id: Id75e1f5016929d5a67e777774aaa892df6f91e78
2019-01-22 15:31:00 -08:00
Michael Dooley
58828095fb Merge "Enabling sound trigger V2_2" 2019-01-18 04:00:39 +00:00
mike dooley
2f0da26cd5 Enabling sound trigger V2_2
V2_2 has the same functionality as V2_1 except it adds one new
api, getModelState.

Note: V2_1 will be removed in a subsequent cl.

Test: built android and tested using SoundTriggerTestApp

Bug: 70206501
Change-Id: Ia1567bfc988482195b89b8d6a0901d51e870bfbf
2019-01-17 20:49:38 +01:00
Eric Laurent
ff08074227 add new audio sources for audio capture
This commit adds the following audio capture sources:
- AUDIO_SOURCE_VOICE_PERFORMANCE: for real time live performances like Karaoke.
- AUDIO_SOURCE_ECHO_REFERENCE: for capturing the reference signal to suppress by an echo
canceller. Protected by privileged permission CAPTURE_AUDIO_OUTPUT.

Also added device AUDIO_DEVICE_IN_ECHO_REFERENCE selected when the requested
capture source is AUDIO_SOURCE_ECHO_REFERENCE.

Bug: 118203066
Test: CTS tests for audio capture
Change-Id: Ia93550b278733ae9cc5cda731b014421002fde35
2019-01-16 09:54:45 -08:00
Mikhail Naganov
1503a98940 Audio HAL: Add optional Destination to SinkMetadata
Currently this is used to indicate the output device
when the input stream is from an intermediate processing
module like MSD.

Bug: 120859615
Test: make
Change-Id: I60bac5c24a263ab0b8965e9dbf9514445e88c270
2018-12-19 16:12:39 -08:00
Mikhail Naganov
00a44c0fc2 Audio HAL: More generalization for types imports
Complement imports of audio::CPP_VERSION with audio::common::CPP_VERSION
for core.

Import namespaces in VTS tests.

Remove "using namespace" from .cpp files where there
are already imports in the .h file.

Test: try moving types between audio/types.hal and common/types.hal.
Change-Id: I49c2e2466c8175f2516c2273f5c26d125afd4801
2018-12-14 16:34:28 -08:00
Mikhail Naganov
543bf9cb16 Audio HAL: Simplify types updates for 'common' and 'audio' packages
Instead of importing every single type individually ("using <type>"),
import entire namespaces of
::android::hardware::audio::CPP_VERSION and
::android::hardware::audio::common::CPP_VERSION
inside the "implementation" namespace in the default implementation.

This simplifies modifying types, as it is not needed anymore
to surround "using <type>" directives with #if MAJOR_VERSION ...

Note that the contents of the namespaces are imported inside
the "implementation" namespace, which reduces risks of name collision

Also, fixed the namespace for HidlUtils--it needs to be in
'implementation'.

Test: make
Change-Id: I81bbb3074b5763717ae72e747a075fd46dc36d18
2018-12-11 16:54:29 -08:00
jiabin
df0f1c1e61 Add haptic channel mask.
Bug: 111454766
Test: build
Change-Id: I00c28aa02473ce83b0d9b404b5cf33410c73a2c8
2018-12-10 12:39:50 -08:00
Kevin Rocard
2dc552a755 Audio V5: move Stream Metadata to common
So that it can be used by the Bluetooth HAL.

Test: compile
Change-Id: I2e2b1e12e1f837183c4edbd1d330a13a67d1ecae
Merged-In: I2e2b1e12e1f837183c4edbd1d330a13a67d1ecaf
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-12-02 18:21:01 -08:00
Kevin Rocard
35c0de8085 Audio HAL V5: Introduce HAL V5, equal to V4 for now
Port audio HAL V5 to AOSP for BT HAL.
The implementation is not ported as that would require to port an
additional ~30 patches and is not needed by the BT team.

Bug: 118203066
Test: Compile
Change-Id: If99a5645d19c9780019704ea4f51f8114d83ee8e
Merged-In: If99a5645d19c9780019704ea4f51f8114d83ee8f
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-12-02 18:20:51 -08:00
Kevin Rocard
9be7bde296 Audio V5: move Stream Metadata to common
So that it can be used by the Bluetooth HAL.

Test: compile
Change-Id: I2e2b1e12e1f837183c4edbd1d330a13a67d1ecaf
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-12-02 17:59:45 -08:00
Kevin Rocard
20614ba604 Audio HAL V5: Introduce HAL V5, equal to V4 for now
find -name 4.0 | xargs -I@ cp -r @ @/../5.0
find 5.0 */5.0 -type f | xargs sed -Ei 's/V4/V5/;s#(@|/)4.0#\15.0#'
find -name *cpp -o -name *.h | xargs sed -i 's/VERSION == 4/VERSION >= 4/g'
mv {4.1,5.0}/config/audio_policy_configuration.xsd

Then a manual update to Android.bp to add V5 support.
Then a manual update to service.cpp to add support for loading 5.0.

If someone knows a way to avoid copying the .hal, it would be great.
They will be 99% identical between V4 and V5.

Bug: 118203066
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioEffectV2_0Target
      vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target
      vts-tradefed run commandAndExit vts --module VtsHalAudioEffectV4_0Target
      vts-tradefed run commandAndExit vts --module VtsHalAudioV4_0Target
Change-Id: If99a5645d19c9780019704ea4f51f8114d83ee8f
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-12-02 17:59:45 -08:00
Kevin Rocard
a497499c4a Audio VTS: Fix missing whitespace in error message
Test: outpout the error
Change-Id: Ibba04f12e489e3b526ae9fe4758e2ae540095d89
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-11-28 20:29:52 -08:00
Kevin Rocard
1108d4a9db Audio HAL: Factorize Android.bp
Lots of Android.bp content was duplicated per version.

Bug: 118203066
Test: compile
Change-Id: I4072314f1e1278c6d876fc681ba20363728f151b
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-11-28 20:29:52 -08:00
Kevin Rocard
96d2cd9d5c Audio HAL: Factorize V2 and V4 like libaudiohal
Use the same technique developed for the simpler libaudiohal to
factorize the audio HAL impl.

Generated with script:

set -euo pipefail

cd hardware/interfaces/audio

# Make 2.0 and 4.0 files mostly identical by removing all 2.0, V4.0...
# and replacing it by CPP_VERSION and FILE_VERSION
# This allow both implementation to be mostly identical, except for code difference
# Also remove IncludeGuard.h as it will be included from compiler flag
# Also update license to 2018
find -name *.cpp -o -name *h |
    grep -v -e service.cpp |
    xargs sed -Ei \
        -e 's/(#.*)V[42]_0_(.*_H_?)$/\1\2/' \
        -e 's/(LOG_TAG.*)[24]_0/\1/' \
        -e '/#ifndef AUDIO_HAL_VERSION/,/#endif/d' \
        -e '/^#.*def.*AUDIO_HAL_VERSION\b/d' \
        -e's/V[42]_0/CPP_VERSION/' \
        -e 's/(#include ).(android.*)[24].0(.*).$/\1PATH(\2FILE_VERSION\3)/' \
        -e 's|(#include) .(.*)[24].0/(default/.*).$|\1 "\2\3"|' \
        -e 's/\bAUDIO_HAL_VERSION\b/CPP_VERSION/' \
        -e '/IncludeGuard.h/d' \
        -e 's/(Copyright .C. 201)./\18/'

# set MAJOR_VERSION instead of having a different macro for each version
# this allow to do preprocessor arithmetic (eg: MAJOR_VERSION >= 4)
for v in 2 4; do
    find -ipath '*/'$v'.0/*/Android.bp' |
        xargs sed -i -e '/cflags:/,/^$/d' -e '/vndk/{:a;/}/!{N;ba};d}' -e '$i\
    cflags: [\
        "-DMAJOR_VERSION='$v'",\
        "-DMINOR_VERSION=0",\
        "-include common/all-versions/VersionMacro.h",\
    ]'; done

# replace# ifdef VERSION_X by #if MAJOR_VERSION == X
find -path *all-versions/*.h |
    xargs sed -Ei -e 's/def.*AUDIO_HAL_VERSION_([24])_0.*/ MAJOR_VERSION == \1/' \
                  -e 'T;s/ +/ /'

# copy all-versions impl in each version impl
find -path '*/[24].0/*.[hc]*' |
    grep -ve all-versions -e test |
    xargs -P99 -n4 sed -i -Ee '/include <.*all-versions.default/!b' \
        -e 's#.*<#find -path */#' -e 's/>$/|xargs tail -n +16/' -e e

# remove all-versions impl
rm -r {core,effect}/all-versions/

# merge version impl into a single all-version
for dir in core/*.0/vts/functional/*.0/ ;do
    dest=$(echo $dir | sed 's#/..0/#/all-versions/#')
    mkdir -p $dest
    mv -T $dir $dest
done

find -mindepth 3 -path '*/2.0/*' -a \( -name '*cpp' -o -name '*h' \) |
    grep -v 'all-versions' |
    sed -E 'h;s/2/4/g;H;s/4.0/all-versions/;s/4.0//;H;g;s/\n/ /g;'|
    xargs -P99 -L1 sh -c '
        set -euo pipefail
        mkdir -p $(dirname $2);
        diff --old-group-format="#if MAJOR_VERSION == 2
%<#endif
" \
             --new-group-format="#if MAJOR_VERSION == 4
%>#endif
"       $0 $1 > $2 || true;
        rm $0 $1'

# merge the X.0 Android.bp & OWNERS in the all-versions
for dir in common effect core; do
    for sub in default vts/functional; do
        test -f $dir/2.0/$sub/Android.bp || continue
        awk 1 $dir/*.0/$sub/Android.bp >> $dir/all-versions/$sub/Android.bp
        # delete licenses except for the first one and add whitelines
        sed -i -e '/^}$/{N;/^}\n$/!s/\n/&\n/}' $dir/all-versions/$sub/Android.bp
        sed -i -e '1,17b;/^\/\//,/^$/{d}' $dir/all-versions/$sub/Android.bp
    done
    for sub in default vts; do
        test -d $dir/2.0/$sub || continue
        test -f $dir/2.0/$sub/OWNERS &&
            awk 1 $dir/*.0/$sub/OWNERS | sort -u > $dir/all-versions/$sub/OWNERS ||
            true
        rm -r $dir/*.0/$sub
    done
done

# delete all-versions-impl dependencies
find -name 'Android.bp' | xargs sed -i -e '/all-versions-impl/d'

# cleanup unused files
rm common/all-versions/default/include/common/all-versions/default/HidlUtils*
rm common/all-versions/util/include/common/all-versions/IncludeGuard.h
find -depth -type d -empty -delete

# Clamp consecutive number of empty lines to 2
find -name *.cpp -o -name *h | xargs sed -Ei ':a;/^\n*$/{N;ba};s/\n\n+/\n\n/'

# transform #endif\n#if to #elif
find -name *.cpp -o -name *h | xargs sed -i '/^#endif/{N;s/.*\n#if/#elif/}'

# remove leftover include guard in cpp
find -name *.cpp |xargs sed -Ei '/^#.*_H_?$/d'

# apply clang-format
find -name *cpp -o -name *h |
    xargs ../../../prebuilts/clang/host/linux-x86/clang-stable/bin/clang-format --style file -i
# clang format breaks PATH(a/b) to PATH(a / b), remove the space surrounding /
find -name *cpp -o -name *h | xargs sed -i "/#include PATH/s# / #/#g"

Test: compile
Bug: 118203066
Change-Id: I3692a444307afc5f71064fe0b9e6b8af3c9ff1dd
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-11-28 20:29:52 -08:00
Kevin Rocard
f5305b3615 Audio HAL: Align V2 and V4 VTS
It was thought that the V2 VTS were not going to be supported after V4
VTS were created. Thus a large portion of the code was copy paste and
modified.

That assumption ended up wrong as a lot of OEM reported bugs that needed
to be fixed in both versions.

As a result align the code of both version VTS as much as possible.
The code will be merged in a follow up patch.

Bug: 118203066
Test: compile
Change-Id: I994232db237b5d7c52e7d796f199ab3c6eec21f4
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-11-28 17:56:19 -08:00
Kevin Rocard
1770b3b44a Audio HAL: Cleanup implementation
Rename files so that, if they are in a X.0 folder, their name does
not contain that version number. That allows for easier copy paste
when creating a new version.

Conversion.h was included from the all-versions instead of the X.0
headers. This in incoherent with the other headers.

Add VersionMacro.h that will be used in the follow up patch.

Also remove shim from VNDK as only stable ABI&API libraries should be
part of it.

Test: Compile
Bug: 118203066
Change-Id: I9cd77b3df5ccede5ae51c3cc94fab5939c51d9ef
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-11-28 17:54:35 -08:00
Kevin Rocard
55b1061d9c Audio: Run clang-format on all files
That will permit minimal change on future refactors.

Bug: 118203066
Test: compile
Change-Id: Ibed095d3821e2f7b6177faa07775bde9821459c7
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-11-28 17:54:35 -08:00
Bubble Fang
7f5399b23b Merge "Revert "Audio: Do not sanitize android.hardware.audio@2.0-service"" am: 332e5bc76c am: ea02f3c912
am: 81f9e0bcc0

Change-Id: I55467a5c8a889a5df4deb3ac489ce6007a6cf0dd
2018-11-13 18:53:26 -08:00
Bubble Fang
332e5bc76c Merge "Revert "Audio: Do not sanitize android.hardware.audio@2.0-service"" 2018-11-14 02:34:51 +00:00
Bubble Fang
94893cdd48 Revert "Audio: Do not sanitize android.hardware.audio@2.0-service"
This reverts commit 34e4fb2a84.

Reason for revert: b/117506164 is fixed and we no longer suppress ASAN
Bug: 117580200
Change-Id: Ib981bddaa4e218cd13b274db5444f585f3487327
2018-11-13 03:30:38 +00:00
Andreas Gampe
3f2cae78fa Merge "Audio: Do not sanitize android.hardware.audio@2.0-service" am: f06fb17cd7 am: 52be9f0549
am: a809e7a975

Change-Id: Idaccedb06611510a843819c6c139d4fcc24e0554
2018-10-11 18:31:55 -07:00
Andreas Gampe
52be9f0549 Merge "Audio: Do not sanitize android.hardware.audio@2.0-service"
am: f06fb17cd7

Change-Id: I743c1afaae84f560879cab6afba0fe31978ef871
2018-10-11 18:09:56 -07:00
Andreas Gampe
34e4fb2a84 Audio: Do not sanitize android.hardware.audio@2.0-service
Until the underlying bug is fixed, do not produce a sanitized
binary.

Bug: 117506164
Bug: 117580200
Test: m && SANITIZE_TARGET=address m
Change-Id: I4e6d1206512513c687f7ae065d2974c55c617b61
2018-10-10 20:26:39 -07:00
Mikhail Naganov
317a9ed5ba audio: Allow vendors to configure hwbinder RPC buffer size
If persist.vendor.audio.hw.binder.size_kbyte property is set, its
value is used to configure the size of hwbinder's MMap buffer.

Bug: 114776290
Test: set the property, check logcat
Change-Id: Icb6a4d0ebe98eb702201f8a9f0fed3a91a24f7ba
2018-09-26 10:11:26 -07:00
Kevin Rocard
c7f433314a Merge "VTS: Do not require XML for Audio effect V2" into pie-vts-dev am: 5e6dd1288e
am: 2642ddb86f

Change-Id: I3716d72d762fe481eae9c82f8123ef45b5053768
2018-08-28 13:09:25 -07:00
Kevin Rocard
8ca56c3dee VTS: Do not require XML for Audio effect V2
In O, the Audio effect V2 HAL allows not to have an audio effect XML
configuration but to use a .conf format.

In P, before this patch, the Audio effect V2 HAL _requires_ to have an
audio effect XML configuration and forbids the use of a .conf format.

This is discouraged by Treble as it means that an unchanged HAL V2
implementation that was compatible with O VTS will not be with P VTS.

As a result, revert to the Oreo behavior for Audio Effect V2 VTS.

Note that the audio effect V4 VTS is not changed by this patch and
still requires an audio effect XML configuration.
Aka device _updating_ to P will not have to upgrade to XML but new
devices lunching on P are still required to have an audio effect
XML configuration.

This commit only changes VTS code.

Test: cd hardware/interfaces/audio/effect/
      mmm 2.0/vts/functional 4.0/vts/functional && adb sync data
      adb push *.0/xml/audio_effects_conf_V*.xsd /data/local/tmp/
      adb shell
      cd /data/nativetest64
      OPS=--gtest_filter=CheckConfig.audioEffectsConfigurationValidation
      VtsHalAudioEffectV2_0TargetTest/VtsHalAudioEffectV2_0TargetTest $OPS
      VtsHalAudioEffectV4_0TargetTest/VtsHalAudioEffectV4_0TargetTest $OPS
      rm /{odm,vendor,system}/etc/audio_effects.xml || true
      VtsHalAudioEffectV2_0TargetTest/VtsHalAudioEffectV2_0TargetTest $OPS
      ! VtsHalAudioEffectV4_0TargetTest/VtsHalAudioEffectV4_0TargetTest $OPS
Bug: 111421676
Change-Id: Ifb15d65ae4aa65759c8ebaa91cbc8c02234030dc
Merged-In: Ifb15d65ae4aa65759c8ebaa91cbc8c02234030dc
Signed-off-by: Kevin Rocard <krocard@google.com>
(cherry picked from commit b41b575475)
2018-08-28 18:18:21 +00:00
Kevin Rocard
5381192973 Audio VTS: run tear-down hooks in LIFO instead of FIFO
am: cfab8dac2b

Change-Id: Ibd24dda91b5d334a62553dfe980d6559743688b8
2018-08-10 14:29:43 -07:00
Kevin Rocard
bc41f7d731 Merge "VTS: Do not require XML for Audio effect V2" into pi-dev am: ad3acdc14f
am: 330410e82a

Change-Id: I17cc493d1b230b134b94c61fd9181a56c73f9178
2018-07-23 09:54:51 -07:00
Kevin Rocard
b41b575475 VTS: Do not require XML for Audio effect V2
In O, the Audio effect V2 HAL allows not to have an audio effect XML
configuration but to use a .conf format.

In P, before this patch, the Audio effect V2 HAL _requires_ to have an
audio effect XML configuration and forbids the use of a .conf format.

This is discouraged by Treble as it means that an unchanged HAL V2
implementation that was compatible with O VTS will not be with P VTS.

As a result, revert to the Oreo behavior for Audio Effect V2 VTS.

Note that the audio effect V4 VTS is not changed by this patch and
still requires an audio effect XML configuration.
Aka device _updating_ to P will not have to upgrade to XML but new
devices lunching on P are still required to have an audio effect
XML configuration.

This commit only changes VTS code.

Test: cd hardware/interfaces/audio/effect/
      mmm 2.0/vts/functional 4.0/vts/functional && adb sync data
      adb push *.0/xml/audio_effects_conf_V*.xsd /data/local/tmp/
      adb shell
      cd /data/nativetest64
      OPS=--gtest_filter=CheckConfig.audioEffectsConfigurationValidation
      VtsHalAudioEffectV2_0TargetTest/VtsHalAudioEffectV2_0TargetTest $OPS
      VtsHalAudioEffectV4_0TargetTest/VtsHalAudioEffectV4_0TargetTest $OPS
      rm /{odm,vendor,system}/etc/audio_effects.xml || true
      VtsHalAudioEffectV2_0TargetTest/VtsHalAudioEffectV2_0TargetTest $OPS
      ! VtsHalAudioEffectV4_0TargetTest/VtsHalAudioEffectV4_0TargetTest $OPS
Bug: 111421676
Change-Id: Ifb15d65ae4aa65759c8ebaa91cbc8c02234030dc
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-07-23 16:41:40 +00:00
Carter Hsu
197583fc69 Merge "audio: add wakelock capability for audiohalservice" into pi-dev am: 3ce3c9127a
am: de8ad1bdb3

Change-Id: Ib860875335c0598adb6523e551c725e3ecfcd53c
2018-07-17 14:13:33 -07:00
Carter Hsu
8284636fec audio: add wakelock capability for audiohalservice
1. wake_lock group
2. BLOCK_SUSPEND capability

int pm_wake_lock(const char *buf)
{
	const char *str = buf;
	struct wakelock *wl;
	u64 timeout_ns = 0;
	size_t len;
	int ret = 0;

	if (!capable(CAP_BLOCK_SUSPEND))
		return -EPERM;
Bug: 111018819
Test: manual
Change-Id: I1283e4b1ab2b95e4e94df045240001485593f1ab
Signed-off-by: Carter Hsu <carterhsu@google.com>
2018-07-13 06:46:10 +00:00
Mikhail Naganov
93b5778e9c Fix audio port "mix" role parameter conversion
'usecase.source' field is used for AUDIO_PORT_ROLE_SINK,
'usecase.stream' field is used for AUDIO_PORT_ROLE_SOURCE.

The HIDL<->legacy conversion code was doing it opposite.

Test: make
Change-Id: I93722f422a8f226f11a6be97215453af3234029c
2018-07-09 14:28:57 -07:00
Kevin Rocard
714ddf05d7 Audio VTS: run tear-down hooks in LIFO instead of FIFO am: cfab8dac2b
am: 4595c66a1e

Change-Id: Idb84f4a8259683b825a02051264d0a6a89af24c5
2018-06-29 14:36:14 -07:00
Kevin Rocard
cfab8dac2b Audio VTS: run tear-down hooks in LIFO instead of FIFO
The audio tests use a static cache of some HAL objects for
performance reasons (speed up by 10x on Pixel).
Those object are destroy during the test environment tear-down.

This tear-down was destroying the objects in a FIFO instead of LIFO
order. Thus the DeficesFactory was destroyed before the Device it
created.

Bug: 79889318
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target
      check that the device destructor is called before the
      devicesFactory one.
Change-Id: I1b4345158139ba14a8779a9508f7ebdc41129d1d
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-06-29 20:09:50 +00:00
Mikhail Naganov
2c484238d1 audio hal: Add 'interface' declarations for IDeviceFactory into .rc
Declaring the interfaces allows HIDL hwservicemanager to start
the HAL service in case it has crashed before audioserver
has called 'getService'.

Bug: 80227481
Test: use the repro case from the bug
Change-Id: Ibb46beb714b3985ab373d56d92da1105cfda28c6
2018-05-25 13:02:25 -07:00
Kevin Rocard
c1d89888b9 Audio V4 VTS: test setter even if getter is NOT_SUPPORTED
Previously, the setter of optional properties were not tested
if the getter was not supported.
This was an issue as the framework rarely gets, most
often only sets as it consider having the ownership of those properties.
Thus implementation tend to only support set.

As a result optional setter were not tested although called by the
framework.

For example the default impl setTtyMode has a bug that was not detected
because the Pixel HAL does not support getTtyMode.

This patch makes sure to always test getter and setter.

Test: atest VtsHalAudioV4_0TargetTest
Bug: 71486871
Change-Id: Ib0b03fb6eb77cc0428a33eb463166dd7c339bd3d
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-05-01 17:07:29 -07:00
Kevin Rocard
dea4c3803f Audio V4: setMode VTS incorrectly assume 0 was invalid
Thus the test was always incorrectly failing.
Also improve the test error messages.

Bug: 77307068
Test: VtsHalAudioV4_0TargetTest
Change-Id: I95db94ed99f7ca32af35422e36a95084e72279d8
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-04-21 01:32:34 -07:00
Kevin Rocard
16d6547901 Audio V4: Improve VTS error messages
This does not change the test logic or constraints.
It only improves the error messages.

Bug: 77307068
Test: atest VtsHalAudioV4_0TargetTest
Change-Id: I6c79ddd014d4ab8aba4f1d0b918888f83dfb63ad
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-04-21 01:32:34 -07:00
TreeHugger Robot
14dc815cdc Merge changes from topic "audio-hal-v4" into pi-dev
* changes:
  Audio V4: Update V2 tests to V4
  Fix issues in ReturnIn
  Audio V4: Duplicate V2 tests
2018-03-21 03:13:53 +00:00
Dean Wheatley
ce8b2734f7 Add 5.1.2, 5.1.4, 7.1.2, 7.1.4 output channel masks
They were supposed to be added by the change with id
I2f488462614114e4c82149460b030585981ae15e
but actually were not.

Also, rename OUT_TOP_CENTER_... to OUT_TOP_SIDE_...
according to Dean's suggestion.

Bug: 38184704
Bug: 63901775
Test: make
Change-Id: Ib263b06e4f3aa84525c2255f7a52f9bb39dbebcd
2018-03-19 09:38:00 -07:00
Kevin Rocard
e3afd40e91 Audio V4: Update V2 tests to V4
Bug: 74037175
Bug: 38184704
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV4_0Target
Change-Id: Ic8da941fc042b7ef838edf8fdac36b2f0fa1fd32
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-14 19:38:03 -07:00
Kevin Rocard
8532f6b2cc Fix issues in ReturnIn
Bug: 74037175
Test: compile
Change-Id: Icc3a0d1d489474de7c6255a014dccecc4dda4aa2
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-14 19:38:03 -07:00
Aniket Kumar Lata
d93a3adab5 audio: Register Bluetooth service with audio HAL
Register Bluetooth audio library with audio HIDL service.
Changes required for A2DP offload implementation.

Bug: 63932139
Bug: 68824150
Test: A2DP offload verified on supported codecs
Change-Id: Idd89f0d28903579d42bd0f33b0194fb8dc2ceaaa
(cherry picked from commit c5a5203114)
2018-03-12 19:18:21 +00:00
Mikhail Naganov
b7e7ccc648 audio HAL: Add missing input channel masks
The following masks added for input: 2.0.2, 2.1.2, 3.0.2, 3.1.2

Bug: 38184704
Bug: 63901775
Test: make
Change-Id: I9ffc2a1858068fdd9fe0777184ea8464e7ab0e3b
2018-03-07 19:27:02 +00:00
Kevin Rocard
bee7f4eb1e Audio V4: Declare support for 4.0 interface
Declare that the audio HAL service supports 4.0 as well as 2.0
interface.
Formatting done by clang-format.

Test: compile
Bug: 38184704
Change-Id: Iee842b141e1218f4f3779187339bde40680ec78a
Merged-In: Iee842b141e1218f4f3779187339bde40680ec78a
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
5ec293316e Audio V4: Implement the shim core 4.0 -> legacy
All the new files added are a copy of the 2.0 ones, with just the
version 2 that was changed to 4.

Due to the rollback on the retrocompatiblity breakage,
the split of implementation is not strictly needed any more.
This makes the current split in .impl.h and double include
unnecessary complicated.
This will need to be factorized in a future patch.

Bug: 38184704
Test: compile
Change-Id: I0d699ade7558ed68125b300f8522e2767ae1ee37
Merged-In: I0d699ade7558ed68125b300f8522e2767ae1ee37
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
2696030063 Audio V4: Move service entry point to common
The HAL audio service entry point is not version dependant
and is common to core and effect.

Bug: 38184704
Test: compile
Change-Id: I143cf28490afc978791ccd7e8aeee2106cbb2ebd
Merged-In: I143cf28490afc978791ccd7e8aeee2106cbb2ebd
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
af7f78daa6 Audio V4: Implement the shim effect 4.0 -> legacy
All the new files added are a copy of the 2.0 ones, with just the
version 2 that was changed to 4.

Due to the rollback on the retrocompatiblity breakage,
the split of implementation is not strictly needed any more.
This makes the current split in .impl.h and double include
unnecessary complicated.
This will need to be factorized in a future patch.

Bug: 38184704
Test: compile
Change-Id: If412eb55ebf6afc773593547af9395a09b6825c2
Merged-In: If412eb55ebf6afc773593547af9395a09b6825c2
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
2b275704bc Fix potential missing '\0' when wrapping to legacy
The HAL API for port name is a C++ string of arbitrary
length.
Nevertheless the legacy API name had a maximum length.
Thus when wrapping from the new to legacy, the string
was truncated but no '\0' was added.

Bug: 38184704
Test: compile
Change-Id: I482363809718281e022041c2d5042e5800c5a617
Merged-In: I482363809718281e022041c2d5042e5800c5a617
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
f0878685d7 Audio V4: Cast conversion now deduce both types
That avoids to repeat the destination type which
can change between versions.

Bug: 38184704
Test: compile
Change-Id: I55c881afe5f6fc511ea01b19c5d46de12fb1e0d2
Merged-In: I55c881afe5f6fc511ea01b19c5d46de12fb1e0d2
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
c5af419ef2 Audio V4: Add V4 common utils
Bug: 38184704
Test: compile
Change-Id: I935fe4343ab517f7a8dc65e1b9720097a3ab34da
Merged-In: I935fe4343ab517f7a8dc65e1b9720097a3ab34da
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
63410e8da4 Audio V4: Do not forward notification detail
Those values are only for the framework, thus they should not be
available to the vendor.

Bug: 38184704
Test: compile
Change-Id: I05d3e506a85dbe66d51b7024fa9de45865bcf9db
Merged-In: I05d3e506a85dbe66d51b7024fa9de45865bcf9db
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
4b6169eec6 Audio V4: Remove system only enum values
Some enum values only used by the system were exposed to the vendor for
legacy reason. Remove them.

Bug: 38184704
Test: compile
Change-Id: I78254047a74d08bcdf2d7b285e874dbd497d5407
Merged-In: I78254047a74d08bcdf2d7b285e874dbd497d5407
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
4d46cea59c Audio V4: Add owner files for implementations
Bug: 38184704
Test: none
Change-Id: If45a4d7e16ecd045866230b48fde477d21f124e0
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-02 12:55:48 -08:00
Kevin Rocard
ace0b02fd9 Audio HAL V4: Add Hearing aid output device
This output is used to send audio to earring aid device
(usually through Bluetooth).

Bug: 38184704
Test: mm
Change-Id: I09ec4d2853ef04300fcda45bddb4a42209f19be0
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-14 17:44:33 -08:00
Kevin Rocard
bb90d89746 Audio HAL V4: Switch back to 32 bit AudioDevice
Switching to 64 bit has proven to be too much refactor
and the need is not immediate.

Instead in the next version of the Audio HAL,
AudioDevice will no longer be a bitfield and when multiple
devices will need to be passed, a list will be used.

Bug: 38184704
Test: mm
Change-Id: I8de14fc4ee69fb70fc1c4275b568093a5d0aec1b
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-14 17:44:12 -08:00
Kevin Rocard
87ac081930 Audio V4: Create audio V4.0 .hal makefiles
Run update-makefiles.sh to create all HAL makefiles.

Test: update-makefiles.sh
Bug: 38184704
Change-Id: I2532c4b9d1f0f6252ceaffbfb0c5d0a615400c72
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-01 16:17:34 -08:00
Kevin Rocard
eacb99697f Audio V4: More fixes of the audio 2.0 API
Remove unnecessary Result typedef.
Make bufferSizeFrames and burstSizeFrames unsigned
as they should not be negative.
Remove legacy AudioInterleave.
Remove implicit callflow annotation.
Make EffectConfigParameters a bitfield.

Bug: 38184704
Test: hardware/interfaces/update-makefiles.py
Change-Id: I33e6f7869d20ca0cad4123f32347754e5a514caa
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-01 16:17:34 -08:00
Kevin Rocard
c8d7bb7c84 Audio V4: Only expose one notification usage
Too many usages detail were previously exposed to the HAL.
All usages that should be handled identically by the HAL
are now the same value.

 - All notification types are now the same usages

Test: build
Bug: 38184704
Change-Id: I2096f995e249ab02bc29449c6d1a65b521dc13f7
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-01 16:17:34 -08:00
Kevin Rocard
14dbb1edce Audio V4: Forward tracks attributes to the hal
Forward to the HAL the audio usage, audio content types and volume
of playback tracks to the stream out they are playing to.

Forward to the HAL the audio source and volume of record tracks
to the stream in they are playing to.

This will allow the HAL to better tune its effects and remove the need
to inject a fake effect (volume listener) to get the tracks volume.

Bug: 38184704
Test: none
Change-Id: Iede0f7aa518608c3b3ce1497f059f672aac109b2
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-01 16:17:34 -08:00
Kevin Rocard
0fd5bc2dce Audio V4: Remove deprecated function and enum
The debugDump function was deprecated by the introduction of the
debug method in the IBase.

AudioMode CURRENT and INVALID should not be passed to the
vendor.

Bug: 38184704
Test: none
Change-Id: I0e14c71ce7216524587a6ba28cae0cdb821bae23
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-01 15:24:25 -08:00
Kevin Rocard
79c574082d Audio V4: bitfield enum now use the bitfield class
The audio HAL has lots of enums were each value is a specific bit
pattern (usually a single bit) and are expected to be used as a
combination of value (kind of like a bitfield).

Nevertheless the 2.0 methods only had the enums themselves in their
signatures which leads the HIDL API checkers to warn that invalid values
were passed.

Currently, there are no way to express a value which is a combination
of enum values. The closest thing is the bitfield type.

Thus transition all enums combination to bitfield.

Note that AudioDevice as NOT been transition systematically
as both the enums and the combination are meaningful:
 - the enum is one device
 - the combination is a list of device.

Test: none
Bug: 38184704
Change-Id: I155cf7bc5d88fc5cf8954903d55aa8d7ca458a4b
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-01 15:24:25 -08:00