Commit graph

581 commits

Author SHA1 Message Date
Daniel Norman
fb4aadf622 Replaces 'oneshot' and 'interface' with 'onrestart restart audioserver'.
This default service should still restart on audioserver restart because
audioserver uses 'onrestart restart vendor.audio-hal-2-0' for restarts.

Bug: 138114550
Bug: 80227481
Test: for i in {0..100}; do \
      adb shell 'ps|grep audio;killall audioserver;ps|grep audio' \
      && sleep 2; \
      done
Test: Ran steps mentioned in http://b/80227481#comment1, device did not
get stuck in boot animation. Killing either audioserver or audio-hal
caused both to restart (just once) and the device booted correctly after
the sleep finished.
Change-Id: Ice128b51f79d3a9de22a719e6d897c8dca915e28
2019-07-31 21:08:02 +00:00
Steven Moreland
1ae4615d9f Update hidl makefiles for bpfmt
hidl-generated makefiles are now generated such that bpfmt(file) == file.

Bug: 67417008
Test: enable bpfmt hook
Change-Id: I1f69d292bc23a7cc293a66110cb02d597e1019ad
2019-04-17 09:38:50 -07:00
Steven Moreland
a878aee9ab Update makefies: no 'types'
Bug: 123976090
Test: N/A
Change-Id: I30fb04c81889b62775e1b764b965fdb0f893de17
2019-03-04 11:27:17 -08:00
Kevin Rocard
3cdb31ee57 Audio HAL: add address documentation
Test: compile
Change-Id: I108d512cf3381c5b87c76d152252050d309e46a6
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-02-26 09:00:23 -08:00
Steven Moreland
63bf69427b Make audio HAL consistent.
Bug: 124459302
Test: hidl-gen -Lcheck ...
Change-Id: I319fb00ef3a2da3944094228d4801bd9f88c16bb
Merged-In: Ie125d9bb014ee747ce56a59feaca577ab2d9e96c
2019-02-26 09:00:14 -08:00
Eric Laurent
955b94e1d5 [Master port]audio: add new audio formats
This patch ports a change to the HAL interfaces done in master in
order to have the same Audio common HAL interface in both AOSP and master.
This is needed as the Bluetooth HAL uses the audio common HAL and needs
to be frozen in the same state in both AOSP and MASTER.

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

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

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

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

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

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

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

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

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

Bug: 111454766
Bug: 124247199
Test: build
Change-Id: I00c28aa02473ce83b0d9b404b5cf33410c73a2c8
Merged-In: I00c28aa02473ce83b0d9b404b5cf33410c73a2c8
2019-02-15 01:50:28 +00:00
Treehugger Robot
f7b6c73725 Merge "Register Bluetooth Audio Hal v2 within Audio HAL" 2019-02-07 02:51:28 +00:00
Cheney Ni
4f6882ff4b Register Bluetooth Audio Hal v2 within Audio HAL
Register Bluetooth Audio Hal v2 by Audio HAL service so Bluetooth stack
can fetch the service interface as well.

Bug: 111519504
Test: manual

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

Bug: N/A
Test: N/A
Change-Id: Ibf87fad9981d4e430a0bf797feadbb0bede232fc
2019-02-05 13:14:26 -08:00
Victor Chang
58062e0d41 Remove the dependency on ICU
Static libxml2 no longer requires ICU4C. Remove
the depedency from the build file.

Bug: 121468463
Test: vts-tradefed run vts -m VtsHalAudioEffectV4_0Target
Test: vts-tradefed run vts -m VtsHalAudioV4_0Target
Merged-In: Ib843fb1071a634f25e27e5291b00d11852ac08a9
Change-Id: Ib843fb1071a634f25e27e5291b00d11852ac08a9
2019-01-31 14:05:15 +00: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
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
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
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
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
b2c093cecc Audio XSD: Allow vendor extension for audio devices
am: 0d5121609a

Change-Id: I8532884bd544fdce8680e0a14e3f3281f91931b6
2018-12-03 14:58:00 -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
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
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
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
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
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
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
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
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
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
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