Commit graph

1066 commits

Author SHA1 Message Date
Steven Moreland
c4abc9de35 libhardware: tests/tools to vendor
Since these are vendor interfaces, and we are
preventing system tools from using these.

Bug: 37280010
Test: build
Change-Id: I9ffcb4db015de498e1935c96a2866d26b3c936c4
2023-07-18 20:56:46 +00:00
Treehugger Robot
c0a81b9dc6 Merge "Use requested sample rate when it matches device sample rate." 2023-05-22 18:28:54 +00:00
jiabin
abf24d3cc7 Use requested sample rate when it matches device sample rate.
For input stream, the sample rate should be set as requested one if it
matches the device sample rate and is valid.

Bug: 282816698
Test: TH
Change-Id: Iebee2b269062609ff7bcd460f48714ca64980e68
2023-05-16 23:20:17 +00:00
Treehugger Robot
14f321f5a7 Merge changes I89798eee,Ic3dbab31
* changes:
  Intermittently Audio is not heard in USB Head set, while disconnecting /connecting the usb audio headset.
  Set standby as false when the stream is started successfully.
2023-05-03 17:55:13 +00:00
weizd
5ad6d32f33 Intermittently Audio is not heard in USB Head set, while
disconnecting /connecting the usb audio headset.

In usb audio_hal.c, out-stream standby status was not aligned in
adev_create_audio_patch(), so that stream was considered being in
standby after open.

fix:    Align the standby status.
change: correct update for review comments.

Test: usb headset open works fine with huge times insert/remove.
Change-Id: I89798eeee33d8c5019e7510c23371cb18a00ed32
2023-04-28 11:01:15 -07:00
jiabin
041a7d90dd Set standby as false when the stream is started successfully.
When the audio patch is created and the stream is started, set the
standby as false. In that case, if there is a simultaneous request for
read or write data, it is no need to start the stream again.

Bug: 212509560
Test: repo steps in the bug
Change-Id: Ic3dbab3134bc761271b6b2ac8619135ef08075bc
Merged-In: Ic3dbab3134bc761271b6b2ac8619135ef08075bc
2023-04-28 10:58:50 -07:00
Andy Hung
c2992c7112 AudioParameter: Use for RemoteSubmix exiting
Test: compiles
Bug: 279106598
Merged-In: I50263a48584bac120c65123cd5bed09f60582089
Change-Id: I50263a48584bac120c65123cd5bed09f60582089
2023-04-25 10:45:59 -07:00
Andy Hung
f4871891b2 Merge "HidRawDeviceTest: Enable for device build" am: 698fe8448b
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2404797

Change-Id: Ie2968a66d2f4961ffd8462874710f7eb37dd99ee
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-06 21:01:17 +00:00
Andy Hung
698fe8448b Merge "HidRawDeviceTest: Enable for device build" 2023-02-06 20:24:33 +00:00
Treehugger Robot
345ebca6ba Merge changes from topic "aospUsbHal-bitPerfect" am: 593156f5e9
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2419940

Change-Id: I993649ac1310e5401287531c721e869fe9a0f240
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-03 22:40:11 +00:00
jiabin
d38a7b9807 Add volume control for AOSP USB audio HAL. am: 016fa2107c
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2419939

Change-Id: I3afef6641d042b8e2b06602462101c4adea715a0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-03 22:40:09 +00:00
jiabin
fea9e1be0a Support opening bit-perfect output stream.
When opening bit-perfect output stream, the HAL should require the HAL
configuration match the request exactly.

Bug: 262581771
Test: manually
Change-Id: I2f79d41ad42b0c662d28667bde6ae115575d41e1
Merged-In: I2f79d41ad42b0c662d28667bde6ae115575d41e1
2023-02-02 21:51:11 +00:00
jiabin
016fa2107c Add volume control for AOSP USB audio HAL.
When the stream is open with bit-perfect output flag, the volume command
may be sent to the HAL. Use volume control from the mixer when it is
present.

