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
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>
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 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>
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>
What was done in this patch:
# move headers in all-versions/default folder for qualified inclusion
mkdir -p audio/effect/all-versions/include/effect/all-versions/default/
mv audio/effect/all-versions/*[hp] $_
# Go in the all-versions header folder
cd $_
# Use a macro for the version
sed -i '/^#/!s/V2_0/AUDIO_HAL_VERSION/g' *
#Remove 2.0 includes
sed -i "/include.*2.0/d" *
# Add include guard to make sure AUDIO_HAL_VERSION is set
sed -i '/limitations under the License/!b;N;a\n#include <common/all-versions/IncludeGuard.h>' *
# Remove guard include macro
sed -i '/^#.*[H_]$/d' *
# Remove LOG_TAG
sed -i '/LOG_TAG/d' *
# Remove local include (include "XXX")
sed -i '/include.*"/{N;/\n$/d;D}' *
# Replace implementation with inclusion
cd audio/effect/2.0/
git checkout HEAD^^
ls *h *cpp| sed -r 's/.*h$/\0 \0/;s/(.*)cpp/\1impl.h \0/' |xargs -L1 printf '1h;2,$H;$!d;g;s$namespace.*}[^\\n]*$#define AUDIO_HAL_VERSION V2_0\\\n#include <effect/all-versions/default/%s>\\\n#undef AUDIO_HAL_VERSION$\000%s\000'|xargs -0 -n2 sed -i
+ manual update of Android.bp and removal of duplicate include
Bug: 38184704
Test: compile
Change-Id: If99871516f3069fcb9e699ab670a665d7d507e7d
This will make diff much more clear and allow git to follow the files.
Bug: 38184704
Test: compile
Change-Id: I90deaad883a52ef8fbcd3109937f90d46d458f8c
Signed-off-by: Kevin Rocard <krocard@google.com>
This patch only contains cosmetic reformatting imposed by clang-format.
Bug: 38184704
Test: compile
Change-Id: If5e61eecd0a67fec19997792c9db73936ce7be2e
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>
Automatic mk -> bp conversion for all modules here
which can be converted and built automatically.
Test: Soong resolves all dependencies
Bug: 37512442
Change-Id: Ib789212cb88d55731397c600d132e7c672c0d8be
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>
This test now statically links to libs not guaranteed to be on the
device.
Bug: 64040096
Test: vts-tradefed run commandAndExit vts --skip-all-system-status-check
--primary-abi-only --skip-preconditions
--module VtsHalAudioEffectV2_0Target
Test: vts-tradefed run commandAndExit vts --skip-all-system-status-check
--primary-abi-only --skip-preconditions
--module VtsHalAudioV2_0Target
Change-Id: I331d7e4abdf7e520df6d508a8059b6358ad4398f
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
(cherry picked from commit 921d12ea6d)
Signed-off-by: Kevin Rocard <krocard@google.com>
If the device contains /vendor/etc/audio_effects.xml (the new XML
format for the audio effects configuration), the test validates
this config against the schema contained in
audio/effect/2.0/xml/audio_effects_conf_V2_0.xsd
(pushed to the device by the VTS test runner)
Change-Id: Ib57d30e3c1e32ce5d74f906a216f9bb8f635a28c
Test: this is a test
Bug: 37492580
The default stream is an alias to an other stream.
One can not allocate effects for it in the configuration
as it could conflict with the stream it aliases.
Test: run xmllint against all audio effect configs
Bug: 37492580
Change-Id: Ia2bbc13b5cf2a0a40e5eeff7ee22a7423ec16767
Signed-off-by: Kevin Rocard <krocard@google.com>
audio effects.conf legacy format had the libraries specified
in absolute path.
Nevertheless those libraries must be in specific folders.
The .conf loader used to strip the prefix of the paths then
try to load the libraries in those specific folders.
With new xml format the user only has to specify the name of the library
and the loader will load it from the known folders.
Test: run xmllint against a config with absolute paths
Bug: 37492580
Change-Id: I2863e04b3cdf0c6758d9f7be33796621fee527ed
Signed-off-by: Kevin Rocard <krocard@google.com>
Effect and effect proxy do not have the same xml structure.
As they had the same xml tag, it was impossible to discriminate them in
the xsd. Leading to xsd validating incorrect xml.
This patch changes the xsd to force proxy effect to have the type
<effectProxy> instead of <element>.
With this patch, effects have to be explicit about being a proxy and
they are forced to have a hw *and* a sw library.
Bug: 37492580
Test: validated xsd against converted effects.conf
Test: vendor/box/user/mnaganov/audio-effects-conf/test.sh
Change-Id: Idf8a1040feccbfd6a346ab9bc892f3b7e87df530
Signed-off-by: Kevin Rocard <krocard@google.com>
Add the configuration back on the master development branch.
This reverts commit d5196af814.
Bug: 37492580
Change-Id: Ie2d3218d942a995aec4d6b73fb7813e76604066b
Test: not needed