Commit graph

221 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Nicholas Ambur
ad84668d29 Merge "add SoundTrigger HAL V2.3" 2019-12-12 21:37:00 +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
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
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
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
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
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
Lloyd Pique
43286a882b Merge "audio: Remove redundant PrintTo definitions" am: 7582ba18ee am: c93cb2e4b4
am: b72d057e24

Change-Id: I759f0e3a808780eb8b686d2553efeb96e46c3b7f
2019-11-20 15:02:12 -08:00
Lloyd Pique
97bc3fba7b audio: Remove redundant PrintTo definitions
hidl-gen now generates them for use by all Google Tests, calling
toString().

The local audio PrintTo definitions in PrettyPrintAudioTypes.h are now
redundant with the generated versions, and the entire header can be
removed.

Test: Verified the generated PrintTo functions work in a different GTest
Change-Id: I80d100907e3c6c638608b0b8b34232b02decac19
2019-11-19 14:45:32 -08:00
Eric Laurent
ac3a62a66a Merge "audio: Add CALL_SCREEN audio mode." 2019-11-08 22:39:10 +00:00
Mikhail Naganov
ccd484bb80 audio: Parametrize core VTS tests
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
2019-11-08 13:45:45 -08:00
Kevin Rocard
2a515e1c27 Introduce Audio V6
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>
2019-11-07 14:19:12 -08:00
Kevin Rocard
55a451825c Change some formatting for better script parsing
Test: Compile
Bug: 134940862
Change-Id: Ibbafdcaa6e0bfa8fd2b80f4a6c9ac6ac95058f93
Merged-In: Ibbafdcaa6e0bfa8fd2b80f4a6c9ac6ac95058f93
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-11-07 14:18:45 -08:00
Kevin Rocard
82d3a0b3c7 Script to generate new audio HAL version
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>
2019-11-07 14:12:52 -08:00
Kevin Rocard
ad17f58e50 Convert audio HAL service mk to bp and rename the service
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>
2019-11-07 14:12:30 -08:00
Kevin Rocard
350ce29826 Audio service: Refactor register interface
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>
2019-11-07 14:11:45 -08:00
Eric Laurent
040bfea972 audio: Add CALL_SCREEN audio mode.
Add new audio mode AudioMode.CALL_SCREEN allowing call screening
to take place while other audio use cases are still active.

Also add audio policy configuration attribute indicating if the
vendor implementation supports this audio mode.

Bug: 140384450
Test: make
Change-Id: I2714a9949f2c45b1f8e5a5c40368a6152bd91572
2019-11-06 12:39:46 -08:00
Steven Moreland
856e1d3874 Merge "update-makefiles.sh: for partial Java pkgs" am: cbd3f444c7 am: 7eebf74e97
am: b2b3af540f

Change-Id: Ib6374f3dc3a00ebcb0fac50bfcd5eda479692565
2019-11-05 11:13:18 -08:00
Steven Moreland
077b73b7ab update-makefiles.sh: for partial Java pkgs
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
2019-11-04 12:50:41 -08:00
Mikhail Naganov
0553d0615c audio: Extract utility functions
Move common code out of the test source.

Test: atest VtsHalAudioV5_0TargetTest
Merged-In: I86cf399029a0a5f3f08c7e82713ae62df03dee3f
Change-Id: I86cf399029a0a5f3f08c7e82713ae62df03dee3f
2019-10-25 15:36:24 -07:00
Mikhail Naganov
8613f809fa audio: Parametrize core VTS tests
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
2019-10-24 16:56:33 -07:00
Mikhail Naganov
d306cccd0b audio: Extract utility functions
Move common code out of the test source.

