Commit graph

786 commits

Author SHA1 Message Date
TreeHugger Robot
39b29ac05b Merge "VTS test for MicrophoneDirection API (HAL V 5.0)" 2019-01-30 21:14:42 +00:00
Paul McLean
0f1c40ce46 VTS test for MicrophoneDirection API (HAL V 5.0)
Bug: 121201996
Test: atest VtsHalAudioV5_0TargetTest

Change-Id: Icf8a054b50568f51a49b74f15de64232d1dc1c39
2019-01-30 11:17:00 -07:00
Jasmine Cha
4aa0f07420 Effects: add new effect volume flag
Add new effect flag to monitor requested volume from
audio framework.

Bug: 123251705
Test: on/off equalizer on spotify/google music
      switch songs with equalizer

Change-Id: Id89f6921923e7d55fa06c52579357fcd2f1c1fd0
Signed-off-by: Jasmine Cha <chajasmine@google.com>
2019-01-28 07:07:39 +00: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
Eric Laurent
a9ccf13d9b Merge "audio vts: update with new audio policy class" 2019-01-21 18:49:03 +00:00
Eric Laurent
7f877d427f audio vts: update with new audio policy class
Bug: 111812273
Test: make
Change-Id: I2daae7401269d2fff59f0ecf69a45b62873ef1a1
2019-01-19 14:53:55 -08:00
Tor Norbye
c9ea9f66de Update signature files to the new format
The new format is described in tools/metalava/FORMAT.md.

Fixes: 116589402 Switch signature files over to the v2 format
Fixes: 112626813 Drop "synchronized" modifier from the signature format
Fixes: 122358225 Omit overriding methods that only differ in final [...]
Fixes: 73088715 API Review: Need doclava to output nullability
Fixes: 79739773 API Review: Metalava enforcing constants are constant
Exempt-From-Owner-Approval: Large-scale tooling change
Test: make sdk, make update-api, make checkapi
Change-Id: I2943d9a65c24e7ca8fb9ae9b69f7edf06173f467
2019-01-18 22:09:18 -08:00
Tor Norbye
0074475ccf Update signature files to the new format
The new format is described in tools/metalava/FORMAT.md.

Fixes: 116589402 Switch signature files over to the v2 format
Fixes: 112626813 Drop "synchronized" modifier from the signature format
Fixes: 122358225 Omit overriding methods that only differ in final [...]
Fixes: 73088715 API Review: Need doclava to output nullability
Fixes: 79739773 API Review: Metalava enforcing constants are constant
Exempt-From-Owner-Approval: Large-scale tooling change
Test: make sdk, make update-api, make checkapi
Change-Id: I767f9fb2941789615c9513072a381e79a5654373
Merged-In: I2943d9a65c24e7ca8fb9ae9b69f7edf06173f467
2019-01-18 22:08:52 -08:00
TreeHugger Robot
1a6565607c Merge "audio: Add 'encodedFormats' field to 'devicePort'" 2019-01-19 00:14:29 +00:00
Mikhail Naganov
ee6772e138 audio: Add 'encodedFormats' field to 'devicePort'
This is used to specify the list of codecs that the device
supports.

Bug: 120860184
Test: xmllint --noout --xinclude --schema \
      hardware/interfaces/audio/5.0/config/audio_policy_configuration.xsd \
      frameworks/av/services/audiopolicy/config/audio_policy_configuration*.xml

Change-Id: Ifb80afed7947dc2332a8188defa86db98851188e
2019-01-18 11:13:38 -08:00
Michael Dooley
58828095fb Merge "Enabling sound trigger V2_2" 2019-01-18 04:00:39 +00:00
Paul Mclean
559f16e1b6 Merge "Adding Audio HAL V5: Direction API" 2019-01-17 21:34:35 +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
Paul McLean
d983fe2a86 Adding Audio HAL V5: Direction API
Bug: 119137468
Test: Testbed App

Change-Id: Ief74abab49b68ac13e0433f5fe29dd25379c7aec
2019-01-16 21:00:05 -07:00
Eric Laurent
20b0e102b0 Merge "add new audio sources for audio capture" 2019-01-16 23:58:05 +00: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
TreeHugger Robot
09ade87318 Merge "Add audio_effects_conf" 2019-01-16 04:32:30 +00:00
Mikhail Naganov
5404a00739 audio: Update source / sink metadata after opening stream
Since open input / output stream functions in legacy audio
HAL API do not have parameters for source / sink metadata,
make a call to update metadata right after opening a stream
in the default implementation.

Bug: 120859615
Test: audio still works
Change-Id: Ie81f861a024261a1f13fb6aa23976a92658e679c
2019-01-15 13:46:33 -08:00
Victor Chang
fdd3300306 Add libandroidicu as static lib in the VtsHalAudio
libxml2 now depends on libandroidicu.
Add the same dependency into the VTS.

