Commit graph

956 commits

Author SHA1 Message Date
Suren Baghdasaryan
fd2cb35456 Replace direct pid writes with setting task profiles for audio interfaces am: 3c6f2df90a am: b1c906ff99
Change-Id: I2663aa7a9d1c51f90a1830b44d59c2bab31887c4
2020-05-01 17:03:55 +00:00
Suren Baghdasaryan
3c6f2df90a Replace direct pid writes with setting task profiles for audio interfaces
For easy transition from SchedTune to UtilClamp, direct access to these
cgroups should be abstracted by using task profiles. Replace writepid
commands with new task_profiles command.

Bug: 155419956
Test: change .rc file and confirm task profile is applied
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ide373c283359cf4b73af4cb0813d8c0306942595
2020-04-30 13:45:13 -07:00
TreeHugger Robot
84fdc1567d Merge "add context_hub into audio hal group" into rvc-d1-dev am: b0dce89ec0
Change-Id: I37fc8cccec6031c81609e93efdf10289212c7335
2020-04-30 16:07:38 +00:00
emilchung
e815ecd6b2 add context_hub into audio hal group
While implementing the capo nanoapp for audio configuration, we met
some chre socket connected error due to the access group denied.

Add context_hub group for audio hal to connect chre socket.

go/capo-algo

Bug: 141128522
Bug: 149069556
Test: FULL build with audio hal part and local prebuilts nanoapp.
Test: Audio HAL communicates normally with CHRE socket.
Change-Id: Iea84411682f4c3e08f8b37a5b21818b0e9b04983
2020-04-29 09:58:33 +00:00
Mikhail Naganov
0dd9a6bacc audio: Centralize audio configuration paths specification
The list of possible paths for the audio configuration
files is now retrieved using audio_get_configuration_paths()
function. All duplicated lists of known configuration
directories have been removed.

Bug: 153680356
Test: atest VtsHalAudioV6_0TargetTest \
            VtsHalAudioPolicyV1_0TargetTest \
            VtsHalAudioEffectV6_0TargetTest
Change-Id: I1e40fdf8d6e3a5ac339f7f138f62063bb87bd3da
Merged-In: I1e40fdf8d6e3a5ac339f7f138f62063bb87bd3da
2020-04-17 01:55:48 +00:00
Treehugger Robot
09f4f0b61b Merge "audio: Centralize audio configuration paths specification" am: c2e1f3baef am: fefefa63a6
Change-Id: I029ebd83595381768858cbb3efe92c2f3b09ffac
2020-04-16 23:35:46 +00:00
Steven Moreland
cedd3f387b VtsHalAudio*TargetTest in vts.
Bug: 139438327
Test: N/A
Change-Id: I0fb6c966c70cc51cbfd13fd27d6224c9fd07ec20
2020-04-15 23:54:45 +00:00
Mikhail Naganov
5a6ffb21a5 audio: Centralize audio configuration paths specification
The list of possible paths for the audio configuration
files is now retrieved using audio_get_configuration_paths()
function. All duplicated lists of known configuration
directories have been removed.

Bug: 153680356
Test: atest VtsHalAudioV5_0TargetTest \
            VtsHalAudioPolicyV1_0TargetTest \
            VtsHalAudioEffectV5_0TargetTest
Change-Id: I1e40fdf8d6e3a5ac339f7f138f62063bb87bd3da
2020-04-15 10:09:38 -07:00
TreeHugger Robot
25e1181101 Merge "Convert VtsHalAudioV*_0TargetTest to parameterized gtest" into rvc-dev 2020-04-08 20:30:00 +00:00
Dan Shi
eb5f33e0ef Rename vts-core to vts am: ba894f81db am: 55d110bcd0
Change-Id: Ifc137320af42febc24937f09e5baa4c5a95ac1c4
2020-04-07 23:56:42 +00:00
Dan Shi
aad51fa000 Rename vts-core to vts
Bug: 151896491
Test: local build
Exempt-From-Owner-Approval: This CL update suite name vts-core to vts as
the suite name is updated. This CL won't change test logic or behavior.

Change-Id: I562b4dc50765e953800a814a8fd84a01c1b9352b
Merged-In: I562b4dc50765e953800a814a8fd84a01c1b9352b
2020-04-07 16:37:40 -07:00
Dan Shi
ba894f81db Rename vts-core to vts
Bug: 151896491
Test: local build
Exempt-From-Owner-Approval: This CL update suite name vts-core to vts as
the suite name is updated. This CL won't change test logic or behavior.

Change-Id: I562b4dc50765e953800a814a8fd84a01c1b9352b
Merged-In: I562b4dc50765e953800a814a8fd84a01c1b9352b
2020-04-07 15:17:02 -07:00
Dan Shi
67963dec8b Convert VtsHalAudioV*_0TargetTest to parameterized gtest
For version 2, 4 and 5.

