Implement parsing of AudioPolicyManager config for finding
out supported format configurations of streams. This only applies
when running tests for HAL V6. Previously format configurations
mandated by CDD were used for testing, this does not work well
for non-primary modules.
Fix the following issues found while running the tests
for "r_submix" and "msd" modules:
- IStream::getSupportedFormats must return a status
to indicate that this capability is not supported by HAL;
- it is allowed for IStream::setDevices to return
NOT_SUPPORTED status.
Other changes:
- Factor out helper functions for generating format
configurations;
- Fix generation of the channel mask component in the names
of tests that use AudioConfig, add sampling rate to test
names.
Squashed with the following commit to avoid breaking compilation:
audio vts: Remove explicit dependency on the new types
Avoid using the new ChannelMaskSet and SampleRateSet types
directly to simplify upstreaming.
Bug: 141989952
Bug: 141847510
Test: atest VtsHalAudioV5_0TargetTest
atest VtsHalAudioV6_0TargetTest
also, run modified V5_0 test using generators for V6_0
Change-Id: If0d330881901908e546baab89f63d3333003e355
Merged-In: If0d330881901908e546baab89f63d3333003e355
Implement parsing of AudioPolicyManager config for finding
out declared modules (IDevice instances) with permanently
attached devices and run tests for them. This only applies
when running tests for HAL V6.
Change class hierarchy to use IDevice interface as much as
possible, only use IPrimaryDevice for its specific methods.
Fix the following issues found while running the tests
for "r_submix" and "msd" modules:
- IDevice::getMicrophones can return NOT_SUPPORTED status;
- IDevice::get/setParameters can return NOT_SUPPORTED.
Other changes:
- Factor out common code for getting devices via DeviceManager;
- Factor out AudioPolicyConfigTest.HasPrimaryModule test from
SetUp code;
- Add device parameter generator for primary device only.
Bug: 141989952
Bug: 141847510
Test: atest VtsHalAudioV5_0TargetTest
atest VtsHalAudioV6_0TargetTest
also, run modified V5_0 test using generators for V6_0
Change-Id: I51cec21670120d8dce75609954a18b886cc0c18d
Merged-In: I51cec21670120d8dce75609954a18b886cc0c18d
Parametrize tests to accept IDevicesFactory instance name
and IDevice instance name. For audio HAL versions 2..5
the factory instance name is taken from the VTS environment,
and the device is always "primary". For the next versions
the factories are discovered by the test, and the devices
are taken from the audio policy configuration
(to be implemented, see added FIXME comments).
Split the Environment class into two versions: for HAL 2..5
and for next versions. They use different base class.
Move device factories and device caching into dedicated
classes DevicesFactoryManager and DeviceManager. They deal
with instance caching and proper release of server resources.
Bug: 141847510
Bug: 141989952
Test: atest VtsHalAudioV5_0TargetTest
atest VtsHalAudioV6_0TargetTest
Change-Id: I92c44e0c3f900164dded7e9c4bfc642ca2c335db
Merged-In: I92c44e0c3f900164dded7e9c4bfc642ca2c335db
Generate with ./newHal.sh 5.0
+ some typo fix in the .hal
+ some clang-tidy run
This new HAL is an exact copy of the V5.
It will be modified in following patches while R is developed.
Test: push V6 to device and check audio works fine
Bug: 134940862
Change-Id: Ic25d30175032e76e0d3208fb876451de9ae6b7b4
Merged-In: Ic25d30175032e76e0d3208fb876451de9ae6b7b4
Signed-off-by: Kevin Rocard <krocard@google.com>
Mostly automated script to generate a new Audio HAL major version.
Test: push V6 to device and check audio works fine
Bug: 134940862
Change-Id: I0da621e747eb48e75901a2a10cfc224f33864c3b
Merged-In: I0da621e747eb48e75901a2a10cfc224f33864c3b
Signed-off-by: Kevin Rocard <krocard@google.com>
The service supports multiple versions and its name should not be
version dependant.
For backward compatibility, keep the target name
android.hardware.audio@2.0-service (32bit only), existing
PRODUCT_PACKAGES do not have to be updated.
New products should depend on android.hardware.audio.service:32.
Additionally migrate to Android.bp, dropping support for
AUDIOSERVER_MULTILIB. Previously the HAL service architecture (32 vs 64)
would be the same as the audio server. This in not wanted as all android
audio HAL are 32 bits.
Bug: 121208203
Test: # Compare following commands before and after patch:
find $ANDROID_PRODUCT_OUT/vendor -name 'android.hardware.audio*'|xargs file
adb shell reboot # check device boots to UI and
# check the HAL restarts after the audioserver is killed
adb shell ps |grep audio; adb shell killall audioserver; adb shell ps
Change-Id: I25f41735175a6687a051ca1e5a7fee670eb8115e
Merged-In: I25f41735175a6687a051ca1e5a7fee670eb8115e
Signed-off-by: Kevin Rocard <krocard@google.com>
Remove all per interface version boilerplate.
Adding a new version now requires only including the file
and adding the version name to the list.
Bug: 134940862
Test: adb shell lshal
Change-Id: Ib6b99d7a2c2079d914970fbe804aaf3c78c143ce
Merged-In: Ib6b99d7a2c2079d914970fbe804aaf3c78c143ce
Signed-off-by: Kevin Rocard <krocard@google.com>
As a V6.0 version needs to be created.
Note that this target is not used anywhere explicitly.
There seem to be some magic to "xsd_config", probably has to do with the
package_name.
Bug: 134940862
Test: build
Change-Id: Id6935c5458294981cb778f3647ec01ee34a34e2f
Merged-In: Id6935c5458294981cb778f3647ec01ee34a34e2f
Signed-off-by: Kevin Rocard <krocard@google.com>
Packages which contain some non-supported Java types can still have
their Java-supported types used in Java.
Bug: 143566068
Test: mma
Change-Id: I2afc5cc8d0a1bd981108ee2b87d6033fd48bdb37
Move common code out of the test source.
Test: atest VtsHalAudioV5_0TargetTest
Merged-In: I86cf399029a0a5f3f08c7e82713ae62df03dee3f
Change-Id: I86cf399029a0a5f3f08c7e82713ae62df03dee3f
Due to asynchronous nature of the destruction of server-side objects
it is required to flush IPC messages to the server and wait to avoid
flakiness due to an attempt to open the stream while it's still not
closed on the server side.
Test: atest VtsHalAudioV5_0TargetTest
Bug: 118655804
Change-Id: Ibd6bb2e20ffe95b83228982c2f2e9232d280e5ff
Non-default audio service (e.g. MSD) is allowed not to have
a "primary" device. In this case tests that require it can be
skipped.
Manage static objects of a test suite in a canonical gtest way
using SetUp/TearDownTestSuite.
Bug: 139321356
Bug: 141433379
Test: vts-tradefed run commandAndExit vts -m VtsHalAudioV5_0Target
on a device with "msd" audio HAL module
Change-Id: I08a11b2caa9a913e812f1c203007070e4e68c44e
The XSD has to be kept manually synced to the HAL definition. When some
formats were introduced and the corresponding enum values were added in
the HAL .hal, the XSD was not updated.
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: 128967080
Change-Id: I8cf36c7717a0dd15fb4f6261f9bb61c88b27a959
As IStream::close only releases internal resources of the stream,
deferring actual stream closing to IStream server object
destruction, which is delivered to the audio HAL server
asynchronously, there is a possibility for a race condition
when streams gets opened and closed in a tight loop as in the VTS
test.
Work around this problem by flushing RPC messages between
the client and the server, and inserting a delay before opening
a new stream.
Bug: 139329877
Test: VtsHalAudioV5_0TargetTest#AudioPrimaryHidlTest.GetMicrophonesTest
Change-Id: Id8744f6f21fd3bfa607f489364925eccbab17b5e
(cherry picked from commit 26f868bb02)
During the transition to Treble, "device connect" / "disconnect"
parameter was erroneously attributed to audio streams. This
issue got fixed in Audio HAL V4.0, but AudioParameter file
was still using incorrect name for the constant.
Test: make
Change-Id: I18e1e3fccad3d41372f3c5c046af4f6ffd83328b
Merged-In: I18e1e3fccad3d41372f3c5c046af4f6ffd83328b
Since these were combined into libhidlbase.
Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: I075670b64eebbbbd6a6ae0e84ad51bf1c6f5ba36
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
This patch restores the documentation on the channel order convention
that was present in the Audio HAL 2.0 but remove by mistake in 4.0.
This is a vendor feedback.
Test: mm
Bug: 133453897
Change-Id: I8eabd8883612d39ced21481fc44661b0808754bb
Signed-off-by: Kevin Rocard <krocard@google.com>
Input value were not checked, resulting in out of range input accepted.
This was checked by test but never implemented in the default HAL.
Bug: 133105753
Test: atest VtsHalAudioV5_0Target
Change-Id: Ie6dae638b60daff6923668dc9637067f29e48b21
Signed-off-by: Kevin Rocard <krocard@google.com>
hidl-generated makefiles are now generated such that bpfmt(file) == file.
Bug: 67417008
Test: enable bpfmt hook
Change-Id: I1f69d292bc23a7cc293a66110cb02d597e1019ad
Add AUDIO_CHANNEL_INDEX_MASK_{9..24}
Fix channel order for AUDIO_CHANNEL_OUT_3POINT{0,1}POINT2
Bug: 126455009
Test: make
Change-Id: I36a89c9903ad1702c5c0bdb0632c3f3234bb75d7
This element makes sense only for TV platforms. The deserializer
treats it as optional. Update the schema to match this.
Bug: 116356348
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: I822c3ff10a6becc859d3d44fd58ef2ebcd3d40b1
The implementation uses IBase::debug() method which can write
debugging info into the provided file descriptor (same model
as used for devices and streams).
Bug: 69939533
Test: adb shell dumpsys media.audio_flinger
Change-Id: I7876fd43a7066c0f081ea2ca0b3b4b37bbdf8e6c
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
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
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
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