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>
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>
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>
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>
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
This was preventing getCapturePosition() being called from
the default HIDL implementation.
Test: cts-tradefed run cts -m CtsMediaTestCases \
-t android.media.cts.AudioRecordTest
Change-Id: I9c920108f68fb895a7f7a9d2ea27c291a91c1afb
set_parameter wrapper was converting status_t as such:
OK -> OK
-ENOSYS -> INVALID_STATE
everything else -> INVALID_ARGUMENTS
Which was inconsistent with the rest of the wrapper which was doing:
OK -> OK
-EINVAL -> INVALID_ARGUMENTS
-ENODATA -> INVALID_STATE
-ENODEV -> NOT_INITIALIZED
-ENOSYS -> NOT_SUPPORTED
everything else -> INVALID_STATE
Unfortunately, identical conversion can not be achieve as legacy
set_parameter specifically require
-ENOSYS -> INVALID_STATE
in `get_parameter` docstring:
* If the implementation does not accept a parameter change while
* the output is active but the parameter is acceptable otherwise, it must
* return -ENOSYS.
As a result implement:
OK -> OK
-EINVAL -> INVALID_ARGUMENTS
-ENODATA -> INVALID_STATE
-ENODEV -> NOT_INITIALIZED
-ENOSYS -> INVALID_STATE <--- unchanged
everything else -> INVALID_ARGUMENTS <--- unchanged
Test: Playback and record over builtin & USB. Hangout call
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target
Bug: 67030461
Change-Id: I13649eb00f8465921e5c718c5d5df120e1262ff7
Signed-off-by: Kevin Rocard <krocard@google.com>
Audio hal does not have selinux permissions to files under
/data/locat/tmp. We pass an fd to a pipe to the HAL instead.
Bug: 67665722
Test: VtsHalAudioV2_0Target
Change-Id: I695917be1816ba007f48afab5e978ab31024ffba