Bug: 150299743
Test: atest VtsHalAudioV2_0TargetTest \
  VtsHalAudioV4_0TargetTest \
  VtsHalAudioV5_0TargetTest
Change-Id: I09be1dc79b69caadd2a5468c4e6ed9c1efd76ffd
Merged-In: I09be1dc79b69caadd2a5468c4e6ed9c1efd76ffd
2020-04-07 22:06:19 +00:00
Mikhail Naganov
4e1ad4cb1f Audio Effects: Run more tests for LoudnessEnhancerEffect
Due to incorrect assumptions about test case inheritance
in GTests, LoudnessEnhancerEffect wasn't running tests
for methods of IEffect interface. The test code has been
restructured to fix that via proper parametrization.

Bug: 146149801
Test: atest VtsHalAudioEffectV5_0TargetTest
Test: atest VtsHalAudioEffectV6_0TargetTest
Change-Id: Ie366979880bfc3b7e95a02957451736d724f838f
Merged-In: Ie366979880bfc3b7e95a02957451736d724f838f
2020-03-23 15:33:31 -07:00
Mikhail Naganov
113bd8111a Audio Effects: Skip CheckConfig test for non-matching HAL versions
In vts-core a test suite for version N can be called for HAL
of version M. Since in the case of the Effects HAL the XSD
configuration for the effects is version-dependent, the test
must not validate the effects config using XSD file for other
version. Thus, the configuration validity check must be skipped
if no corresponding version of IEffectsFactory is found
on the device.

Bug: 142397658
Bug: 146015418
Test: atest VtsHalAudioEffectV6_0TargetTest
      on a device that uses earlier version of Audio HAL;
      CheckConfig#audioEffectsConfigurationValidation must
      be IGNORED
Change-Id: I4b34cc34091447c04bf8d3e988c9bd4048dc8ef9
Merged-In: I4b34cc34091447c04bf8d3e988c9bd4048dc8ef9
2020-03-23 15:32:51 -07:00
Treehugger Robot
f5f04f157c Merge "Audio Effects: Run more tests for LoudnessEnhancerEffect" am: 7a2c9860f2 am: 004262eec4
Change-Id: I1a26e0230fe72a70b9ce85b028824b74012faf9d
2020-03-23 20:12:39 +00:00
Treehugger Robot
7a2c9860f2 Merge "Audio Effects: Run more tests for LoudnessEnhancerEffect" 2020-03-23 19:52:02 +00:00
Mikhail Naganov
892d147516 Audio Effects: Run more tests for LoudnessEnhancerEffect
Due to incorrect assumptions about test case inheritance
in GTests, LoudnessEnhancerEffect wasn't running tests
for methods of IEffect interface. The test code has been
restructured to fix that via proper parametrization.

Bug: 146149801
Test: atest VtsHalAudioEffectV5_0TargetTest
Test: atest VtsHalAudioEffectV6_0TargetTest
Change-Id: Ie366979880bfc3b7e95a02957451736d724f838f
2020-03-23 11:32:08 -07:00
Mikhail Naganov
5e45410c9a Merge "audio: Check result from oneway calls" into rvc-dev am: 6d0d85d9b2
Change-Id: Ia77d1abf145193f718eff3cde21d1663a10f8d2f
2020-03-20 02:23:01 +00:00
Mikhail Naganov
2adec4f116 audio: Check result from oneway calls
As oneway HIDL calls generate methods that return 'Result<void>',
the returned value must be checked to avoid triggering an
assertion if the result was an error (e.g. due to the client death).

Bug: 151900655
Test: N/A
Change-Id: I4721240b5959d6f11cb4447b30928bf4c83da058
2020-03-19 20:39:12 +00:00
Mikhail Naganov
6c3c46c2c5 Audio Effects: Skip CheckConfig test for non-matching HAL versions am: 248708f63c am: 8c32e628be
Change-Id: I0a8f39516c94336a63c7648a27db135229fadf8d
2020-03-19 00:36:49 +00:00
Mikhail Naganov
248708f63c Audio Effects: Skip CheckConfig test for non-matching HAL versions
In vts-core a test suite for version N can be called for HAL
of version M. Since in the case of the Effects HAL the XSD
configuration for the effects is version-dependent, the test
must not validate the effects config using XSD file for other
version. Thus, the configuration validity check must be skipped
if no corresponding version of IEffectsFactory is found
on the device.

Bug: 142397658
Bug: 146015418
Test: atest VtsHalAudioEffectV6_0TargetTest
      on a device that uses earlier version of Audio HAL;
      CheckConfig#audioEffectsConfigurationValidation must
      be IGNORED