TODO: b/121468463 to remove ICU from VtsHalAudio

Bug: 117094880
Test: m checkbuild
Merged-In: I105e7ad1517ecf8780adfb730650e1ad82f65857
Change-Id: I105e7ad1517ecf8780adfb730650e1ad82f65857
2019-01-08 19:40:59 +00:00
Sundong Ahn
1fce092b90 Add audio_effects_conf
This module is for API check of java file generated from
audio_effects_conf.xsd.

Bug: 80453829
Test: m -j && make update-api && make check-api
Change-Id: I0be0176a1d63db0ccc8c4bb38705a76a0070c981
2019-01-08 12:04:24 +09:00
Victor Chang
2c12b89651 Add libandroidicu as static lib in the VtsHalAudio
VtsHalAudio statically links libxml2.
libxml2 depends on libandroidicu now,
and it should statically links libandroidicu as well.

TODO: b/121468463 to remove ICU from VtsHalAudio

Bug: 117094880
Test: m checkbuild
Change-Id: I105e7ad1517ecf8780adfb730650e1ad82f65857
2019-01-02 17:01:20 +00: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
TreeHugger Robot
57efd5bd0d Merge "Audio HAL: Simplify types updates for 'common' and 'effect' packages" 2018-12-13 22:14:59 +00:00
Sundong Ahn
2280e96317 Merge "Add audio_policy_configuration" am: 0f2911a5d6 am: f7362ac27d
am: 79dc724ea0

Change-Id: I6b6739be513428b34cd33d018594f1b8fec834ac
2018-12-13 11:50:29 -08:00
Mikhail Naganov
3907f767d9 Audio HAL: Simplify types updates for 'common' and 'effect' packages
Instead of importing every single type individually ("using <type>"),
import entire namespaces of
::android::hardware::audio::common::CPP_VERSION and
::android::hardware::audio::effect::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

Test: make
Change-Id: I5daa0ed91203726d1df67408ac9af728c247704a
2018-12-13 09:42:17 -08:00
Treehugger Robot
0f2911a5d6 Merge "Add audio_policy_configuration" 2018-12-13 05:20:08 +00:00
Keun Soo Yim
d6fe421895 Merge "pack VTS cc_test binaries as general-tests" 2018-12-12 17:13:03 +00: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
TreeHugger Robot
315002043a Merge "Add haptic channel mask." 2018-12-11 17:33:03 +00:00
Sundong Ahn
3541f0a17b Add audio_policy_configuration
This module is for API check of java file generated from
audio_policy_configuration.xsd.
audio_policy_configuration.docs is added to required in
impl library because API check whenever building impl
library.

Bug: 80453829
Test: m -j && make update-api && make check-api

Change-Id: I49499ec244c390ed1e6e9e8ca77d08d7da69ac59
2018-12-11 11:21:53 +09:00
jiabin
df0f1c1e61 Add haptic channel mask.
Bug: 111454766
Test: build
Change-Id: I00c28aa02473ce83b0d9b404b5cf33410c73a2c8
2018-12-10 12:39:50 -08:00
Kevin Rocard
bbe017d750 Merge "Audio V5 XSD: Allow vendor extension for audio devices" am: c1892e6527 am: 7021af2045
am: 33a68081f9

Change-Id: I8bd9865817ab1f550edcf1cc6f29f727d16a684c
2018-12-07 13:31:46 -08:00
Treehugger Robot
c1892e6527 Merge "Audio V5 XSD: Allow vendor extension for audio devices" 2018-12-07 21:03:15 +00:00
Keun Soo YIM
68ae05dd2d pack VTS cc_test binaries as general-tests
Test: make general-tests
Bug: 120093339
Merged-In: I363450d205868f900e4925ccff1430e2a569f2a4
Change-Id: I363450d205868f900e4925ccff1430e2a569f2a4
2018-12-07 10:49:56 -08:00
Treehugger Robot
d8ebd25073 Merge changes from topic "audio-v5-api"
* changes:
  Audio V5: move Stream Metadata to common
  Audio HAL V5: Introduce HAL V5, equal to V4 for now
2018-12-04 17:44:07 +00:00
Kevin Rocard
7b7f206da4 Revert "Temporally remove audio V5 from the VNDK to save space"
This reverts commit 947bd54234.

Reason for revert: push V5 bash in the VNDK

Change-Id: Ic532b59bfcb234fb573390fd427754c2b63badcc
2018-12-04 02:33:41 +00:00
Kevin Rocard
947bd54234 Temporally remove audio V5 from the VNDK to save space
The HAL V5 is adding too much code that leads to maxing out the system
space on Pixel 1.
When a way to reduce the system file size will be found, the V5 will be
added back.

Test: compile
Change-Id: I479d63c325fd44c7b5c9d18b2b9a318ff56762fe
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-12-03 16:30:11 -08:00
Kevin Rocard
94b4aac252 Audio XSD: Allow vendor extension for audio devices am: 0d5121609a am: 0ac0b6b25a
am: 8333b96ead

