Commit graph

416 commits

Author SHA1 Message Date
Zhuoyao Zhang
f62c91f057 Convert audio hal test to use VtsHalHidlTargetTestEnvBase
Bug: 64203181
Test: make vts
      vts-tradefed run vts -m VtsHalAudioV2_0Target

Change-Id: I1f85216c992eabf70f7e907b5d2afc4fb59cbb4a
2018-01-23 18:20:56 -08:00
TreeHugger Robot
c44621da83 Merge "soundtrigger: Fall back to V2.0 if V2.1 is not present" 2018-01-22 23:55:28 +00:00
Mikhail Naganov
ce8d65b5ef soundtrigger: Fall back to V2.0 if V2.1 is not present
A device may not be configured to ship with ST V2.1 impl,
in this case the device will stuck in a boot loop because the
framework will be attempting to instantiate ST, but the
service will not have ST server side registered.

Since the service code is the same for all devices,
allow a fallback to ST V2.0. This way, if only V2.0 is present
on the device, it will be registered, and the framework
will find it. The actual version used can be determined by
examining output of 'lshal' command.

Also remove obsolete dependency on broadcast radio.

Bug: 63600413
Bug: 68823037
Test: Try taimen both with ST V2.0 and V2.1 impls
Change-Id: I484659b1df5a7e4b11db91d0cf75a7079786c766
2018-01-22 13:31:36 -08:00
Kevin Rocard
740224e3e0 Audio V4: move 2.0/vts to core/2.0/vts to match effect's vts
Move in order to adhere to the new folder organisation.

Bug: 38184704
Test: compile
Change-Id: I7398cab951ee628782f81098b57b04a1402b4041
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
fd79d157e7 Audio V4: Fix issues in the core vts raised by clang-format
This patch only contains cosmetic reformatting imposed by clang-format.

Bug: 38184704
Test: compile
Change-Id: Ic2a2386b976cf1df1e4e062b45688cd6115541d3
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
3887e24436 Audio V4: Rename audio/device to audio/core
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>
2018-01-20 10:49:57 -08:00
Kevin Rocard
62588b69f6 Audio V4: Make effect default wrapper device independent
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
2018-01-20 10:49:57 -08:00
Kevin Rocard
1bd2a336bc Audio V4: Move the legacy effect wrapper before refactor
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>
2018-01-20 10:49:57 -08:00
Kevin Rocard
22505e6bf1 Audio V4: Fix issues in the effect legacy wrapper raised by clang-format
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>
2018-01-20 10:49:57 -08:00
Kevin Rocard
e9e4e16564 Audio V4: Make device default wrapper device independent
Bug: 38184704
Test: compile
Change-Id: I077d2d6176ba5d60c1994345b3164641ed5b4608
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
994705966e Audio V4: Move the legacy wrapper before refactor
This will make diff much more clear and allow git to follow the files.

Bug: 38184704
Test: compile
Change-Id: I946b20254dcda1cb31b48898d0b5f46b185ebafe
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
82cb03632c Audio V4: Fix issues in the legacy wrapper raised by clang-format
This patch only contains cosmetic reformatting imposed by clang-format.

Bug: 38184704
Test: compile
Change-Id: I57545f2b8de1e982028ef4794328741d91682e0c
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
cb9827c072 Audio V4: Transition legacy wrapper to Android.bp
Bug: 38184704
Test: compile
Change-Id: I950b3c38e1ae8093414ce1054a8530047a81ccca
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
1ae0401179 Audio V4: Move common test code in common folder
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>
2018-01-20 10:49:57 -08:00
Kevin Rocard
b34af7c192 Audio V4: Make test helper version independent
Bug: 38184704
Test: compile
Change-Id: Ia9ec81ccbad1d7411fdc570ae6dd728dd1520065
2018-01-20 10:49:57 -08:00
Kevin Rocard
6891d7ec28 Audio V4: Make common helper version independent
The implementation uses the version provided by macro.