Change-Id: I4b34cc34091447c04bf8d3e988c9bd4048dc8ef9
2020-03-18 14:45:42 -07:00
Dan Shi
daa2999781 Merge "Convert VtsHalAudioV*_0TargetTest to parameterized gtest" am: 1b03269ec7 am: e904793d4b
Change-Id: Ib7d0098575ca6f5fd6b963e5f016956b7fb6d2ba
2020-03-17 23:07:14 +00:00
Dan Shi
82cf1f1bb2 Convert VtsHalAudioV*_0TargetTest to parameterized gtest
For version 2, 4 and 5.

Bug: 150299743
Test: atest VtsHalAudioV2_0TargetTest \
  VtsHalAudioV4_0TargetTest \
  VtsHalAudioV5_0TargetTest
Change-Id: I09be1dc79b69caadd2a5468c4e6ed9c1efd76ffd
2020-03-17 13:12:42 -07:00
Mikhail Naganov
d24ab2ba3a Update audio VTS source code to match the change in AudioPolicyConfig
Use getInputDevices instead of getAvailableInputDevices.

Bug: 149854039
Test: atest VtsHalAudioV5_0TargetTest
Change-Id: I0fed71eba8d031465ef98da2bf6be16c2fbfb5ff
Merged-In: I0fed71eba8d031465ef98da2bf6be16c2fbfb5ff
2020-03-10 15:36:43 -07:00
TreeHugger Robot
ce3f17e662 Merge "Update audio VTS source code to match the change in AudioPolicyConfig" into rvc-dev 2020-03-10 19:07:24 +00:00
Mikhail Naganov
20a3e395bf Update audio VTS source code to match the change in AudioPolicyConfig
Use getInputDevices instead of getAvailableInputDevices.

Bug: 149854039
Test: atest VtsHalAudioV5_0TargetTest
Change-Id: I0fed71eba8d031465ef98da2bf6be16c2fbfb5ff
2020-03-09 23:31:29 +00:00
jiabin
5d11612694 Add callback for output stream.
The callback is targeted for events related to an output stream.
Currently, there is one callback event defined, which is codec
format changed event.

Bug: 133526565
Test: manual
Test: atest VtsHalAudioV6_0TargetTest
Change-Id: I73a4914c1ffc30e1c88b8fedd61a031e24a069f6
2020-02-25 09:08:26 -08:00
Andy Hung
7aab1010d4 audio hal: Update offload configuration
Test: no regression with offloaded Play Music
Bug: 133526565
Merged-In: Ie655a96503be5a4ad1660d4b2183b01e514452fd
Change-Id: Ie655a96503be5a4ad1660d4b2183b01e514452fd
(cherry picked from commit c91b679ac1)
2020-02-25 09:06:09 -08:00
Mikhail Naganov
973e4d33b5 audio: Add playback rate parameters to IStreamOut
Playback rate parameters allow changing the playback speed
of audio streams optionally preserving the pitch (this is
often referred to as "timestretch"). HALs can apply these
parameters when decoding of streams is done in hardware.

Bug: 133526565
Test: atest VtsHalAudioV6_0TargetTest
Change-Id: Ie78cd924bd034b57bf5b6a74affd62641ffc0aba
2020-02-20 11:13:14 -08:00
Mikhail Naganov
0a675fcc88 audio: Add Dual Mono Mode and Audio Description Mix Level to IStreamOut
These properties are mainly used on TV platforms.

Bug: 133526565
Test: atest VtsHalAudioV6_0TargetTest
Change-Id: I5dd2fe9cb987bf8435b8e5da96f8590288e5707c
2020-02-18 20:01:29 -08:00
Automerger Merge Worker
294e681ded Merge "Update copyHAL.sh after changes in libaudiohal" am: f2212ca85c am: 2bd5e654fb am: 981837366e
Change-Id: Idde37ba245a46a265a3697b14c3f0a90cc956d43
2020-02-10 23:09:41 +00:00
Treehugger Robot
f2212ca85c Merge "Update copyHAL.sh after changes in libaudiohal" 2020-02-10 22:32:44 +00:00
Mikhail Naganov
d432d51627 Update copyHAL.sh after changes in libaudiohal
Bug: 148118201
Test: copyHAL.sh 5.0 6.0
Change-Id: I7cb2f7c5216c4095fa36c2c96ebbe2a2255b0691
2020-02-10 12:46:23 -08:00
Automerger Merge Worker
9f1197d48b Merge "audio: Fix audio effects schema for V6" am: 6918c455e1 am: aef1ef555c am: a1a571da55
Change-Id: I4498cd757d87c06b575ae205088151429520a984
2020-02-07 19:09:38 +00:00
Mikhail Naganov
9f83bb9fb7 audio: Fix audio effects schema for V6
There was a mistake in the XSD file introduced in aosp/1201850.

