Commit Graph

10 Commits

Author SHA1 Message Date
Mikhail Naganov
a4513dcf05 audio: Move tinyALSA-specific code to Module/StreamAlsa
Extract code interacting with tinyALSA which is not
specific to USB into "abstract" module and stream
implementations ModuleAlsa and StreamAlsa. Also, move
utility code which does not need module or stream
context into Utils.

This facilitates implementation of the CF core HAL which
also uses tinyALSA, allowing to share common code.

Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest

Change-Id: I2134b15e970c78e8a48b254e15199b8207a8ab34
(cherry picked from commit c337a8799b)
Merged-In: I2134b15e970c78e8a48b254e15199b8207a8ab34
2023-08-01 14:27:28 -07:00
Mikhail Naganov
7d8fb3e8bf audio: Use the canonical direction port direction in ModuleUsb
Instead of relying on the device type, use the 'AudioPort.flags'
field to determine the device direction.

Remove 'isUsbInputDeviceType' and 'isUsbOutputtDeviceType'
as they are too specific to particular device type and just
add a maintenance burden.

Bug: 266216550
Test: m
Change-Id: Ia1b9330c2b419a1a4048ed78d914d05c1caf523f
(cherry picked from commit 64fd6bd779)
Merged-In: Ia1b9330c2b419a1a4048ed78d914d05c1caf523f
2023-08-01 14:25:17 -07:00
Mikhail Naganov
73b06adb9a audio: Allow Module subclasses to customize stream creation
Since specializations of the 'Module' class likely need
to provide their own specializations for streams, provide
virtual methods for them.

Bug: 282568751
Test: atest VtsHalAudioCoreTargetTest
Merged-In: Iddb1bff9f11bc867aba61897ea2f8b9bc3c27544
Change-Id: Iddb1bff9f11bc867aba61897ea2f8b9bc3c27544
(cherry picked from commit 9d16a6ac10)
2023-06-27 16:22:32 -07:00
Mikhail Naganov
4ff3cf8e73 audio: Facilitate extension of Module class by vendors
Make interface methods protected so that subclasses can
augment them.

Provide getters for private fields.

Bug: 282568751
Test: atest VtsHalAudioCoreTargetTest
Merged-In: I0e4810f8a4c816c4f673139816e9768f6dc8da7c
Change-Id: I0e4810f8a4c816c4f673139816e9768f6dc8da7c
(cherry picked from commit 57f0dcf78d)
2023-06-27 16:13:33 -07:00
jiabin
768c6f94d6 AHAL: use PCM_FORMAT_INVALID as the termination of format array.
Bug: 266216550
Test: make
Change-Id: Ibe2056eb4fdecb14c3e25daa3dbdd769d6433136
2023-04-12 23:46:55 +00:00
Jiabin Huang
b3602ca092 Merge "AHAL: fix USB HAL issues with reporting device capabilities." 2023-03-22 16:18:49 +00:00
jiabin
118c261010 AHAL: fix USB HAL issues with reporting device capabilities.
1. The card and device must be specified before reading device info.
2. Map PcmType::FIXED_Q_8_24 to PCM_FORMAT_S24_LE.
   Map PcmType::INT_24_BIT to PCM_FORMAT_S24_3LE.

Bug: 266216550
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ib48538d01bc980524e2c4c5b221f6d7e479beba6
2023-03-21 23:07:40 +00:00
Mikhail Naganov
872d4a6518 audio: Put audio/aidl/common/include/Utils.h into 'aidl' NS
These utilities are for types generated from AIDL. Since
the types end up in the 'aidl' namespace (NDK backend), it makes
sense to keep the utilities in the same namespace.

While changing the namespace, I've found numerous useless
includes of 'Utils.h' and removing them, also reorganizing
lists of includes along the way to match the style guide.

Bug: 205884982
Test: m
Test: atest --test-mapping hardware/interfaces/audio/aidl/TEST_MAPPING
Change-Id: Ib23b47092364046f632f9503b92b9baff5b902f5
2023-03-10 11:34:31 -08:00
jiabin
783c48b00e AHAL: support volume control for USB audio HAL.
Use mixer control to support master mute, master volume and hardware
volume for USB audio HAL.

Bug: 266216550
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Iad544ba517cbfc778ebdf96dd161944886383b73
2023-03-01 22:10:34 +00:00
jiabin
253bd32b04 AOSP AIDL USB audio HAL implementation.
Bug: 266216550
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I82e053d3f6a918cafe0d43b030f724f63a99eb2a
2023-02-02 18:39:26 +00:00