Bug: 38184704
Test: compile
Change-Id: Ib5565bdf77ed9e42fc8271a4317eb88681aefcd5
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
649142becc Audio V4: Move common files before refactor
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>
2018-01-20 10:49:57 -08:00
Kevin Rocard
dc874e08c6 Audio V4: Fix issues in common raised by clang-format
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>
2018-01-20 10:49:57 -08:00
Mikhail Naganov
5697a9b27a soundtrigger: Switch audio service to load soundtrigger 2.1
Bug: 68823037
Test: check /proc/.../maps of android.hardware.audio@2.0-service
Change-Id: Ie244ca4ea548bdad8116d0a9f267bb41a6a6d50d
2018-01-19 10:43:39 -08:00
Steven Moreland
43ca3b0a37 Merge "Update makefiles for audio." am: e5b3e4b869 am: b87db68677
am: 55113b8256

Change-Id: I7c99c9450f8ac12fcd08cded9da31b1c89a6b474
2018-01-18 01:21:44 +00:00
Steven Moreland
55113b8256 Merge "Update makefiles for audio." am: e5b3e4b869
am: b87db68677

Change-Id: I30ba693f50ce05e4fe083e24be17bb5f8a3f13dd
2018-01-18 01:12:41 +00:00
Steven Moreland
11f290b1ba Update makefiles for audio.
This dependency is imported but not used, so it should technically
go in the Android.bp file.

Bug: 71863483
Test: none
Change-Id: I3ee391bdea47182689156b3243b75a3572f7d8bf
2018-01-17 11:25:24 -08:00
Mikhail Naganov
c098c15065 audio: Fix StreamOut ownership in default wrapper am: 718b510080 am: 890deeed1e
am: 9a58cc7b4c

Change-Id: Id350abe5d8d7b88334cbe11b56a4a37864c8f397
2017-12-22 00:11:12 +00:00
Mikhail Naganov
9a58cc7b4c audio: Fix StreamOut ownership in default wrapper am: 718b510080
am: 890deeed1e

Change-Id: I8a45ce49f6f0695a2be2f74e4a103efd6ce3483a
2017-12-22 00:03:36 +00:00
Mikhail Naganov
718b510080 audio: Fix StreamOut ownership in default wrapper
StreamOut::asyncCallback could became an owner of StreamOut
causing the destructor to be called on the offload callback
thread, while the legacy HAL is holding a mutex, which resulted
in a deadlock.

Removed erroneous usage of sp<StreamOut> in asyncCallback.
The legacy HAL joins the offload callback thread when closing
output stream, thus StreamOut destructor is guaranteed to finish
only after the offload callback thread has exited, and using
a raw pointer to StreamOut inside asyncCallback is correct.

Bug: 70863217
Change-Id: I0d77018cf3df5ad07251732733288d425dd836eb
Test: manual
2017-12-21 13:21:58 -08:00
Kevin Rocard
30944c7a73 Merge changes from topic "b/69811500" into oc-dev am: 61ae0a1fc7 am: d7d5d7a22d am: abec925f05
am: d7042bba2b

Change-Id: I7265aa584b13ddc16e690b94f1976f6aaf5b91fa
2017-12-07 05:54:12 +00:00
Kevin Rocard
27dfaa0941 Audio policy config: remove cross-module device port name uniqueness am: 503c3e0a4e am: c5ce355c24 am: e8e9cdcf5e
am: a0e6bbe78b

Change-Id: I7291fcf545bea544cafb81c47339de78ae9518db
2017-12-07 05:53:16 +00:00
Kevin Rocard
c66afe5dad Audio policy config: Device port (type,address) must be unique am: fa1f597442 am: d4112727b7 am: 7c7fc0c69a
am: ead5a3bed3

Change-Id: Ia7edf22a48118eb062f83ba355b948a8e5c4ab5b
2017-12-07 05:53:05 +00:00
Kevin Rocard
db6cdc5282 Audio policy config: allow vendor to extend module name am: 7558e8c6e4 am: ec55b2f024 am: 540748bc80
am: c8ef2e0e44