Bug: 148979886
Test: atest VtsHalAudioEffectV6_0TargetTest
Change-Id: I02f869031e0d4687d6e099fa5d4593d4b5cc8243
2020-02-06 10:33:25 -08:00
Mikhail Naganov
33e0578cdd audio: Clarify documentation for some methods
- explain the meaning of "audio patch" in IDevice.supportsAudioPatches
  method;

- clarify effect insertion order in IDevice.addDeviceEffect

Bug: 148617378
Test: N/A
Change-Id: Ifd7ec3dc9a53c949be0c8c823df499e4b20db4bd
2020-02-04 19:05:44 -08:00
Mikhail Naganov
40549fae50 audio: Provide documentation for enums in 'common' package
Bug: 148617378
Test: N/A
Change-Id: Ia28c9217527509430f2daf274e14380bfe79f145
2020-02-04 18:59:12 -08:00
Mikhail Naganov
e74b571711 audio: Remove dynamic dependency on HIDL interface libs from service
This is intended to reduce memory footprint of the default HAL
service. The inteface libraries were only used to retrieve
interface descriptors and use generated code to register as
service. This code was replaced with static code from
HIDL transport library.

Bug: 148115870
Test: check audio on devices
Change-Id: Ie8713d513cfbde64120546ba0db1cf80fd366138
Merged-In: Ie8713d513cfbde64120546ba0db1cf80fd366138
2020-01-31 14:57:07 -08:00
Mikhail Naganov
2801b037cd audio: Fix invalid BT A2DP interface name
The correct name is:
android.hardware.bluetooth.a2dp@1.0::IBluetoothAudioOffload

Bug: 148648456
Bug: 148648729
Bug: 148648469
Bug: 148648355
Test: DeviceBootTest.DeviceBootTest#SELinuxUncheckedDenialBootTest
Change-Id: I50d3486159f17697b06e9680b85586b1935a9ccc
2020-01-31 14:48:23 -08:00
Mikhail Naganov
f3e4d217ee audio: Remove dynamic dependency on HIDL interface libs from service
This is intended to reduce memory footprint of the default HAL
service. The inteface libraries were only used to retrieve
interface descriptors and use generated code to register as
service. This code was replaced with static code from
HIDL transport library.

Bug: 148115870
Test: check audio on devices
Change-Id: Ie8713d513cfbde64120546ba0db1cf80fd366138
2020-01-29 16:35:51 -08:00
Automerger Merge Worker
53ae7c6ac3 Merge "[AudioEffect V6] Add missing sources in schemas" am: dde44ce92c am: 8acc85f35a am: 6f3ddf948e
Change-Id: I22cd018ea4abedbe397ce5fbd4d4555409619a5a
2020-01-29 17:20:27 +00:00
Automerger Merge Worker
d4322eed01 [AudioEffect V6] Add Device Effects am: f8ed37158b am: 5c4b0e82a7 am: 07573e2615
Change-Id: I2f4cae293d2edb321a622889c8d6ed2e29f61b27
2020-01-29 03:26:35 +00:00
François Gaffie
1aa7d5a691 [AudioEffect V6] Add missing sources in schemas
Test: build
Bug:

Change-Id: Icb27c115bcfae1b8df62ce7331872af249a069c9
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
2020-01-29 00:56:23 +00:00
François Gaffie
f8ed37158b [AudioEffect V6] Add Device Effects
This CL updates the schemas of Audio Effect Configuration to support
device effects.

Bug: 136294538
Test: build

Change-Id: I5bd72e9e5a6889000b91c78a25e46f6b26744c20
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
2020-01-29 00:55:57 +00:00
Automerger Merge Worker
f74cf07880 Merge "audio: Update copyHAL script to update dump_utils.cpp" am: 232a1d7831 am: 6b35310cbc am: 7b318ecf7f
Change-Id: I2a8f88b1b2d41b3445c99cd93bcd5c289e359534
2020-01-28 18:45:50 +00:00
Mikhail Naganov
51c87bc4c5 audio: Update copyHAL script to update dump_utils.cpp
dump_utils.cpp contains a list of interfaces that
need to be dumped.

Test: copyHAL.sh 6.0 7.0
Change-Id: I4444a5013852ea7362f3dba420c2c5c5c0f2a5c3
2020-01-28 08:48:28 -08:00
Automerger Merge Worker
d0e8e5f265 Merge "[vts-core] add VtsHalAudioV6_0TargetTest to vts-core" am: a64681e3c1 am: fb2270818c am: dff53cd8b9
Change-Id: Ice48ca0a4c08c1ddfde63c23a9dcacfb3df65e6e
2020-01-25 03:34:59 +00:00
Mikhail Naganov
0debfc3cc7 [vts-core] add VtsHalAudioV6_0TargetTest to vts-core
Add necessary configuration to VtsHalAudioV6_0TargetTest.