Change-Id: I710966b5bc593597572779d4d199cd1c1630e4ef
2018-12-03 15:38:25 -08:00
Kevin Rocard
8333b96ead Audio XSD: Allow vendor extension for audio devices am: 0d5121609a
am: 0ac0b6b25a

Change-Id: I3ebc1bc8b8ac65c64f1caaff355afcce9faf45cd
2018-12-03 15:09:09 -08:00
Kevin Rocard
b2c093cecc Audio XSD: Allow vendor extension for audio devices
am: 0d5121609a

Change-Id: I8532884bd544fdce8680e0a14e3f3281f91931b6
2018-12-03 14:58:00 -08:00
Kevin Rocard
0ac0b6b25a Audio XSD: Allow vendor extension for audio devices
am: 0d5121609a

Change-Id: Ibd91421a27393c931a3c81f858b10291da624779
2018-12-03 14:55:58 -08:00
Kevin Rocard
0fecc8ded0 Audio V5 XSD: Allow vendor extension for audio devices
Without this patch vendors can not do any vendor extension extending
the audio enums as it would fails the XSD validation.

Long term, the config xml parsing should be moved in the HAL, until then
allow extension if they are prefixed with EX_.

Test: xmllint --noout --schema hardware/interfaces/audio/5.0/config/audio_policy_configuration.xsd  --xinclude out/target/product/*/vendor/etc/audio_policy_configuration.xml
Bug: 117967786
Change-Id: Ie44490824b5b50fdebb50a82299ea348d2a34b84
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-12-03 14:49:55 -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
681846f009 Audio VTS: Reset HAL after setConnectionState
There is no way of restoring the HAL state without restarting it.

Bug: 111681420
Test: atest VtsHalAudioV4_0TargetTest
      Check that the HAL is restarting after the test in the logcat
Change-Id: I9e3d9da08ed9e8dc25c7fc05c2bafa5455727508
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-11-28 20:29:52 -08:00
Kevin Rocard
575c63f7f0 Audio HAL: do not test input stream if no Built-in mic on primary
The test use to always test input stream, assuming that all devices had
built-in device on the primary Module.

Nevertheless, although uncommon, the mic could be on any module or even
not exist.

This patch makes sure that the input stream tests are only run if there
is a Built-in mic on the primary module.

As the policy config is now imported, it will be easy for the next HAL
version to add tests to test all supported audio config for each device.

Test: adb shell
      cd /data/nativetest64/VtsHalAudioV4_0TargetTest
      VtsHalAudioV4_0TargetTest --gtest_list_tests | grep Input
      VtsHalAudioV4_0TargetTest
      // Remove Mic from the available devices, the input tests should be skipped
      sed -i /item.*Built-In.Mic/d /vendor/etc/audio_policy_configuration.xml
      ! VtsHalAudioV4_0TargetTest --gtest_list_tests | grep Input
      VtsHalAudioV4_0TargetTest
      // Remove the primary hal, test should fail
      sed -i 's/"primary"/"notPrimary"/' /vendor/etc/audio_policy_configuration.xml
      ! VtsHalAudioV4_0TargetTest

Bug: 114303641
Bug: 111681420
Change-Id: Ibc1c1dadd6bcad18f184ab8c3bc75216c9f66adb
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-11-28 20:29:52 -08:00
Kevin Rocard
55a5b8b482 Audio VTS: Simplify sequential #if
Test: compile
Change-Id: Ie30b0df64d122a8cac0a5fc8b2ebc5255fccbc24
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-11-28 20:29:52 -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
d10247b7f2 Audio HAL: Update file tree documentation
Test: none, its doc
Change-Id: Ifc97425ca3bdc41d61c986e4e59b8b2733f3da9c
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
6166ef40f9 Audio VTS: Move version specific code to its own file
Move most version specific VTS in their own files.
Keeping the mostly common code in a header.

Bug: 118203066
Test: compile
Change-Id: I458e120c702cc0199104ec13244752d5587686bd
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
Keun Soo YIM
ff84c37bc1 pack VTS cc_test binaries as general-tests
Test: make general-tests
Bug: 120093339
Change-Id: I363450d205868f900e4925ccff1430e2a569f2a4
2018-11-27 16:11:41 -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
Kevin Rocard
0d5121609a Audio XSD: Allow vendor extension for audio devices
Without this patch vendors can not do any vendor extension extending
the audio enums as it would fails the XSD validation.

Long term, the config xml parsing should be moved in the HAL, until then
allow extension if they are prefixed with EX_.

Test: xmllint --noout --schema hardware/interfaces/audio/4.0/config/audio_policy_configuration.xsd  --xinclude out/target/product/*/vendor/etc/audio_policy_configuration.xml
Bug: 117967786
Change-Id: Ie44490824b5b50fdebb50a82299ea348d2a34b84
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-10-23 17:26:03 +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
Treehugger Robot
f06fb17cd7 Merge "Audio: Do not sanitize android.hardware.audio@2.0-service" 2018-10-12 00:56:46 +00:00
Mikhail Naganov
a48f128741 Merge "audio: Add a missing break to EffectsFactory::getAllDescriptors"
am: ef84854472