Bug: 262581771
Test: adjust volume
Change-Id: I11e76450a2c3dbcad0ddbd56bd3db1ea83f10f2b
Merged-In: I11e76450a2c3dbcad0ddbd56bd3db1ea83f10f2b
2023-02-02 21:50:43 +00:00
Andy Hung
b264eb4bd3 HidRawDeviceTest: Enable for device build
Test: $ adb shell hidrawdevice_test /dev/hidraw0
Bug: 265754293
Change-Id: I103ebc030f012d11e977fc155fc68f884f71f518
2023-01-27 11:42:20 -08:00
Treehugger Robot
caeb590d0a Merge "Fix sizeof warnings on unusual calloc" am: 4ca44e7615 am: 3f31ee2d2a
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2337324

Change-Id: I57129773e0e1007c0b774daaf5d898da6736ee44
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-10 02:22:00 +00:00
Chih-Hung Hsieh
69e9179327 Fix sizeof warnings on unusual calloc
Test: make tidy-hardware-libhardware-modules-soundtrigger_subset
Change-Id: If1afcd4834461a2d1f855832dc89b8ae54bd8e2f
2022-12-09 12:41:40 -08:00
Christopher Ferris
de12b9273e Merge "Modify a data structure into a union." am: 8e965d90de am: 9d6b418d6f
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2243423

Change-Id: Id3bbeac041d086619e7313286e144ea2b7c1a931
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-03 02:30:27 +00:00
Brian Duddie
2e6815d22a Increase dynamic sensor op timeout to 1.6 sec am: 9a056455f2
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/libhardware/+/20333186

Change-Id: Ie65bd144da9d4fc20fc3ea799dc148419fda0484
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-02 10:02:52 +00:00
Brian Duddie
9a056455f2 Increase dynamic sensor op timeout to 1.6 sec
Minimizes intermittent failures when a device is in sniff mode.

Fixes: 245881714
Test: enable/disable with spatial audio feature enabled
Change-Id: I5fb5b9ff37a6f8a245678c87ee82e2032dc845f2
2022-10-31 23:15:15 +00:00
Christopher Ferris
8b0619b47d Modify a data structure into a union.
The new 6.0 kernel headers changed all variable length
structures from [0] to []. This causes a clang warning to
trigger, so rewrite the affected data structure using a
union to avoid having a variable sized array in the middle
of the structure.

Test: Builds.
Change-Id: I60c6d31a93566c4aa9f7501f39f88543ee76ce91
2022-10-13 12:39:44 -07:00
Manish Kushwaha
d4085b7193 [dynamic_sensor] correctly interpret HID data
specifically, interpret HID data value as unsigned if minValue is
positive

Fix: 238391386
Test: See "Testing Done" in comments in ag/19889364
Change-Id: I715c2189ad90ee71e022ae131354354157694556
2022-09-09 16:50:00 +00:00
Brian Duddie
f4def6edb5 Clarify and clean up dynamic_sensor documentation
Test: n/a
Change-Id: I0b0226b1fce940bd37b8d8a1f72123948ff1fe0a
2022-08-24 23:21:45 +00:00
Erik Staats
3493565708 Add /dev permissions to dynamic sensor README.md .
Bug: 228879057
Test: Verified in gitiles.
Change-Id: If82a5bf302cb68a2c5b486006e4679fbfc8ee545
2022-04-20 11:16:52 -07:00
Erik Staats
fdb42f78cd dynamic_sensor: Fix HID min/max sample rate computation.
Bug: 228369656
Test: Used uhid-sample to add a dynamic sensor and verified correct
 min/max sample rate.
Change-Id: I88a1bec26a03a97ee7a3c590d2601151b89ee545
2022-04-06 15:30:02 -07:00
Erik Staats
9b8bc0f7c1 dynamic_sensor: Support timing out sensor operations.
Bug: 226012902
Test: Used uhid-sample to add a dynamic sensor and verified it can be
 sampled.
Test: Simulated start sampling ioctl timeout and verified operation
 completes with a timeout and eventually cleans up.
Test: Simulated start sampling ioctl timeout with device removal before
 completion and verified operation completes with a timeout and
 eventually cleans up.