Bug: 146015418
Bug: 146104851
Test: atest VtsHalAudioV6_0TargetTest
Change-Id: I3e1bac38598ba5909c8eeb4f83e00bfd0bbbb058
2020-01-23 13:42:15 -08:00
Jaideep Sharma
9e62926f25 audiohal : add support for call_screen mode
Bug: 140384450
Test: make
Change-Id: Iea7816ba35538e5ee966dae4f57abf147d203bd0
2020-01-23 09:37:37 -08:00
François Gaffie
a8cac48d0f audiopolicy: engine: Add VTS for engine configurable configuration
This CL adds VTS test for engine PFW configuration files (Skipped
for default engine, the check is performed by reading the
audio_policy_configuration file AND parameter-framework top configuration
file)

AllSchemas.xsd is made by manual inclusion from all other
xsd files. It is used for API files generation.

Test: build & run vts --module VtsHalAudioPolicyV1_0Target
      atest VtsHalAudioPolicyV1_0TargetTest
Bug: 141989952

Change-Id: I62730caadafdcb5ebb3083d683625424864afe97
Merged-In: I62730caadafdcb5ebb3083d683625424864afe97
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
2020-01-17 21:42:55 -08:00
François Gaffie
b449cdb228 audio: Add VTS for configurable engine
This CL adds VTS tests for engine configuration.

Test: atest VtsHalAudioPolicyV1_0TargetTest
Bug: 141989952

Change-Id: Ied37edc5bba29ef461f6b68fa21781d5721b75bf
Merged-In: Ied37edc5bba29ef461f6b68fa21781d5721b75bf
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Signed-off-by: Mikhail Naganov <mnaganov@google.com>
2020-01-17 21:42:09 -08:00
François Gaffie
f282171776 audio: update XSD for dynamic engine loading support config
Bug: 141989952
Test: atest VtsHalAudioV6_0TargetTest

Change-Id: Ic0afc27f09d8387236444901dfddc5f0f074ba1b
Merged-In: Ic0afc27f09d8387236444901dfddc5f0f074ba1b
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
2020-01-17 21:33:17 -08:00
Hayden Gomes
9c38bc988d Expanding AudioUsage to include new system usages
Bug: 141006627
Test: make
Change-Id: Ica8ada8e95e7d49bfcf7501cae2c356f68da8e3b
2020-01-17 22:27:49 +00:00
François Gaffie
94865666a7 audiopolicy: engine: Add VTS for engine configurable configuration
This CL adds VTS test for engine PFW configuration files (Skipped
for default engine, the check is performed by reading the
audio_policy_configuration file AND parameter-framework top configuration
file)

AllSchemas.xsd is made by manual inclusion from all other
xsd files. It is used for API files generation.

Test: build & run vts --module VtsHalAudioPolicyV1_0Target
      atest VtsHalAudioPolicyV1_0TargetTest
Bug: 141989952

Change-Id: I62730caadafdcb5ebb3083d683625424864afe97
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
2020-01-16 20:23:58 -08:00
François Gaffie
5958d576ed audio: Add VTS for configurable engine
This CL adds VTS tests for engine configuration.

Test: atest VtsHalAudioPolicyV1_0TargetTest
Bug: 141989952

Change-Id: Ied37edc5bba29ef461f6b68fa21781d5721b75bf
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Signed-off-by: Mikhail Naganov <mnaganov@google.com>
2020-01-16 19:58:17 -08:00
François Gaffie
4060d8d7ae audio: update XSD for dynamic engine loading support config
Bug: 141989952
Test: atest VtsHalAudioV6_0TargetTest

Change-Id: Ic0afc27f09d8387236444901dfddc5f0f074ba1b
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
2020-01-15 12:23:59 -08:00
Eric Laurent
2c75ca6b27 Audio HAL: Add API to attach an effect to a device
Add a method to IDevice interface allowing the attachement of an
audio effect to an audio device.
This is used when an audio effect is implemented below the HAL (e.g by an audio DSP)
and is attached/enabled when a particular sink(e.g speaker) or source(e.g mic) device
is selected.

Bug: 136294538
Test: make
Change-Id: I73d78c4f234fd80443a1cb3772c2d65457968652
Merged-In: I73d78c4f234fd80443a1cb3772c2d65457968652
2020-01-10 11:16:42 -08:00
Eric Laurent
d33e6935e0 Audio effect HAL: Add device ID to createEffect API
Add the possibility to specify a target audio device when
creating an audio effect by passing its audio port handle
to createEffect API.

To attach an effect to a device, the framework will use
session ID AudioSessionConsts.DEVICE and provide a valid
AudioPortHandle as device ID.