Change-Id: I47effe88ae8467f8570556ad56ced648abddc4d7
2018-10-11 15:27:22 -07:00
Mikhail Naganov
15eb7a6fa9 audio: Add a missing break to EffectsFactory::getAllDescriptors
Would the legacy HAL return -ENOENT while retrieving an effect,
the enumeration has to be aborted, and the effects queried so far
need to be returned. A missing 'break' was causing returning
no effects at all.

Bug: 117567478
Test: make
Change-Id: I7cc05004f88b39272d06d2ed33a0693f8e1e3d04
Merged-In: I7cc05004f88b39272d06d2ed33a0693f8e1e3d04
2018-10-11 12:21:27 -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
40e36fac61 audio: Add a missing break to EffectsFactory::getAllDescriptors
Would the legacy HAL return -ENOENT while retrieving an effect,
the enumeration has to be aborted, and the effects queried so far
need to be returned. A missing 'break' was causing returning
no effects at all.

Bug: 117567478
Test: make
Change-Id: I7cc05004f88b39272d06d2ed33a0693f8e1e3d04
2018-10-10 14:40:54 -07:00
Mikhail Naganov
cc3677997c audio: Add configuration for surround sound
Bug: 116356348
Test: xmllint --noout --xinclude --schema \
  hardware/interfaces/audio/4.1/config/audio_policy_configuration.xsd \
  frameworks/av/services/audiopolicy/config/audio_policy_configuration.xml

Change-Id: Ib8d84b950f439c2ebed181385b41a83556976e60
2018-10-04 15:59:37 -07:00
Mikhail Naganov
16e37eb7ca audio: Copy audio_policy_configuration.xsd for HAL V4.1
This only copies the file to simplify reviewing additons

Bug: 116356348
Test: N/A
Change-Id: Idbc1489163f0ea8938ff5c32499d22ddbf8fc12d
2018-10-04 15:56:22 -07:00
Kevin Rocard
4f62e23dd5 Audio VTS: Do not constrain implementation frameCount am: 069bc45044 am: b86e285537
am: e029bd11f8

Change-Id: Ia2c98e461ee7a39ef56e0f1b6e2dd85c446b6216
2018-10-03 16:28:44 -07:00
Kevin Rocard
c2e7ace98d Audio VTS: Do not constrain implementation frameCount am: 069bc45044
am: 5596e985d4

Change-Id: Idf051c458d74057425ec3c13227fa31190535e18
2018-10-03 16:23:21 -07:00
Kevin Rocard
e029bd11f8 Audio VTS: Do not constrain implementation frameCount am: 069bc45044
am: b86e285537

Change-Id: Id3c6275cdb5c9de079c425d8f252a6f3e9ac7b99
2018-10-03 16:22:39 -07:00
Kevin Rocard
b86e285537 Audio VTS: Do not constrain implementation frameCount
am: 069bc45044

Change-Id: I53dceebb8c48c1f67b6fdc6fa135be8f5222f823
2018-10-03 16:15:35 -07:00
Kevin Rocard
5596e985d4 Audio VTS: Do not constrain implementation frameCount
am: 069bc45044

Change-Id: I3ec1df7f581e5b11e0d394139c1421109c16fc19
2018-10-03 16:15:32 -07:00
Kevin Rocard
069bc45044 Audio VTS: Do not constrain implementation frameCount
The test was assuming Stream::getFrameCount() would return the
AudioConfig::frameCount used to create the stream, similarly
to the sampleRate or the channelMask.

Nevertheless this is not the case as the AudioConfig::frameCount
field is not to used by Stream::openOutputStream (nor Input) as
the buffer size is chosen by the HAL, not the framework.

Thus the test can not assume the frameCount chosen by the HAL and
must not test for a particular value.

Test: atest VtsHalAudioV4_0TargetTest
Bug: 116169974
Change-Id: Ibbf0825f540957e01e7c512d851cb9628991f4c4
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-10-02 22:07:39 +00:00
jiabin
5253af2570 Test getActiveMicrophones API when mic is found on the device. am: 497edcc026
am: c17b71ff83

Change-Id: I0b278f2a9d6c7df71c835c88f7d34bd98a540fb0
2018-09-27 12:00:40 -07:00
jiabin
798e34e901 Test getActiveMicrophones API when mic is found on the device. am: 497edcc026
am: b2925defca