Change-Id: I9a957bc1e4000b2c587278146ecbe6e903010616
2022-04-06 12:42:06 +00:00
Brian Duddie
b9769d799c Change dynamic sensors handle base to 1
Fixes: 227766975
Test: load on device, confirm handle number changed
Change-Id: I0466784d7e468bd785f2525f1ab7cd02cc5436e8
2022-04-01 17:22:31 +00:00
Jean-Michel Trivi
71834f3775 r_submix module: pipe size changes with sample rate
Adapt the pipe size based on the sample rate.
Behavior is unchanged for the default sample rate (48kHz), size
is adjusted by the ratio relative to the default rate.

Bug: 141604269
Test: atest AudioHostTest#testTwoChannelCapturingMediaConversion
Change-Id: I0ba45af18ef02dc0ef77d480e1203d2cd1db9864
2022-02-02 08:27:24 -08:00
Erik Staats
cbcdc02ef4 dynamic_sensor: Support Android head tracker sensor type.
Bug: 189507742
Test: Verified head tracker sensor type and sampling.
Test: Verified custom Android sensor sampling.
Change-Id: Id403de916111ed737b9cebebe9850d5e5845cf56
2022-01-27 20:10:57 +00:00
Zhaoming Yin
c76c1d5799 Fix opendir NULL dirp return issue
Bug: 206035991
Test: use forrest to run boottest

Change-Id: I9e77b7d6184a0ee132b8f058f7f83302c54bcb4a
2022-01-16 08:13:00 -08:00
Erik Staats
8262a62fb2 dynamic_sensor: Use HID unique ID for head tracker UUID.
Also, don't require 16-bit strings for HID name, manufacturer, and
unique ID. Also change dump of HID unique ID to be in hex.

Bug: 213483369
Test: Verified that the standard Android head tracker sensor uses the
 HID unique ID for the sensor UUID.
Test: Verified that custom Android sensors use a fabricated UUID.
Change-Id: I125f84187868543dccab758e22dce744c013578e
2022-01-06 12:28:06 -08:00
Greg Kaiser
3f7bbbb4f1 r_submix HAL: Remove unused variable
We no longer set force_pipe_creation after the removal of
legacy code for in-pipe conversions, so we remove it.

Test: TreeHugger
Bug: 141604269
Change-Id: I82393ba0ad3142aa75d482cc6b0edbaeebbd8116
2022-01-05 07:00:42 -08:00
Jean-Michel Trivi
61d799a5e1 Merge "r_submix HAL: remove legacy code for in-pipe conversions" 2022-01-04 16:36:02 +00:00
Treehugger Robot
eaf73c934e Merge "r_submix: add owners file" am: 593bff82da am: eba0d7f70e am: a66b1a2486 am: 140613a961
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/1935497

Change-Id: I50f08b51fbc69e8262f7cc005fc5de3f1b74739e
2022-01-03 11:35:04 +00:00
Treehugger Robot
140613a961 Merge "r_submix: add owners file" am: 593bff82da am: eba0d7f70e am: a66b1a2486
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/1935497

Change-Id: Ib2386d226b0708a6ed0118bad02189d3ac33a4ba
2022-01-03 11:18:33 +00:00
Jean-Michel Trivi
16699d13ec r_submix: add owners file
Bug: 141604269
Test: see gerrit
Change-Id: I975390f8f495267ef0cd24dc8e73db859e541146
2021-12-30 16:29:03 -08:00
Jean-Michel Trivi
a33c1654fb r_submix HAL: remove legacy code for in-pipe conversions
Old hacky uses of this HAL required channel and sample
rate conversion, which were never expected when this HAL
is used for its real application as the backend for
dynamic audio policies. In that context conversions are
performed in audio_flinger in the mixer.

Bug: 141604269
Test: atest AudioHostTest#testTwoChannelCapturing

Change-Id: I333e981fb3db403ab2da6f77debe49bc7d132ebc
2021-12-23 11:49:28 -08:00
Erik Staats
75fb5d739e Add dynamic sensor README.md.
Bug: 207008609
Test: Verified in gitiles.
Change-Id: I7bb8575aef0a8764390a6dc8f4ca785f49a1eb61
2021-12-16 20:09:59 +00:00
YiMing Tseng
d2299dd03b Add GRALLOC_FRAMEBUFFER_NUM configuration am: 0b5ab223e1 am: 56747f919a
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/libhardware/+/16235226