Change-Id: Iaceb3864f283f22e85c5f4332256b43ed709f82f
2017-12-07 05:52:55 +00:00
Kevin Rocard
d7042bba2b Merge changes from topic "b/69811500" into oc-dev am: 61ae0a1fc7 am: d7d5d7a22d
am: abec925f05

Change-Id: If1f7ce2a3bf45bfa5b147fe8f21eac21b5516f0b
2017-12-06 20:33:38 +00:00
Kevin Rocard
abec925f05 Merge changes from topic "b/69811500" into oc-dev am: 61ae0a1fc7
am: d7d5d7a22d

Change-Id: Id4c64ec8339a7a4112b482a3cef33095c3dabc79
2017-12-06 20:31:08 +00:00
Kevin Rocard
d7d5d7a22d Merge changes from topic "b/69811500" into oc-dev
am: 61ae0a1fc7

Change-Id: I8d3e90d9695330b87f8e93dff84b752ec18e5254
2017-12-06 20:28:07 +00:00
TreeHugger Robot
61ae0a1fc7 Merge changes from topic "b/69811500" into oc-dev
* changes:
  Audio HAL: Allow setters to not be implemented
  Audio VTS: HAL can support more than the native sampling rates
2017-12-06 20:18:12 +00:00
Kevin Rocard
a0e6bbe78b Audio policy config: remove cross-module device port name uniqueness am: 503c3e0a4e am: c5ce355c24
am: e8e9cdcf5e

Change-Id: Ieec5791e1864d87ea26a1743f4543d0ff07c2825
2017-12-06 19:51:18 +00:00
Kevin Rocard
ead5a3bed3 Audio policy config: Device port (type,address) must be unique am: fa1f597442 am: d4112727b7
am: 7c7fc0c69a

Change-Id: I669ff1e8e32b7e539d33d8f1a05ee06962836e60
2017-12-06 19:51:05 +00:00
Kevin Rocard
c8ef2e0e44 Audio policy config: allow vendor to extend module name am: 7558e8c6e4 am: ec55b2f024
am: 540748bc80

Change-Id: I7f0627e930fc7a8fe13ac13f708d0972c5747b23
2017-12-06 19:50:51 +00:00
Kevin Rocard
e8e9cdcf5e Audio policy config: remove cross-module device port name uniqueness am: 503c3e0a4e
am: c5ce355c24

Change-Id: I1e9225d0acd5515890fec9bc259b39f26b3c8e5e
2017-12-06 19:36:16 +00:00
Kevin Rocard
7c7fc0c69a Audio policy config: Device port (type,address) must be unique am: fa1f597442
am: d4112727b7

Change-Id: I4d24d58034d3a39fee66308b44620c956ad5c345
2017-12-06 19:36:08 +00:00
Kevin Rocard
540748bc80 Audio policy config: allow vendor to extend module name am: 7558e8c6e4
am: ec55b2f024

Change-Id: Ic7c5de5e7c215c43f2ea044a38bbf52ee71984ca
2017-12-06 19:36:03 +00:00
Kevin Rocard
c5ce355c24 Audio policy config: remove cross-module device port name uniqueness
am: 503c3e0a4e

Change-Id: Ibeef7dd1ad8db4a55b9e323c07d3a499289f7d73
2017-12-06 19:30:49 +00:00
Kevin Rocard
d4112727b7 Audio policy config: Device port (type,address) must be unique
am: fa1f597442

Change-Id: I03176086075fb2c2911edf3a470b0319cb8648b6
2017-12-06 19:30:44 +00:00
Kevin Rocard
ec55b2f024 Audio policy config: allow vendor to extend module name
am: 7558e8c6e4

Change-Id: I2acafb47c986e5886b0bacc0bb6c6419feae69e5
2017-12-06 19:30:34 +00:00
Kevin Rocard
3bcba14c36 Audio HAL: Allow setters to not be implemented
setSampleRate, setChannelMask, setFormat
may not be implemented by the HAL, although this is not documented in
the HAL API.
Currently the VTS test requires their implementation if the respective
getSupported{SampleRate,ChannelMask,Format} are supported.

Relax this requirement as the framework never calls those setters.