Change-Id: I290751baf02aefdf7a1bac6ea12f489a1a368c84
2018-09-27 11:43:31 -07:00
jiabin
c17b71ff83 Test getActiveMicrophones API when mic is found on the device.
am: 497edcc026

Change-Id: I55a1ab98ef141b9834ec22491b31e09f581fca1a
2018-09-27 11:39:22 -07:00
jiabin
b2925defca Test getActiveMicrophones API when mic is found on the device.
am: 497edcc026

Change-Id: I459a73cb4bcda15964aa1f614066cb19e2a2424a
2018-09-27 11:36:13 -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
jiabin
497edcc026 Test getActiveMicrophones API when mic is found on the device.
Before this patch the default microphone was required to have characteristics
although it is not always an attached device, thus its characteristics can not
be known by the HAL. Additionally, the HAL might not know the active
microphone info of a input stream if it has not been started yet.

This patch only tests microphones which characteristics are reported by the HAL
and start the input stream before requesting active microphones.

Bug: 109787938
Test: vts-tradefed run vts --module VtsHalAudioV4_0Target
Change-Id: If55bfc8210d4f9443d34951f717c6772b46dde04
Merged-In: If55bfc8210d4f9443d34951f717c6772b46dde04
2018-09-26 10:05:15 -07:00
Kevin Rocard
426bea313a resolve merge conflicts of 2e32d37877 to master
Test: I solemnly swear I tested this conflict resolution.
Bug: None
Change-Id: I393be9e597ff1f72ec2c71efbbbc8e518398190a
2018-09-21 12:03:28 -07:00
Kevin Rocard
8fe2bf8075 Audio VTS: Workaround async HIDL destructor by sleeping am: d87a288e82
am: 921724c2c9

Change-Id: I9ab85b9f46cc7daf0a9414594654d0dded10307c
2018-09-20 23:14:18 -07:00
Kevin Rocard
2e32d37877 Audio VTS: Workaround async HIDL destructor by sleeping am: d87a288e82
am: 988c4a3f48

Change-Id: I86f1f3d76a79449eb87f4ea193cbb52f4a73768a
2018-09-20 17:55:26 -07:00
Kevin Rocard
988c4a3f48 Audio VTS: Workaround async HIDL destructor by sleeping
am: d87a288e82

Change-Id: Ic39282f908d2b73fb04f755264090e701cf4019f
2018-09-20 10:54:46 -07:00
Kevin Rocard
921724c2c9 Audio VTS: Workaround async HIDL destructor by sleeping
am: d87a288e82

Change-Id: I6af4b725b9917d99c450287ba4bfce864371a104
2018-09-20 10:48:42 -07:00
Kevin Rocard
d87a288e82 Audio VTS: Workaround async HIDL destructor by sleeping
The test creates an instance of the Audio HAL then destroys it and create it again.
The test assumed that the destruction was synchronous when in fact it is async with
no way of knowing when the object has been destroyed.

As a result, until a better solution is found, sleep for 100ms to hopefully let enouth
time for the HAL destructor to return.

Bug: 112566489
Test: adb shell /data/nativetest64/VtsHalAudioV4_0TargetTest/VtsHalAudioV4_0TargetTest --gtest_filter=*OpenPrimaryDeviceUsingGetDevice
      atest VtsHalAudioV4_0TargetTest
Change-Id: I0ec75c12007d39060232632708722df5bf0f99d7
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-09-19 18:27:15 +00:00
Kevin Rocard
47b05b57b4 Merge "Audio VTS: Always check for Result::isOk()" into pie-vts-dev am: 2070f8b0b8 am: 3af66411da
am: 1a684e29da

Change-Id: I4e62224eda7a1b824b54356a72f9be3d2c218c81
2018-09-18 11:22:27 -07:00
Kevin Rocard
89425b1e86 Merge "Audio VTS: Always check for Result::isOk()" into pie-vts-dev am: 2070f8b0b8
am: c23b3a5dda

Change-Id: I736d5d3749a57569cee362e1b627ad9ac695b5d0
2018-09-18 11:12:54 -07:00
Kevin Rocard
1a684e29da Merge "Audio VTS: Always check for Result::isOk()" into pie-vts-dev am: 2070f8b0b8
am: 3af66411da

Change-Id: I08841ccfa99aedec0de6aa1752f39cb5530b26c7
2018-09-18 11:06:53 -07:00
Kevin Rocard
3af66411da Merge "Audio VTS: Always check for Result::isOk()" into pie-vts-dev
am: 2070f8b0b8

Change-Id: Ibf74dbc43a0e91121752bc1fd2e48ee534cb7f4e
2018-09-18 11:01:56 -07:00
Kevin Rocard
c23b3a5dda Merge "Audio VTS: Always check for Result::isOk()" into pie-vts-dev
am: 2070f8b0b8