Change-Id: I235c7d209671734473f9e5885b49e1670a19fcf2
2021-12-16 03:32:23 +00:00
Erik Staats
4b4cb8dab3 dynamic_sensor: Fix report item offset calculation.
Bug: 207008609
Test: Verified dynamic sensor sampling with proposed standard Android
 head tracker.
Change-Id: I163b79c2c99f02961adebcb5dcb7e39603944e24
2021-12-10 12:20:22 -08:00
YiMing Tseng
0b5ab223e1 Add GRALLOC_FRAMEBUFFER_NUM configuration
Add config to set the NUM_BUFFERS. Set NUM_BUFFERS to 1 can
prevent page flipping and set it to a larger number can allow
userspace to fill up the following frame earlier.

Bug: 205917753
Change-Id: Ibf4a52a1e35f4a2404008a48b637cb82c4b46365
2021-12-09 09:09:25 +00:00
Erik Staats
0d8677fa4d dynamic_sensor: Support recognizing head tracker sensor. am: dbf2545214 am: ec9039d20a
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/libhardware/+/16382054

Change-Id: Iaf36409f05f4c8e3f62fd61323f573575bed0cb7
2021-12-03 14:43:46 +00:00
Erik Staats
dbf2545214 dynamic_sensor: Support recognizing head tracker sensor.
Bug: 207008609
Test: Verified dynamic sensor sampling with proposed standard Android
 head tracker.
Test: Verified dynamic sensor sampling with custom Android sensor.
Change-Id: Ia9b991d4a8f7de132cb8509bcc84c51f62e56b31
2021-12-02 15:48:00 -08:00
Erik Staats
7007ba93ef dynamic_sensor: Support non-8-bit sized HID report items. am: 4cb45aba7f am: 99ad5c01bb
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/libhardware/+/16359454

Change-Id: I33e8fb34157fcfd27f649b1b956a4c28dddad6a3
2021-12-02 16:42:09 +00:00
Erik Staats
4cb45aba7f dynamic_sensor: Support non-8-bit sized HID report items.
Bug: 207008609
Test: Verified dynamic sensor sampling.
Test: Verified unit tests pass.
Change-Id: I797ccabadefa0dde59fd0f3e8541f9853d657f3f
2021-12-01 14:45:36 -08:00
Erik Staats
82bbf6dc12 dynamic_sensor: Support report and power usage collections. am: f99f73ceeb am: 2978c08ef0
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/libhardware/+/16323898

Change-Id: I45025e510e2a836b6f43949fea7955dafd601755
2021-11-23 14:14:18 +00:00
Erik Staats
f99f73ceeb dynamic_sensor: Support report and power usage collections.
Bug: 207008609
Test: Verified dynamic sensor sampling.
Change-Id: If0bef3647d5c52f9bf1d92a2a0ead72e98c70b8c
2021-11-22 10:56:57 -08:00
Erik Staats
157ae479bc dynamic_sensor: Don't hold mgr lock when operating sensor. am: 24ead9d84a am: 9ec6c4dcf7
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/libhardware/+/16185557

Change-Id: I8023f1d8f67ab5de14e1b7c1b7631f43f8f35fd0
2021-11-04 16:46:44 +00:00
Erik Staats
24ead9d84a dynamic_sensor: Don't hold mgr lock when operating sensor.
Bug: 205041452
Test: Verified that multiple subscriptions can be made with sensor_test
 to a dynamic sensor without hanging.
Change-Id: Ie7671df8294bee04a0ebe1940242c2a83105f897
2021-11-03 15:32:49 -07:00
Erik Staats
f3852875e7 dynamic_sensor: Add multi-HAL 2.1 flush support. am: 35964ba076 am: d30ecf1f7d
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/libhardware/+/15974606

Change-Id: Ie329b87fa137b389231aac7b467a1d13652c5f76
2021-10-05 13:10:03 +00:00
Erik Staats
35964ba076 dynamic_sensor: Add multi-HAL 2.1 flush support.
Bug: 201730055
Test: Verified that flush, batch, and activate sensor VTS tests pass.
Change-Id: I6721d9f8976b3ef9f6af02b2320833025b479ee6
2021-10-04 15:17:32 -07:00