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>
hidl-generated makefiles are now generated such that bpfmt(file) == file.
Bug: 67417008
Test: enable bpfmt hook
Change-Id: I1f69d292bc23a7cc293a66110cb02d597e1019ad
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
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
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
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
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
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
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
Add audio format for LHDC Bluetooth codec.
Also add missing audio sources and devices in xsd.
Bug: 120395342
Test: make
Change-Id: Ib55c7d351074d8ef75747bcb1195e1ce15ed8b20
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
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
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
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
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
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>
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>
So that it can be used by the Bluetooth HAL.
Test: compile
Change-Id: I2e2b1e12e1f837183c4edbd1d330a13a67d1ecaf
Signed-off-by: Kevin Rocard <krocard@google.com>
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>
Lots of Android.bp content was duplicated per version.
Bug: 118203066
Test: compile
Change-Id: I4072314f1e1278c6d876fc681ba20363728f151b
Signed-off-by: Kevin Rocard <krocard@google.com>
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>
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>
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>
That will permit minimal change on future refactors.
Bug: 118203066
Test: compile
Change-Id: Ibed095d3821e2f7b6177faa07775bde9821459c7
Signed-off-by: Kevin Rocard <krocard@google.com>
This reverts commit 34e4fb2a84.
Reason for revert: b/117506164 is fixed and we no longer suppress ASAN
Bug: 117580200
Change-Id: Ib981bddaa4e218cd13b274db5444f585f3487327
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
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
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)
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>
'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
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>
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
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>
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>
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>
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
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Add MAT 1.0, 2.0, 2.1 audio formats
Add 5.1.2, 5.1.4, 7.1.2, 7.1.4 output channel masks
Add E_AC3_JOC audio format
Add MSD Device to allow an MSD HAL implementation separated from the
primary.
Bug: 38184704
Test: none
Change-Id: I2f488462614114e4c82149460b030585981ae15e
Original author:
Signed-off-by: Dean Wheatley <dwhea@dolby.com>
Ported to HAL 4.0:
Signed-off-by: Kevin Rocard <krocard@google.com>
Add new device to the device factory to allow vendors to split
their HAL implementations more.
AudioDevice bitfield is now 64bit to allow more devices to be added.
Add a new AudioDevice to support playing music to distant during voice
call.
A HAL can now declare if its MMAP buffer can be securely accessed
directly by untrusted apps.
Add AAC_XHE format.
Add BLE input source.
Bug: 38184704
Test: none
Change-Id: Ic2fbec4db71c7f688c8847ba39c72f51480c0727
Signed-off-by: Kevin Rocard <krocard@google.com>
The CNT, MAX enum values had two drawbacks:
- they were invalid enum value that were part of the enum
thus enum validity check would validate them although those values
are only expected to be use in loops/validation code.
- they are not extensible by vendors
The *_ALL enum values were not extensible by vendors.
Those values can instead be replaced by treble enum iterator and
helper functions.
Bug: 38184704
Test: none
Change-Id: I1a9527bb7311088e0abe22eceee92d21d9171ca4
Signed-off-by: Kevin Rocard <krocard@google.com>
hidl-doc does not support two consecutive documentation comments
/** ... */
/** ... */
In such case make the first one a non-doc comment.
This is a port of: http://android-review.googlesource.com/432140
Bug: 38184704
Test: none
Change-Id: I86cb10c655036ca49055ee007813c3e5af743eb5
Signed-off-by: Kevin Rocard <krocard@google.com>
Add missing documentation, especially for failure cases
and methods that are optional.
Add missing operation status for testability.
Add format for getSupported* methods as they could not
be implemented in 2.0 for multi-format stream (HDMI).
Test: compile
Bug: 38184704
Change-Id: I14ee5e02ef70a82df6de732f88b065810e9b032f
Signed-off-by: Kevin Rocard <krocard@google.com>
That will ease review of the changes.
The only changes are:
- replace all @2.0 by 4.0
$ sed -i 's/@2\.0/@4\.0/g' */4.0/*.hal
- replace all licence 2016 by 2018
$ sed -i 's/2016/2018/g' */4.0/*.hal
Moving the .hal in a subfolder forces the package name and the
namespace to change.
This mean that the audio HAL 2.0 and 4.0 will not be consider
different version of the same HAL but two different HALs.
As a result to minimize code change due to tight deadline,
keep the 4.0 core in the audio folder.
Bug: 38184704
Test: hardware/interfaces/update-makefiles.sh
Change-Id: I7c7a826270c9933091f037b795806787e1284583
Signed-off-by: Kevin Rocard <krocard@google.com>
The name device has already too many meaning, thus rename the main audio
api to core.
Bug: 38184704
Test: compile
Change-Id: I178dfef05af8f8579196affbe2cbc5f6c3f9af55
Signed-off-by: Kevin Rocard <krocard@google.com>
The previous patch made the test independent of the HAL version
As a result, move them in the version common folder.
Note that this patch is separated from the previous patch to ease
review.
Bug: 38184704
Test: compile
Change-Id: I98a46eb0b88ea786656200ab613afd2d36ed222d
Signed-off-by: Kevin Rocard <krocard@google.com>
The implementation uses the version provided by macro.
Bug: 38184704
Test: compile
Change-Id: Ib5565bdf77ed9e42fc8271a4317eb88681aefcd5
Signed-off-by: Kevin Rocard <krocard@google.com>
This will make diff much more clear and allow git to follow the files.
Bug: 38184704
Test: compile
Change-Id: I41ccb41c334aa56d3935be333e6227dd99773766
Signed-off-by: Kevin Rocard <krocard@google.com>
This patch only contains cosmetic reformatting imposed by clang-format.
Bug: 38184704
Test: compile
Change-Id: I2f8c74d1b976e1e4e74f85dd0e8350f9b16fb31a
Signed-off-by: Kevin Rocard <krocard@google.com>
If multiple config are found, each will be validated before failing the
test.
Also add a missing new line before dumping libxml2 errors.
Test: run the following script to check for regressions and test that
invalid config make the test fail.
runTest() {(
set -xu
local readonly MODULE=$1
local readonly TEST=$2
local readonly XML=$3
runVTS() { vts-tradefed run commandAndExit vts \
--skip-all-system-status-check --primary-abi-only \
--skip-preconditions --module $MODULE -t $TEST |
awk '/FAILED: 0/{e=1} {print} END {exit !e}'; }
local FAIL=0 # used instead of return if clean up is needed
echo "# Test valid config"
runVTS || return 1
echo "# Test multiple invalid match"
adb shell touch /system/etc/$XML
runVTS && FAIL=2
adb shell rm /system/etc/$XML
echo "# Test multiple valid match (not supported if xinclude)"
if !adb shell grep -q xi:include /vendor/etc/$XML; then
adb shell cp /{vendor,system}/etc/$XML
runVTS || FAIL=3
adb shell rm /system/etc/$XML
fi
echo "# Test invalid config"
adb shell sed -i "'2i<fuu/>'" /vendor/etc/$XML
runVTS && FAIL=4
adb shell sed -i 2d /vendor/etc/$XML
echo "#Test no config"
adb shell mv /vendor/etc/$XML{,.hide}
runVTS && FAIL=5
adb shell mv /vendor/etc/$XML{.hide,}
echo "# Test that the test did not break the config"
runVTS || FAIL=6
return $FAIL
)}
runTest VtsHalAudioV2_0Target CheckConfig.audioPolicyConfigurationValidation audio_policy_configuration.xml &&
runTest VtsHalAudioEffectV2_0Target CheckConfig.audioEffectsConfigurationValidation audio_effects.xml &&
echo TEST PASSED
Bug: 64881365
Change-Id: If0443f85e0d687eed04819337519e4d9f09f5ca9
Signed-off-by: Kevin Rocard <krocard@google.com>
As a VNDK module, Android.bp must have 'vndk' tag as well as
'vendor_available: true'.
The 'vndk' tag for VNDK module is formated as below:
vndk: {
enabled: true,
},
VNDK modules will be installed both in system/lib(64) as normal and
in system/lib(64)/vndk as a vendor variant.
Bug: 63866913
Test: build and boot with BOARD_VNDK_VERSION=current
Change-Id: If0eb0c1bddfa5bdc7ea0ca4635d4e53b59836582
Update the Android.bp generated with hidl-gen.
Test: build with and without BOARD_VNDK_VERSION=current
Bug: 63866913
Change-Id: I1a9db1df49e0f13c5790da2b118ae9ec63ba34a7
Allow HAL definition libs to be static.
Bug: 32920003
Bug: 64040096
Test: update-all-google-makefiles.sh
Change-Id: I1483d572bea6799717d1614fb7d52fe225e31104
Bug: 63801053
In order to avoid having to instruct vts-tradefed to push the test
utility library on the target before runing the audio VTS,
duplicating the makefile declaration,
make the library static.
Test: make vts
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target
Change-Id: I7a98b2aaf0e0f6f91a92b7f01df1c630540ad697
Merged-In: I7a98b2aaf0e0f6f91a92b7f01df1c630540ad697
Signed-off-by: Kevin Rocard <krocard@google.com>
Move code that can be reuse between audio tests of the HIDL interface in
an utility library.
Test: run vts tests
Test: vts-tradefed run vts --module VtsHalAudioV2_0Target
Bug: 35700978
Change-Id: Ia930ad2b0a3ca31628b2cb767b265d54b210756b
Signed-off-by: Kevin Rocard <krocard@google.com>
vendor_available: separate copy built on the vendor partition for
BOARD_VNDK_VERSION := current devices.
**************************************************
See full implications + warning on:
https://android-review.googlesource.com/#/c/369995/
(Ia4eb5378d941033b07673daf682e66051cd3c075)
***************************************************
Test: (sanity) audio works on internal marlin
Test: (sanity) hangouts call on internal marlin
Test: warnings don't show up on BOARD_VNDK_VERSION := current devices.
Bug: 33241851
Change-Id: I2de1b789a44d238e31108312b4ec0dd5d404b1e6
commit e6653b5d failed to include devices (IN|OUT)_USB_HEADSET
in (IN|OUT)_ALL and (IN|OUT)_ALL_USB masks
Test: audio playback and capture regression tests on marlin
Change-Id: I218b0c3ff868f3e1434e93a9e2fb07b3e16a2df8
Add missing devices for USB headset to allow distinction
between USB sound cards and simple USB headsets.
Add output and input flags indicating special output
and input profiles to used for VoIP streams.
Test: make.
Change-Id: I7967866e15991dbf2f4349daa3ff3baa87c1c062
Java intermediates are now created in the common rather than the device-
specific generated sources subdirectory.
Bug: 33842609
Test: make
Change-Id: I16af4cd19bf0b24baa0ad9ebfdb86b4d959c8672
HALs are prohibited from using framework binder, and there is
no equivalent scheduling policy service in hwbinder. Thus, in order
to match priorities of FastCapture / Mixer threads with their
counterparts in the HAL, it is needed to request the priority boost
from audioflinger on behalf of the HAL.
Bug: 34131400
Change-Id: I7c8db9d520b4cf272d2896ad875752b109b57ab7
Test: check priority match between audioflinger's and hal's threads
Used hardware/interfaces/update-base-files.sh to update
file system/media/audio/include/system/audio-base.h
Test: make
Bug: 30947943
Change-Id: Id1f6971a1e40ab963c19f42a95516e6d8a26fc60
Translation between audio_offload_info_t and AudioOffloadInfo
was missing a field. This was causing compressed tracks to play
using 'deep_buffer' mode instead of 'offload'.
Changing output stream async callback methods to 'oneway',
since they don't require anything from the callee.
Change-Id: I27fe7fb715e421f102db21a10d34e1dc3134cf01
Test: play MP3 file with Play Music, check audioflinger dump