Change-Id: Icf4a294d1fef7626b8248500dffc6bcd0189571e
2018-09-18 10:57:50 -07:00
Kevin Rocard
e8957a35ea Audio VTS: Always check for Result::isOk()
A test was not checking for the Result::isOk() resulting
in an assert being triggered in HIDL code if the HAL crashed.

Test: (sleep 0.3; adb shell pkill audio) &
      adb shell /data/nativetest64/VtsHalAudioV4_0TargetTest/VtsHalAudioV4_0TargetTest
      # Test finishes in failure but does not crash
Signed-off-by: Kevin Rocard <krocard@google.com>

Change-Id: I97a6213fe82a5e9a6eb333dc1dc2476102610b58
2018-09-06 18:22:23 +00:00
Kevin Rocard
30c2361ad4 Merge "Allow getCapturePosition to return 0 frames for unprepared streams" into pie-vts-dev
am: 137194ef5e

Change-Id: Ibef9acb447f71a94c27ad62ffd93b87126637143
2018-08-30 10:22:35 -07:00
Kevin Rocard
eb2b0093cf Allow getCapturePosition to return 0 frames for unprepared streams
For device supporting getCapturePosition,
VTS only allowed unprepared stream to return INVALID_STATE.
Now also allow for the stream to return 0 frames similarly to the other
non started states.

Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target
Bug: 110367728
Cherry-piked from: d01dc3edac9e92981e7ae419d0e7622f753acf94
Merged-In: Ibdf8df8cb8809e98c40a50035371df6893fe4da4
Change-Id: Ibdf8df8cb8809e98c40a50035371df6893fe4da4
Signed-off-by: Kevin Rocard <krocard@google.com>
(cherry picked from commit 6c9c6e62c1)
2018-08-29 10:29:07 -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
2642ddb86f Merge "VTS: Do not require XML for Audio effect V2" into pie-vts-dev
am: 5e6dd1288e

Change-Id: If389674923030e041dfdb95cd99cd0316603c917
2018-08-28 12:25:23 -07:00
Treehugger Robot
5e6dd1288e Merge "VTS: Do not require XML for Audio effect V2" into pie-vts-dev 2018-08-28 19:13:44 +00:00
Kevin Rocard
94b543c03c Merge "Audio VTS was testing wrong uninitialized variable due to typo" into pie-vts-dev
am: b3e86d489a

Change-Id: I13b546ec0e8785040e4096a7658474f2eff6c90e
2018-08-28 12:03:40 -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
8073d8e41c Audio VTS was testing wrong uninitialized variable due to typo
The test was testing a uninitialized variable instead of testing
the result of the tested method.

Bug: 110963314
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target
Merged-In: I9a212eef690ae627fd7f7dbfaf4a0b4047c491b3
Change-Id: I9a212eef690ae627fd7f7dbfaf4a0b4047c491b3
Signed-off-by: Kevin Rocard <krocard@google.com>
(cherry picked from commit 72641e7ad0)
2018-08-28 17:46:41 +00:00
Kevin Rocard
8a452029f9 Effect VTS: Allow an effect proxy as pre/post processing am: 0f0328fc4e
am: a3268e954d

Change-Id: Ic9afa418ca68ed98368ab4696c4d3a3e5e8ccbdb
2018-08-20 11:21:39 -07:00
Kevin Rocard
a3268e954d Effect VTS: Allow an effect proxy as pre/post processing
am: 0f0328fc4e

Change-Id: I570e2a73de01900cf39b5d08cfed370ee17a0e38
2018-08-20 11:13:35 -07:00
Kevin Rocard
7a25163fff Merge changes from topic "share-buffer" am: 54c3572e99 am: 0005ac0e55
am: f09c8e2d49

Change-Id: Ia853174e0443417ec6406a8a03a551e3e86c7ddd
2018-08-17 18:43:28 -07:00
Kevin Rocard
f09c8e2d49 Merge changes from topic "share-buffer" am: 54c3572e99
am: 0005ac0e55

Change-Id: I143d8e7a6bb7896641d50e336885523219da254f
2018-08-17 17:58:04 -07:00
Kevin Rocard
a0b6b5d066 Aaudio: Implement app shareable flag instead of -size hack am: 51cdd13351
am: 616d82ddc6

Change-Id: Iaff977fb8cbd4fdf720bec18b16bee8addc45f74
2018-08-17 17:57:50 -07:00
Kevin Rocard
0005ac0e55 Merge changes from topic "share-buffer"
am: 54c3572e99

Change-Id: I4a8bb74e3dee81cdd0fc478c49acd0771467f227
2018-08-17 17:13:35 -07:00
Kevin Rocard
616d82ddc6 Aaudio: Implement app shareable flag instead of -size hack
am: 51cdd13351

Change-Id: Ifbf493566c45e003ddba23996c8722f3f4c74d4f
2018-08-17 17:13:19 -07:00
Treehugger Robot
54c3572e99 Merge changes from topic "share-buffer"
* changes:
  Audio default HAL: hidl_memory size must be positive
  Aaudio: Implement app shareable flag instead of -size hack