Note that the optionality of those functions will be documented
in the next HAL API version.

Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target -t CheckConfig.audioPolicyConfigurationValidation
Bug: 69811500
Change-Id: I3a390ae925cabd99e7f1ed4a627e71ad87b1b437
Signed-off-by: Kevin Rocard <krocard@google.com>
2017-12-05 15:42:10 -08:00
Kevin Rocard
02025847de Audio VTS: HAL can support more than the native sampling rates
getSupportedSampleRate should return the native sampling rates,
(IE. the sampling rates that can be played without resampling)
but other sampling rates can be supported by the HAL.

The test was too strict as it was failing if HALs were supporting more
sample rates than there native (optimized) ones.

For example, a HAL might have its best performance (no resampling)
on 48kHz but still support 16kHz through resampling.

Note: getSupportedSampleRate might be renamed to getNativeSampleRate in
the next major HAL revision to avoid ambiguity.

Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target -t CheckConfig.audioPolicyConfigurationValidation
Bug: 69811500
Change-Id: I1ec1ce422bc5039637463c6641060508f4ee892b
Signed-off-by: Kevin Rocard <krocard@google.com>
2017-12-05 15:14:17 -08:00
Kevin Rocard
503c3e0a4e Audio policy config: remove cross-module device port name uniqueness
This constraint was added due to an incorrect assumption
that device ports were identified by names whereas
they are by the (module,type,address) triplet.

Bug: 69442986
Test: xmllint validates an XML with two identically named devices in
      different modules.
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target -t CheckConfig.audioPolicyConfigurationValidation
Change-Id: I66d890d3c967bead4f2a287202c259009217996a
Signed-off-by: Kevin Rocard <krocard@google.com>
2017-12-04 14:29:19 -08:00
Kevin Rocard
fa1f597442 Audio policy config: Device port (type,address) must be unique
Device port are not identified by names but by their type and address
and the module they are in.

As a result, enforce this constraint in the XSD. Violating it results in
a policy parsing crash.

Bug: 69442986
Test: xmllint invalidates an XML with two devices of the same type
      and address
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target -t CheckConfig.audioPolicyConfigurationValidation
Change-Id: I84245f0fa80fef786a002c98073c166b6aaf2be4
Signed-off-by: Kevin Rocard <krocard@google.com>
2017-12-04 14:29:14 -08:00
Kevin Rocard
7558e8c6e4 Audio policy config: allow vendor to extend module name
Vendor are currently not allowed to extend the XML format.
As some enumeration are allowed to be extended, this mean that
the format must allow some extension mechanism.

This patch relaxes the definition of the module name field.
AOSP names are still allowed, but a vendor can add its own name
if prefixed with "vx_". Eg:
    <module name="vx_google_vr" halVersion="3.0">

Test: xmllint --xinclude --noout --schema hardware/interfaces/audio/2.0/config/audio_policy_configuration.xsd audio_policy_configuration.xml
      with audio_policy_configuration.xml containing a module named vx_google_vr
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target -t CheckConfig.audioPolicyConfigurationValidation
      on Pixel 2
Bug: 69442986
Signed-off-by: Kevin Rocard <krocard@google.com>

Change-Id: I4ead38535cce89bb8fe44cf23fa1146acd1271d6
2017-12-04 14:29:08 -08:00
Kevin Rocard
b5433136dd Add the audio team as owner of the audio VTS
am: c691e18332

Change-Id: I3fa55d02549c1827737f8e0d85bae99226506f17
2017-11-29 22:23:57 +00:00
Daniel Van Veen
ab185f7250 Merge "Fix inequality typo in StreamIn::getCapturePosition" am: ba3225718b am: 3770968cf9
am: d0161b948a

Change-Id: Idd1d697f45057872d1a88ed42487cc1e1859d229
2017-11-29 21:15:02 +00:00
Daniel Van Veen
3770968cf9 Merge "Fix inequality typo in StreamIn::getCapturePosition"
am: ba3225718b

Change-Id: I9ec534a8ec45525021180fa9219a1e3d4f34d0a7
2017-11-29 20:46:08 +00:00