Bug: 136294538
Test: make
Change-Id: Ic697eeafbd5df6800ad4c7fd9e0698e3d8e3beae
Merged-In: Ic697eeafbd5df6800ad4c7fd9e0698e3d8e3beae
2020-01-10 11:16:32 -08:00
Eric Laurent
5f9bb1b027 audio: add audio session for device effects
Add specific audio session ID for effects applied to a
particular audio device.

Bug: 136294538
Test: make
Change-Id: Iea3e3a07f404e1075844422c740d2dc4d5163598
Merged-In: Iea3e3a07f404e1075844422c740d2dc4d5163598
2020-01-10 11:16:12 -08:00
Treehugger Robot
653c876b5b Merge "Add audio stream and usage for virtual assistant" 2020-01-08 22:23:27 +00:00
Baekgyeong Kim
09e665e61c Add audio stream and usage for virtual assistant
New stream type: AUDIO_STREAM_ASSISTANT
This is intended to be used by a virtual assistant like
Google Assistant, Bixby, etc.

The audio stream has own volume alias and the volume
does not change by volume changes of other streams.

Bug: 123745215
Test: make
Change-Id: I3696d8fba32070954cc6a330574af8507fea7a74
Merged-In: I3696d8fba32070954cc6a330574af8507fea7a74
2020-01-08 11:53:59 -08:00
Automerger Merge Worker
828f15ebfc Merge "[vts-core] add VtsHalAudioEffectV*_0TargetTest to vts-core" am: 4472878a42 am: 96dd61d29b am: e876443913
Change-Id: I1e989a1cbe6d39b2c5f9f135388ea882df1925da
2020-01-08 03:41:27 +00:00
nelsonli
3c12e5844c [vts-core] add VtsHalAudioEffectV*_0TargetTest to vts-core
Convert VtsHalAudioEffectV*_0TargetTest to be parameterized test
and add it to vts-core

Bug: 142397658
Bug: 146104851
Bug: 146015418
Test: $atest VtsHalAudioEffectV2_0TargetTest
      $atest VtsHalAudioEffectV4_0TargetTest
      $atest VtsHalAudioEffectV5_0TargetTest
      $atest VtsHalAudioEffectV6_0TargetTest

Change-Id: I3e9297f7c0a0453b04721f6af8998a18043f5815
2020-01-06 16:26:58 +08:00
Baekgyeong Kim
3bc7741e91 Add audio stream and usage for virtual assistant
New stream type: AUDIO_STREAM_ASSISTANT
This is intended to be used by a virtual assistant like
Google Assistant, Bixby, etc.

The audio stream has own volume alias and the volume
does not change by volume changes of other streams.

Bug: 123745215
Test: make
Change-Id: I3696d8fba32070954cc6a330574af8507fea7a74
2019-12-16 11:39:27 -08:00
Mikhail Naganov
6c070ca4e8 audio: Add IDevice::updateAudioPatch method
Add method 'updateAudioPatch' which should be used when
an existing patch needs to be updated with new routing.
Use of this method allows audio HAL to avoid disrupting
audio stream while changing routing.

Bug: 79248321
Test: atest VtsHalAudioV6_0TargetTest
Change-Id: I6c87f67fa4f2463ba9e8f0272a3232f5c9c55714
2019-12-13 19:28:37 -08:00
Eric Laurent
9866a1b22d Merge "Audio HAL: Add API to attach an effect to a device" 2019-12-14 00:31:42 +00:00
Automerger Merge Worker
9ce348e0fc Merge "audio: Ignore ENOSYS from optional legacy HAL methods" am: a659ab610b am: 8cd2f70c58 am: 4dab7f1e9c
Change-Id: I911fc7096b9ead0504c67319bd339442a16ceb6c
2019-12-13 17:56:41 +00:00
Treehugger Robot
a659ab610b Merge "audio: Ignore ENOSYS from optional legacy HAL methods" 2019-12-13 17:23:44 +00:00
Eric Laurent
6c29bf2096 Audio HAL: Add API to attach an effect to a device
Add a method to IDevice interface allowing the attachement of an
audio effect to an audio device.
This is used when an audio effect is implemented below the HAL (e.g by an audio DSP)
and is attached/enabled when a particular sink(e.g speaker) or source(e.g mic) device
is selected.

Bug: 136294538
Test: make
Change-Id: I73d78c4f234fd80443a1cb3772c2d65457968652
2019-12-12 14:16:38 -08:00
Nicholas Ambur
ad84668d29 Merge "add SoundTrigger HAL V2.3" 2019-12-12 21:37:00 +00:00
Eric Laurent
00a501a992 Merge "audio: add call assistant usage" 2019-12-12 18:10:42 +00:00
Nicholas Ambur
1e90019220 add SoundTrigger HAL V2.3
add support for model parameter control APIs with THRESHOLD_FACTOR
as the first supported parameter