2018-08-17 23:03:44 +00:00
jiabin
d03e8f0848 Test getActiveMicrophones API when mic is found on the device.
Before this patch the default microphone was required to have characteristics
although it is not always an attached device, thus its characteristics can not
be known by the HAL. Additionally, the HAL might not know the active
microphone info of a input stream if it has not been started yet.

This patch only tests microphones which characteristics are reported by the HAL
and start the input stream before requesting active microphones.

Bug: 109787938
Test: vts-tradefed run vts --module VtsHalAudioV4_0Target
Change-Id: If55bfc8210d4f9443d34951f717c6772b46dde04
2018-08-16 13:34:36 -07:00
Kevin Rocard
86910f0fc5 Audio default HAL: hidl_memory size must be positive
hidl_memory size is not used on the framework side but is checked by the
hidl framework to be a sensible value.
Due to a hack in O and P, the value can be negative, this leads to
errors in HIDL.

This patch make sure the hidl_memory size is always positive and thus
not affected by the hack.

Test: adb shell data/nativetest64/write_sine/write_sine -pl -m3 -x
Bug: 38118159
Change-Id: Ie53c46c558e8042d74ee32b55219195da82e4bcc
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-08-15 18:06:00 +00:00
Kevin Rocard
202bc18e0b Audio VTS: run tear-down hooks in LIFO instead of FIFO am: cfab8dac2b
am: 5381192973

Change-Id: Icb1940e1a6b8c9f4fe053f71dfadc52bb9e59fe0
2018-08-10 14:45:37 -07: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
51cdd13351 Aaudio: Implement app shareable flag instead of -size hack
Test: adb shell data/nativetest64/write_sine/write_sine -pl -m3 -x
Bug: 38118159
Change-Id: I2e2fc5801ee9f45565be6f989c0d83d0fdf54618
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-08-10 18:27:35 +00:00
Kevin Rocard
9d7cb65c6b Aaudio: Implement app shareable flag instead of -size hack
Test: adb shell data/nativetest64/write_sine/write_sine -pl -m3
Bug: 38118159
Change-Id: I2e2fc5801ee9f45565be6f989c0d83d0fdf54618
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-08-02 23:49:07 +00: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
330410e82a Merge "VTS: Do not require XML for Audio effect V2" into pi-dev
am: ad3acdc14f

Change-Id: I4946fed2a24ad401a545ba3048b5940272b169fe
2018-07-23 09:50: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
Kevin Rocard
88897fee5e Effect VTS: Allow an effect proxy as pre/post processing am: 0f0328fc4e am: f06d4203ac am: 80abca52de
am: f409d95ffb

Change-Id: I4aec3a9241e645c4e4be977c52c50995c9ea9ff1
2018-07-20 07:26:01 -07:00
Kevin Rocard
f409d95ffb Effect VTS: Allow an effect proxy as pre/post processing am: 0f0328fc4e am: f06d4203ac
am: 80abca52de

Change-Id: I440804ea73eb4f658146e1fa26957d2f407f00c8
2018-07-20 07:22:34 -07:00
Kevin Rocard
80abca52de Effect VTS: Allow an effect proxy as pre/post processing am: 0f0328fc4e
am: f06d4203ac

Change-Id: I1e3b1296c0943f65c57b448d25bcbe4c2bd95239
2018-07-20 07:18:32 -07:00
Kevin Rocard
0f0328fc4e Effect VTS: Allow an effect proxy as pre/post processing
Effect proxy were previously mistakenly forbidden as post
or pre processing effects.

An effect being a proxy or not should not affect where
it can be use in the effect framework.

Bug: 111421676
Test: xmllint --noout --schema hardware/interfaces/audio/effect/2.0/xml/audio_effects_conf_V2_0.xsd $(find -name audio_effects.xml)
Change-Id: Iad1c1467226b86a2935a36dd90cf2e32f7f753b0
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-07-19 09:04:21 -07: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
de8ad1bdb3 Merge "audio: add wakelock capability for audiohalservice" into pi-dev
am: 3ce3c9127a

Change-Id: I59b839464d1621c95f585b0eb27009b2867d08a9
2018-07-17 14:09:40 -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
c423162322 Audio VTS: run tear-down hooks in LIFO instead of FIFO am: cfab8dac2b am: 4595c66a1e am: 714ddf05d7
am: 28694c26b1

Change-Id: Ic82a4d787843d99f9818686b7241eb2ca97624cb
2018-06-29 15:15:05 -07:00
Kevin Rocard
28694c26b1 Audio VTS: run tear-down hooks in LIFO instead of FIFO am: cfab8dac2b am: 4595c66a1e
am: 714ddf05d7