Test: atest VtsHalAudioV5_0TargetTest
Change-Id: I86cf399029a0a5f3f08c7e82713ae62df03dee3f
2019-10-24 09:09:09 -07:00
Kevin Rocard
0349c2f03d Introduce Audio V6
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
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-10-08 11:07:27 +01:00
Kevin Rocard
5bc18d6538 Script to generate new audio HAL version
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
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-10-08 11:07:27 +01:00
Kevin Rocard
c69e3e997f Change some formatting for better script parsing
Test: Compile
Bug: 134940862
Change-Id: Ibbafdcaa6e0bfa8fd2b80f4a6c9ac6ac95058f93
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-10-07 17:58:15 +01:00
Kevin Rocard
de7d06babb Convert audio HAL service mk to bp and rename the service
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
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-10-07 16:34:26 +01:00
Steven Moreland
38c46d0b98 Merge "Remove libhwbinder/libhidltransport deps" am: 6b62c58a9a am: 8c22c3862f am: 6684ee8c36
am: 9a5ffa3196

Change-Id: I3a80895d10767fe68e90a907312a83ded976cbcc
2019-09-06 16:06:13 -07:00
Steven Moreland
b3a4d3832e Remove libhwbinder/libhidltransport deps
Since these were combined into libhidlbase.

Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: I075670b64eebbbbd6a6ae0e84ad51bf1c6f5ba36
2019-09-06 01:07:02 +00:00
Daniel Norman
5882424812 Merge "Replaces 'oneshot' and 'interface' with 'onrestart restart audioserver'." am: 5bb99e24ad am: 3a6c4696bd am: 1fd3dbe764 am: e7342a0d84
am: a32fd4493c

Change-Id: Id238bef3dd78181dd04b5d8a50b450e280a3a653
2019-07-31 16:24:50 -07:00
Daniel Norman
3a6c4696bd Merge "Replaces 'oneshot' and 'interface' with 'onrestart restart audioserver'."
am: 5bb99e24ad

Change-Id: I38708e1b102546d6024a1f80d2c7d7a7e1c18ee9
2019-07-31 15:21:08 -07:00
Daniel Norman
fb4aadf622 Replaces 'oneshot' and 'interface' with 'onrestart restart audioserver'.
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
2019-07-31 21:08:02 +00:00
Kevin Rocard
5261dce877 Audio service: Refactor register interface
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
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-07-01 17:41:58 -07:00
Kevin Rocard
db834f4e76 Merge "Audio: Document channel order convention" into qt-dev am: d05b62368b
am: b47e60a90d

Change-Id: Ia206fae0f489ae12cd84a86c5f1e7ae066fffd29
2019-05-28 21:12:13 -07:00
Kevin Rocard
d123e015b2 Merge "Audio: Document channel order convention" into qt-dev
am: d05b62368b

Change-Id: Ic63ff46c6461aa2bec27c4ca1d562a348d3d0f53
2019-05-28 21:07:12 -07:00
Kevin Rocard
64a35d0d16 Audio: Document channel order convention
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>
2019-05-29 00:34:38 +00:00
Kevin Rocard
c07520cf65 Merge "Validate HAL mic input" into qt-dev am: 91309a04c8
am: fef2098b48

Change-Id: Ib1fc4bbbcc43667a3555fe0a9afedf91260b160b
2019-05-20 22:05:45 -07:00
Kevin Rocard
d1e4213133 Merge "Validate HAL mic input" into qt-dev
am: 91309a04c8

Change-Id: I687415ab199765c83c130d81e948f6051c3a5e9c
2019-05-20 21:23:07 -07:00
Kevin Rocard
dbb7d0d304 Validate HAL mic input
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>
2019-05-21 00:27:09 +00:00
Steven Moreland
6d494b2346 Merge "Update hidl makefiles for bpfmt" am: ff0bd741ca
am: 96f40f7b02

Change-Id: Idbf030e4993067bdb8181321bca2de00c9b6f7ef
2019-04-18 14:34:45 -07:00
Steven Moreland
1ae4615d9f Update hidl makefiles for bpfmt
hidl-generated makefiles are now generated such that bpfmt(file) == file.

Bug: 67417008
Test: enable bpfmt hook
Change-Id: I1f69d292bc23a7cc293a66110cb02d597e1019ad
2019-04-17 09:38:50 -07:00
Eric Laurent
872ace84c6 audio HAL: restore HOTWORD audio source
HOTWORD audio source was removed from HAL V4.0 by mistake.

Bug: 129001649
Test: make
Change-Id: I664eb6ca2a6c30bc6f48a752cb7300aac6c4294b
2019-03-20 15:58:38 -07:00