Bug: 141929369
Test: Tested manually with test app, GTS test
gts-tradefed run gts-dev -m GtsAssistIntentTestCases
and VTS test
vts-tradefed run vts-hal -m VtsHalSoundtriggerV2_3Target
Change-Id: I79d2b6365cc63fbdfe06fa94f1d0878903cbf554
2019-12-11 19:42:51 -08:00
TreeHugger Robot
dca3a5763b Merge "audio: Add check for MMap buffer size to the default implementation" 2019-12-12 00:41:27 +00:00
Automerger Merge Worker
8a5ee4e1a1 Merge "audio VTS: Fix call to IDevice::close in V6 tests" am: e82bfc646f am: b479a2793b am: b092fd6270
Change-Id: Ia7809f75b5138a774b0543d21b983c07a417c9b1
2019-12-12 00:16:27 +00:00
Mikhail Naganov
4135fa4e59 audio: Ignore ENOSYS from optional legacy HAL methods
Some methods of legacy HALs are optional. The legacy HAL
can avoid implementing them either by setting the function
entry in the interface table to NULL or by setting it
to a stub function returning -ENOSYS. In the latter case
the default implementation was spamming syslog with
warnings. Specify that ENOSYS returned from optional legacy
HAL methods must be ignored.

Bug: 141989952
Test: check logcat
Change-Id: Idbdff8d88e3303a0181cb5629ab82485148e6d8e
2019-12-11 15:57:53 -08:00
Mikhail Naganov
b2178b9248 audio: Add check for MMap buffer size to the default implementation
Add documentation and check that 'minSizeFrames' parameter
is a positive value. Previously a similar check was added
to Pixel HAL.

Bug: 141989952
Test: atest VtsHalAudioV6_0TargetTest
Change-Id: I526431fc214f7f5bc424f0c9e4c890cf918ca2b2
2019-12-11 15:07:47 -08:00
Mikhail Naganov
777a4d473c audio VTS: Fix call to IDevice::close in V6 tests
The result of RPC calls of HAL methods must be checked.
Added a check of result of calling IDevice::close added
for V6.

Bug: 114451103
Test: atest VtsHalAudioV6_0TargetTest
Change-Id: Ib6276382f15f122b43f314cf64cac2c3242bb76c
2019-12-11 14:39:01 -08:00
Eric Laurent
3c181a6fd6 audio: add call assistant usage
Add audio usage for call assistant use cases.
Used by apps playing over call uplink path for call
screening or other in call assitant features.

Bug: 135213843
Test: make
Change-Id: I7eeea676fe188946ff86f1e11e8e00a624a4ec5c
2019-12-11 13:51:13 -08:00
TreeHugger Robot
0f2ba63003 Merge "Add AUDIO_INPUT_FLAG_DIRECT to Audio HAL constants" 2019-12-11 21:36:51 +00:00
Mikhail Naganov
d334593715 Add AUDIO_INPUT_FLAG_DIRECT to Audio HAL constants
This flag used to be framework only. To simplify constants
management it's better to have it defined at all layers.
Currently it is only used for MSD module but potentially
can be used for HDMI inputs.

Bug: 141273649
Test: use AOSP MSD on Pixel
      atest VtsHalAudioV6_0TargetTest

Change-Id: I3b853d5d0a05cc4d4bacd0a9ae432099bb47fad9
2019-12-10 16:47:00 -08:00
Eric Laurent
ceaeee1d73 Audio effect HAL: Add device ID to createEffect API
Add the possibility to specify a target audio device when
creating an audio effect by passing its audio port handle
to createEffect API.

To attach an effect to a device, the framework will use
session ID AudioSessionConsts.DEVICE and provide a valid
AudioPortHandle as device ID.

Bug: 136294538
Test: make
Change-Id: Ic697eeafbd5df6800ad4c7fd9e0698e3d8e3beae
2019-12-09 09:46:37 -08:00
Eric Laurent
6d48565360 audio: add audio session for device effects
Add specific audio session ID for effects applied to a
particular audio device.

Bug: 136294538
Test: make
Change-Id: Iea3e3a07f404e1075844422c740d2dc4d5163598
2019-12-06 12:26:26 -08:00
Treehugger Robot
d3a2bdfc63 Merge "Refactor for audio device type in conversion." 2019-12-05 20:17:59 +00:00
jiabin
f17047d892 Refactor for audio device type in conversion.
As audio device type can not be used as bit mask any more, refactoring
audio device type usages in conversion from/to HAL. Use a set of audio
device types instead of bit mask.

Bug: 135621476
Test: atest VtsHalAudioV5_0TargetTest
Change-Id: I1a0f574744f855bb1684cd28613571399781abbc
Merged-In: I1a0f574744f855bb1684cd28613571399781abbc
2019-12-04 17:51:05 -08:00
Mikhail Naganov
2cee5c316e Audio HAL: Fix UAF if the effect is removed after close am: 532240f4eb am: 78836599d2
am: 21dfccb823