Change-Id: If85c80c65a2e42eb1f91739a3d65f0d0cc1d0bcb
2018-06-29 14:57:31 -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
Kevin Rocard
4c93e5b2ca Audio VTS was testing wrong uninitialized variable due to typo am: 72641e7ad0
am: 1fd78abb44

Change-Id: I92a62d7fe6f12087b481f095655bfbcb753a52c8
2018-06-28 20:07:34 -07:00
Kevin Rocard
1fd78abb44 Audio VTS was testing wrong uninitialized variable due to typo
am: 72641e7ad0

Change-Id: I590efc99f853e1db7fa0747f9c91946913bb3679
2018-06-28 20:03:20 -07:00
Kevin Rocard
72641e7ad0 Audio VTS was testing wrong uninitialized variable due to typo
The test was testing a uninitialized variable instead of testing
the result of the tested method.

Bug: 110963314
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target
Change-Id: I9a212eef690ae627fd7f7dbfaf4a0b4047c491b3
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-06-29 01:36:46 +00:00
Kevin Rocard
923383bf43 Merge "Allow getCapturePosition to return 0 frames for unprepared streams" into pi-dev am: 9d114dbf88
am: 4c3731d522

Change-Id: Ia1ed9cf9f0a46d3a5b13623a456931633b991cab
2018-06-26 12:34:15 -07:00
Kevin Rocard
4c3731d522 Merge "Allow getCapturePosition to return 0 frames for unprepared streams" into pi-dev
am: 9d114dbf88

Change-Id: I18581d63b035e39bbfaf1b8e6b4136f44f792fca
2018-06-26 12:28:19 -07:00
Kevin Rocard
6c9c6e62c1 Allow getCapturePosition to return 0 frames for unprepared streams
For device supporting getCapturePosition,
VTS only allowed unprepared stream to return INVALID_STATE.
Now also allow for the stream to return 0 frames similarly to the other
non started states.

Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target
Bug: 110367728
Cherry-piked from: d01dc3edac9e92981e7ae419d0e7622f753acf94
Change-Id: Ibdf8df8cb8809e98c40a50035371df6893fe4da4
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-06-26 10:29:12 -07:00
Kevin Rocard
0f8133feeb Do not log error on open output/input stream negotiation
The HAL has a negotiation mechanism where if an open output/input
stream is made with unsupported parameters, it will return
a valid config and UNSUPPORTED_PARAMETRS.
This negotiation was confusingly logged as error.

Test:  "adb logcat -s DeviceHAL" show no error on successful
       playback/capture
Change-Id: I5383cdcfdf8a0ca66768ffc106a1b651b9d8b2d1
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-06-21 15:44:39 -07:00
TreeHugger Robot
5c18032ce1 Merge "Fix getActiveMicrophones vts failure." 2018-06-09 01:01:18 +00:00
jiabin
ae3196f757 Fix getActiveMicrophones vts failure.
As there could be no mic on the device, the active microphones may not
always exist. With currently implementation in qcom hal, we need to
start the stream to have active microphones. In that case, just check
the return value of the call.

Bug: 109787938
Test: vts-tradefed run vts --module VtsHalAudioV4_0Target
Change-Id: Ia9f5160a278d6c788f8f5eb17b8b276fe1d66076
2018-06-08 15:02:08 -07:00
Mikhail Naganov
d74577f271 Merge "audio hal: Add 'interface' declarations for IDeviceFactory into .rc" into pi-dev am: 4f0635a2a9
am: 1d33a8788d

Change-Id: I0fa35e0c56328f2ec33d6e34d253608706ef1fb4
2018-05-29 12:32:06 -07:00
Mikhail Naganov
1d33a8788d Merge "audio hal: Add 'interface' declarations for IDeviceFactory into .rc" into pi-dev
am: 4f0635a2a9

Change-Id: I66586d84d276370f2fdc863f3795e8cf2e45623e
2018-05-29 12:04:43 -07: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
Steven Moreland
39faf7e2ed Merge "Update comments for doc comments." into pi-dev am: cce4c95c1c
am: cbc30e1f58

Change-Id: I9f7d33cdd3c40e28c0341df2e8a8bd298ec52b79
2018-05-18 18:55:50 -07:00
Steven Moreland
cbc30e1f58 Merge "Update comments for doc comments." into pi-dev
am: cce4c95c1c

Change-Id: Id691cf973a214ee1d2f62297c13c8c030fc7a8bb
2018-05-18 18:43:45 -07:00
TreeHugger Robot
cce4c95c1c Merge "Update comments for doc comments." into pi-dev 2018-05-19 01:32:44 +00:00
Steven Moreland
4ee4582230 Update comments for doc comments.
Doc comments look like "/** ... */" and they
can only be in certain places.

Bug: 79865343
Test: m
Change-Id: Ic15c08ff7dc6e4f9827c1dbe7f7236c11a572ec1
2018-05-18 10:10:32 -07:00