Commit Graph

1089 Commits

Author SHA1 Message Date
Treehugger Robot
a081c2ffd0 Merge "Revert "Increase HidRawSensor thread priority to reduce latency"" into main am: 0d62798e8e
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2753014

Change-Id: I8a2ff0f6b3ebe5aad3040ab4c5b203c87cb27b7c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-15 02:07:08 +00:00
Arthur Ishiguro
371bc82855 Revert "Increase HidRawSensor thread priority to reduce latency"
This reverts commit ae23e94424.

Reason for revert: Possible culprit of b/300512496

Change-Id: Ia99167aa9c979e8afa69ce64f27d535c9228e414
2023-09-14 23:31:27 +00:00
Treehugger Robot
da2289a9f0 Merge "Increase HidRawSensor thread priority to reduce latency" into main am: d88f8e4c58
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2749180

Change-Id: I387dfe7c5ece6cb20ce8ab1f8982186e8d90813d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-13 18:00:14 +00:00
Arthur Ishiguro
ae23e94424 Increase HidRawSensor thread priority to reduce latency
Bug: 296157591
Test: Compile
Change-Id: Ia7eff3aa45b291d150b1c1e0f6a19d41644fd11f
2023-09-12 23:08:10 +00:00
Xin Li
4d52a58120 Merge Android U (ab/10368041)
Bug: 291102124
Merged-In: I0b5ddd4cd207c63185f38a57806b9bae38e82e4d
Change-Id: Ia606eade14a83c87e0bf52ecccd5ebd9035523d4
2023-08-22 11:36:57 -07:00
Juan Yescas
cf51f70e0a gralloc: Remove PAGE_SIZE 4096 usage
Android V will support page size agnostic targets. The bionic macro
PAGE_SIZE won't be defined for the agnostic targets. The PAGE_SIZE
macro will be replaced by getpagesize(), which provide the real
page size, in gralloc.

Bug: 296578499
Test: source build/envsetup.sh
      lunch aosp_cf_arm64_phone_pgagnostic
Change-Id: I963468712a7d65160201b720de0efe009921ad53
2023-08-18 16:04:03 +00:00
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
2849bf8c2b Merge "Use requested sample rate when it matches device sample rate." am: c0a81b9dc6 am: 17c0d514dc am: 0ce9f75613
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2592208

Change-Id: I2b06a5ea9f75b629186941aeebfa188803b5e70e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-22 20:23:54 +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
b1bcb3eef2 Merge changes I89798eee,Ic3dbab31 am: 14f321f5a7 am: d71f056272 am: 90076fb0a6
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2550090

Change-Id: Icfbcc7e323131433f181843f46e2a1de65947f15
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-03 20:20:58 +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
4e7ab5d877 AudioParameter: Use for RemoteSubmix exiting
Test: compiles
Bug: 279106598
Change-Id: I50263a48584bac120c65123cd5bed09f60582089
2023-04-20 20:15:04 -07:00
Andy Hung
7c92b64318 Merge "HidRawDeviceTest: Enable for device build" am: 698fe8448b am: f4871891b2 am: 6766ca4760
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2404797

Change-Id: I02d826405a4d2aa2d36d8bff8720d7639f3a8fed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-06 22:19:37 +00: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
jiabin
662fe4aeda 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
2023-01-10 23:05:02 +00:00
TreeHugger Robot
ab70546cab Merge "Add volume control for AOSP USB audio HAL." 2023-01-10 19:36:27 +00:00
jiabin
c5782cba4a 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
2022-12-15 23:13:20 +00:00
TreeHugger Robot
0efa358cc9 Merge "Support HAL_PIXEL_FORMAT_BLOB in default gralloc" 2022-12-13 01:50:26 +00:00
Theodore Dubois
46fd7e6077 Support HAL_PIXEL_FORMAT_BLOB in default gralloc
Test: manual, ran scrcpy with codec2's blob allocator
Change-Id: I647ed5b0e9df4920e4a02686185956aa71ee806e
2022-12-12 10:50:28 -08:00
Treehugger Robot
f152fc48da Merge "Fix sizeof warnings on unusual calloc" am: 4ca44e7615 am: 3f31ee2d2a am: caeb590d0a
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2337324

Change-Id: Ia70ae54c520d0883a23f237c7fbbe02b0f32a136
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-10 03:17:14 +00: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
0fcfbf598b Merge "Modify a data structure into a union." am: 8e965d90de am: 9d6b418d6f am: de12b9273e
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2243423

Change-Id: I3cd75bcd78d3aa6855eb570f801c61cbca94eb10
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-03 03:02:05 +00: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
13456086a0 Increase dynamic sensor op timeout to 1.6 sec am: 9a056455f2 am: 2e6815d22a
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/libhardware/+/20333186

Change-Id: I017181a60300d7673c2d1926080ef6e18b25d0f4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-02 10:33:09 +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
Treehugger Robot
90a7896e53 Merge "[dynamic_sensor] correctly interpret HID data" am: dcbe8650b6 am: 69f047a046 am: 28bb4526f9 am: 9a2c8265c6 am: 97675c486a
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2213197

Change-Id: If277186697ce25af5b1e23a802baee6efc28993a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-09 22:31:25 +00: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
7aad531bc9 dynamic_sensor: Improve error logging
Correctly pass errno to strerror() rather than the return value, which
will always be -1 on error.

Fixes: 245585769
Test: build only
Change-Id: Iae1170949f3b2a0286ef8b9ddf26c74a6cee6783
2022-09-07 19:46:32 +00:00
Treehugger Robot
6f1044deef Merge "Clarify and clean up dynamic_sensor documentation" am: 4d919104dd am: a43e51cb45 am: d43f111175 am: 530caa4d82 am: ea3b4af844
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2194872

Change-Id: I13c72e30dfe1fefd9cfce7897ada66b5cd13410f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-25 20:03:35 +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
TreeHugger Robot
83e60e540c Merge "Set standby as false when the stream is started successfully." 2022-06-22 00:55:44 +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