Change-Id: I0c607d42aa174c7e50ee53b838a811ae00c33970
2019-12-04 17:41:20 -08:00
Mikhail Naganov
532240f4eb Audio HAL: Fix UAF if the effect is removed after close
Effect::close in V6 releases the underlying HAL effect.
It was not removing the effect entry from the effects
map, thus a call to Stream::removeEffect was retrieving
a stale handle.

Bug: 145656878
Test: start and stop recording for VOICE_COMMUNICATION
Change-Id: I47f486d3b6b4b0dc29acd1e3a2093e421b28d90b
2019-12-04 16:21:28 -08:00
Automerger Merge Worker
dcd93513e6 Merge "audio VTS: Fix parametrization for compressed formats" am: bff764d944 am: 630fc31844
Change-Id: Ie590fa7df4cb59c0266831f4d76874c1864a3996
2019-12-04 17:11:11 +00:00
Treehugger Robot
bff764d944 Merge "audio VTS: Fix parametrization for compressed formats" 2019-12-03 23:59:15 +00:00
Mikhail Naganov
26d535b58e audio VTS: Fix parametrization for compressed formats
Compressed formats should not be opened with DIRECT flag
only, as this will result in playing out compressed data.

Bug: 141989952
Test: atest VtsHalAudioV6_0TargetTest
Change-Id: I873f9a25d5109fb9f5d56f5f748d1348dc12d416
2019-12-03 10:45:23 -08:00
Steven Moreland
c2a2995047 Merge "./update-makefiles.sh, for union changes/memory" am: 00daede4d5 am: 0942e33017
am: 87fe284668

Change-Id: I3a331b5e1c5418426a084f1c7bfe436214a1b68f
2019-11-26 15:00:11 -08:00
Treehugger Robot
00daede4d5 Merge "./update-makefiles.sh, for union changes/memory" 2019-11-26 22:47:34 +00:00
jiabin
5da42a3e3a Use audio containers from libaudiofoundation.
It is suggested to do so according to Vector.h and SortedVector.h.
At framework side, there are audio containers such as FormatVector,
ChannelMaskSet, SampleRateSet to replace the usage of Vector
SortedVector for audio stuff. In default hal implementation, we can
use these audio containers to replace Vector and SortedVector.

Bug: 135621476
Test: play/record audio
Change-Id: I4d985327fb76cd06afe241860d8b592abcbfe4f2
Merged-In: I4d985327fb76cd06afe241860d8b592abcbfe4f2
2019-11-26 11:41:24 -08:00
jiabin
797b5b45fc Add libaudiofoundation.
Some classes, e.g. AudioGain, in libaudiofoundation, which are used by
libaudiopolicycomponent, will require libaudiofoundation as a shared
library to avoid link error when building.

Bug: 135621476
Test: make
Change-Id: I8732bdab37d8afd866fe03a74db3dc564fea1ad2
Merged-In: I8732bdab37d8afd866fe03a74db3dc564fea1ad2
2019-11-26 11:29:34 -08:00
Steven Moreland
7696aa885f ./update-makefiles.sh, for union changes/memory
Many more types can be used in Java.

Bug: 143566068
Test: N/A
Change-Id: Ie18e1e0f9c22f2ea15b755df3b048c9d651c4945
2019-11-26 09:24:31 -08:00
TreeHugger Robot
1b863c2f9d Merge "Refactor for audio device type in conversion." 2019-11-25 20:04:44 +00:00
Mikhail Naganov
e74d8746cf Merge changes from topic "upstream-close-fixes" am: 7663233f5c am: b6d82825e0
am: 88e9203701

Change-Id: If85dd058799aede5b0770e52b0185d3405f44269
2019-11-25 07:40:37 -08:00
Mikhail Naganov
c48c24bbc9 audio: Factor out IStream operations into a helper class am: 422afc131a am: b0b24baabf
am: b15071a05e

Change-Id: I983c466c2abe0c69fd67105f4dbdfe59e1112757
2019-11-25 07:40:33 -08:00
Mikhail Naganov
7e241b350b audio: Cleanup VTS tests am: 13b99b4cf4 am: 740cb65b21
am: 598db7088c

Change-Id: I0ec9112a79bd66c506228c8b7bc56931c0847536
2019-11-25 07:40:29 -08:00
jiabin
98fd544712 Refactor for audio device type in conversion.
As audio device type can not be used as bit mask any more, refactoring
audio device type usages in conversion from/to HAL. Use a set of audio
device types instead of bit mask.

Bug: 135621476
Test: atest VtsHalAudioV5_0TargetTest
Change-Id: I1a0f574744f855bb1684cd28613571399781abbc
2019-11-22 16:44:34 -08:00