Commit graph

995 commits

Author SHA1 Message Date
Andy Hung
61583424ff USB Audio Hal: Fix CTS timestamp handling
Bug: 192702566
Test: atest AudioRecordTest#testTimestamp
Change-Id: I3f045b309c8a95ecbe042fd9222e627cac2cb1c9
2021-07-02 17:57:16 -07:00
Andy Hung
df51120802 USB audio hal: Support FCC_LIMIT for 22.2 testing
Test: dedicated test with FCC_LIMIT = 12, 24
Bug: 189325443
Change-Id: I4a54b77c013e44bef02d612a2b93dfe71b300e32
2021-06-08 07:13:16 -07:00
Yifan Hong
b562c5633e Merge "Use libgtest_prod_headers." am: 7749ef2a4a am: fc3c4d6cb4 am: 09df2e2c96
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/1687225

Change-Id: I19e5fa41a24414e66153b8cf868c04f97983f330
2021-04-28 22:12:03 +00:00
Yifan Hong
7749ef2a4a Merge "Use libgtest_prod_headers." 2021-04-28 20:53:30 +00:00
Yifan Hong
bb1479b00b Use libgtest_prod_headers.
Test: builds
Bug: 185916167
Change-Id: Ifdb71aa9e6e9eeadd4d7c9cb4850832650dd12e8
2021-04-26 16:36:38 -07:00
Treehugger Robot
41628fee87 Merge "r_submix: Implement get_capture_position" am: 6ca3fb08ca am: 38e37ba4c6 am: ffabaf42ef
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/1642345

Change-Id: I3abaeee2a533fbd6b4f989ae6770bd724d96e295
2021-03-22 10:44:23 +00:00
Mikhail Naganov
8c97d24e3a r_submix: Implement get_capture_position
IStream.getCapturePosition becomes mandatory in
audio HAL V7. The legacy implementation must
provide it for the default HAL implementation.

Bug: 161253754
Test: atest VtsHalAudioV7_0TargetTest
Change-Id: I2f2094f0499ba85f53f291e0a269211981b4c9d8
2021-03-17 13:19:49 -07:00
Bob Badour
df8e00240f Merge "[LSC] Add LOCAL_LICENSE_KINDS to hardware/libhardware" am: a3888bdcb9 am: c623db5c2c am: 254f2f1062
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/1588486

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I94a1f76615214a26e33712c0a351ace4f0126527
2021-02-20 17:22:58 +00:00
Bob Badour
d7984ccf02 [LSC] Add LOCAL_LICENSE_KINDS to hardware/libhardware
Added SPDX-license-identifier-Apache-2.0 to:
  modules/audio/Android.bp
  modules/audio_remote_submix/Android.bp
  modules/audio_remote_submix/tests/Android.bp
  modules/camera/3_0/Android.bp
  modules/consumerir/Android.bp
  modules/fingerprint/Android.bp
  modules/gralloc/Android.mk
  modules/hwcomposer/Android.bp
  modules/input/evdev/Android.bp
  modules/local_time/Android.bp
  modules/nfc-nci/Android.bp
  modules/nfc/Android.bp
  modules/power/Android.bp
  modules/radio/Android.bp
  modules/sensors/Android.bp
  modules/sensors/Android.mk
  modules/sensors/dynamic_sensor/Android.bp
  modules/sensors/dynamic_sensor/HidUtils/Android.bp
  modules/soundtrigger/Android.bp
  modules/thermal/Android.bp
  modules/tv_input/Android.bp
  modules/usbaudio/Android.bp
  modules/usbcamera/Android.bp
  modules/vibrator/Android.bp
  modules/vr/Android.bp
  tests/camera3/Android.bp
  tests/fingerprint/Android.bp
  tests/hardware/Android.bp
  tests/hwc/Android.bp
  tests/input/evdev/Android.bp
  tests/nusensors/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  Android.bp
  modules/camera/3_4/Android.mk

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I28924363e6c478f5d0b465b63534c4efd041c770
2021-02-12 20:51:13 -08:00
David Li
79f27ce9dd Merge "add audio.usbv2.default linking libtinyalsav2 and libalsautilsv2" am: bd8ee49f8b am: b956508fa6 am: 350d586116
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/1566240

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic9632f86ac1e5b8cbf16e28e2ecc36b7ae013315
2021-02-03 02:56:34 +00:00
David Li
98b3be0068 add audio.usbv2.default linking libtinyalsav2 and libalsautilsv2
Test: mm audio.usb.default audio.usbv2.default
Bug: 134958010
Change-Id: I2664a7461afaed6f71d58d730c7b8d5463240653
2021-02-01 05:33:03 +00:00
jiabin
a635fcfa6a Upgrade legacy usb HAL to version 3.2.
Upgrading legacy usb HAL to version 3.2 and implementing
get_audio_port_v7. The API get_audio_port_v7 returns the device
capabilites with supported formats and corresponding supported
channel masks and sample rates for the formats.

Bug: 160352965
Test: manually
Test: VTS with adding usb as attached devices.
Change-Id: I90a2b2706aa2b385210fb4922e4287f9f0ff9d6c
2021-01-13 22:25:51 +00:00
jiabin
400bbe0e7d Upgrade device version of usb audio HAL to 3.0.
Upgrade device version of usb audio HAL to 3.0. With this change, the
framework will use createAudioPatch API for audio routing.

When opening a stream, the HAL will open alsa device with the given
device information. The HAL will cache the io handle to identify the
stream. Before starting audio playback/recording, create_audio_patch
API is called to set the correct devices. All the devices will be
cached as a list in stream_in/stream_out. The HAL will return a unique
patch handle which is used when updating/releasing the patch. When
patch is released, the patch handle will also be removed.

Bug: 160352965
Test: playback/record with usb device
Change-Id: Iba69c5cc82d1063af8ab050183d6a57b27083ee1
2020-12-17 13:09:38 -08:00
jiabin
8b265c90b2 Use list to cache alsa_device_profile/proxy for usb playback/capture.
This is part of supporting multiple devices playback. Currently, the usb
audio module only supports single device. The limitation is that there
is only one alsa_device_profile/proxy cached. With supporting multiple
devices playback in audio framework, it makes sense to use list to cache
alsa_device_profile/proxy so that it is possible to route audio to
multiple USB devices simultaneously.

To keep the code symemetric, the device for capture is also cached as a
list. But there will only be one device for capture.

Test: play audio via USB
Bug: 160352965
Change-Id: Ibe7bbb7000d657381b317c19fda57e6c0edaa1df
2020-12-07 07:06:24 -08:00
Mikhail Naganov
e72761731d Convert mask types from uint32_t to enum type
This applies to the following types:

- audio_gain_mode_t;
- audio_flags_mask_t;
- audio_channel_representation_t;
- audio_channel_mask_t;
- audio_devices_t.

Enum types are distinct thus proper overloading on the type
is possible in C++. Also, assignments to enum types are
less prone to errors.

Bug: 169889714
Test: basic audio functionality
Change-Id: I8f1e6fa2bbad8900fdae66f01ac70c75953fd62c
Merged-In: I8f1e6fa2bbad8900fdae66f01ac70c75953fd62c
2020-11-24 03:43:26 +00:00
Mikhail Naganov
27aa8b3a53 Convert mask types from uint32_t to enum type
This applies to the following types:

- audio_gain_mode_t;
- audio_flags_mask_t;
- audio_channel_representation_t;
- audio_channel_mask_t;
- audio_devices_t.

Enum types are distinct thus proper overloading on the type
is possible in C++. Also, assignments to enum types are
less prone to errors.

Bug: 169889714
Test: basic audio functionality
Change-Id: I8f1e6fa2bbad8900fdae66f01ac70c75953fd62c
2020-10-02 13:35:41 -07:00
Xin Li
fae361f24e Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I500b53e89f132b3925e6a1912c75b7834ea47ff4
Change-Id: Ib50a9978c77eda7e20e27f2d63615599f0517b6d
2020-08-27 10:16:42 -07:00
Christopher Ferris
e7438cd2e8 Merge "Update codeMap for v5.8 kernel update." am: a1a6f9e819 am: 36bca0314d
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/1388971

Change-Id: Idcd89f3476767814cf615190cc6d1ece461081e2
2020-08-06 17:05:42 +00:00
Christopher Ferris
82dca31ec3 Update codeMap for v5.8 kernel update.
This also allows the previous kernels to still use the previous values.

Test: Builds and boots.
Change-Id: I12b5a5f15d198de642e8582bc2320fe6b1409bcf
2020-08-05 13:27:47 -07:00
Orion Hodson
0c62e87a9e Merge "Add jni_headers to libinput_evdev" am: 93b6bed67a am: 76f174cfe4
Change-Id: I022224e6e2652ba10e3a849de3836e107c7adb13
2020-06-01 09:58:43 +00:00
Orion Hodson
2bc7bf0b34 Add jni_headers to libinput_evdev
Preparation for removing implicit include paths for jni.h from soong.

Bug: 152482542
Test: apply soong change and 'm checkbuild'
Change-Id: I0a021d293f53fdb78b37452b5aa873d809e6ca81
Merged-In: I0a021d293f53fdb78b37452b5aa873d809e6ca81
Exempt-From-Owner-Approval: build clean-up
(cherry picked from commit a49fa1c8a9)
2020-05-27 16:54:12 +01:00
Mikhail Naganov
1d08a56cff usbaudio: Add missing 'return' on error
Code in adev_open_input_stream was deallocating
a structure but then using it again due to absence
of a 'return' statement.
Found by clang-tidy.

Bug: 152526318
Test: m
Change-Id: I9ec3148197715fb118e99503d2b52412a4fb2a73
2020-03-26 13:18:12 -07:00
Eric Laurent
8349affbf8 audio remote submix: fix write blocked on input standby
Do not block in out_write() when the peer input is in standby to avoid
remaining stuck when writing to the blocking mono pipe.

Bug: 141878993
Test: atest AudioHostTest#testTwoChannelCapturing

Change-Id: Ie92d59529ac1018a6785c3ac31696dcccdbb204a
Merged-In: Ie92d59529ac1018a6785c3ac31696dcccdbb204a
2020-03-23 17:34:47 -07:00
Automerger Merge Worker
e5f6709ff0 Merge "Fix camera.v4l2 module build error" am: 2e88e2d003 am: 2e5ebdc287 am: cfb9a10ba2
Change-Id: If6351c622598606031c9f40e9d1690be3cb2749f
2019-12-14 00:58:25 +00:00
Treehugger Robot
2e88e2d003 Merge "Fix camera.v4l2 module build error" 2019-12-14 00:28:26 +00:00
Automerger Merge Worker
3e00f5dcbf Merge "Update for increased SW input codes." am: 028d49fd02 am: e8b375fb86 am: d8e047e20d
Change-Id: Ief54d9216855c32cf61b95a35a4ea1961879b95a
2019-12-13 22:19:07 +00:00
Changyeon Jo
a8998121ab Fix camera.v4l2 module build error
Undeclared uint8 data types are used in exif_utils.cpp file and this
change corrects their types as uint8_t instead.

Bug: 140885470
Test: mm
Change-Id: I2e48a134c24cd3f17a7b6bafdc815200ca546826
Signed-off-by: Changyeon Jo <changyeon@google.com>
2019-12-13 03:20:34 +00:00
Christopher Ferris
8f1020639f Update for increased SW input codes.
The new android-mainline kernel has increase the maximum number of
SW input codes to 33, so update the code to handle more than 32
values.

Test: Builds.
Change-Id: I344de37569c1d2c4ff94b8025a7339147ac9afe7
2019-12-10 12:56:15 -08:00
Treehugger Robot
3fe18ca38f Merge "r_submix: Fix get_next_write_timestamp and get_input_buffer_size" 2019-11-12 02:20:38 +00:00
Nick Desaulniers
130c712501 Merge "libhardware: fix -Wreorder-init-list" am: b833bfbd5f am: 93aa2fa353
am: 8dc561977f

Change-Id: I98ccee55403bd66f8aec783c7a9f91316a31fc19
2019-11-11 18:13:11 -08:00
Nick Desaulniers
79149a378b libhardware: fix -Wreorder-init-list
C++20 is stricter about member ordering in designated initializers than
C99.

Bug: 139945549
Test: mm
Change-Id: I045da46821280e720286a25a0c96b5750d1ad05e
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-11-11 14:41:57 -08:00
Inseob Kim
73dad9ba12 Merge "Use shared version of vndk libmedia_helper" am: deb0edbe3a am: 1f95cfe12e
am: 738edce4ac

Change-Id: Ic2a698b04ce0ca812edf8397bd835dd235a62eb9
2019-11-10 22:37:54 -08:00
Treehugger Robot
deb0edbe3a Merge "Use shared version of vndk libmedia_helper" 2019-11-11 06:15:20 +00:00
Mikhail Naganov
0906419517 r_submix: Fix get_next_write_timestamp and get_input_buffer_size
Fix the implementation to conform to VTS expectations.

out_get_next_write_timestamp must return "NOT_SUPPORTED" (-ENOSYS)
as it is not supported.

adev_get_input_buffer_size must return a non-zero
buffer size for supported formats, regardless of whether
there are any opened streams at the moment.

Bug: 141847510
Test: atest VtsHalAudioV6_0TargetTest
Change-Id: I322bf8cf42415fddb028c9cd10db0ac82089ce85
Merged-In: I322bf8cf42415fddb028c9cd10db0ac82089ce85
2019-11-08 13:51:56 -08:00
TreeHugger Robot
6720f60ce6 Merge "r_submix: Fix get_next_write_timestamp and get_input_buffer_size" 2019-11-08 17:25:59 +00:00
Colin Cross
ab9314cdfc Merge "Fix accidental implicit fallthroughs" am: 5a651961b0 am: 85a465e3f9
am: 84a156a9ec

Change-Id: I27b574ddfca4b4d21b6d40b6dba64dd3b1265f96
2019-11-07 13:54:57 -08:00
Mikhail Naganov
739ce6bbad r_submix: Fix get_next_write_timestamp and get_input_buffer_size
Fix the implementation to conform to VTS expectations.

out_get_next_write_timestamp must return "NOT_SUPPORTED" (-ENOSYS)
as it is not supported.

adev_get_input_buffer_size must return a non-zero
buffer size for supported formats, regardless of whether
there are any opened streams at the moment.

Bug: 141847510
Test: atest VtsHalAudioV6_0TargetTest
Change-Id: I322bf8cf42415fddb028c9cd10db0ac82089ce85
2019-11-05 14:52:57 -08:00
Colin Cross
377856d1be Fix accidental implicit fallthroughs
-Wimplicit-fallthrough was printing warnings for these, they look
like real errors.  Fix them and re-enable the error.

Test: treehugger
Change-Id: I818e18a995760f17b85b4c72ee577e531fa2a601
2019-11-01 16:37:17 -07:00
Peter Collingbourne
f36313e7fb Merge "gralloc: Configure framebuffer mode according to requested image format." am: 1e249a0769 am: ae5e519fd9 am: 30124221f4
am: 94f0d1a30f

Change-Id: I7673d8aa5ac1fcd61c66739eaacaa27f1ac942d5
2019-10-23 16:28:02 -07:00
Peter Collingbourne
ae5e519fd9 Merge "gralloc: Configure framebuffer mode according to requested image format."
am: 1e249a0769

Change-Id: Ib69d0e28acbb25ef561406c1011aebcac6bb4f5b
2019-10-23 15:22:57 -07:00
Peter Collingbourne
f2ed293b9b gralloc: Configure framebuffer mode according to requested image format.
Previously we were ignoring the requested image format when mapping a graphics
device via gralloc_alloc, and using the mode that the framebuffer started up
in. This meant that on devices whose framebuffer starts up in a mode other
than RGBA8888, we would map the framebuffer in the other mode and attempt to
use it as an RGBA8888 framebuffer, which would lead to crashes or incorrecet
rendering. This is the case in the ARM FVP, whose framebuffer starts up in
RGB565 mode.

Unfortunately there is no preferred image format passed in to fb_device_open,
and we presumably cannot start passing one in for backwards compatibility
reasons. Therefore, we set the image format to RGBA8888, which appears to
be the only format that the platform ends up using.

Bug: 142352330
Change-Id: I24000fd36910b4044ce7659605efc423e36cba00
2019-10-15 17:50:25 -07:00
Eric Laurent
7788716bde audio remote submix: fix write blocked on input standby
Do not block in out_write() when the peer input is in standby to avoid
remaining stuck when writing to the blocking mono pipe.
Bug: 141878993
Test: atest AudioHostTest#testTwoChannelCapturing
Change-Id: Ie92d59529ac1018a6785c3ac31696dcccdbb204a
2019-10-15 12:20:34 -07:00
TreeHugger Robot
5cfe24991e Merge "Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master" into stage-aosp-master 2019-09-11 20:31:31 +00:00
Brian Duddie
1fb26456bf Merge "Update sensors OWNERS" am: f364e76947 am: d2f898c2c7 am: b3a9afa140
am: 814c1ea9f7

Change-Id: I6425bbb3dbf6d296ab5e765cd867b2a034baaaf5
2019-09-09 19:26:01 -07:00
Brian Duddie
b3a9afa140 Merge "Update sensors OWNERS" am: f364e76947
am: d2f898c2c7

Change-Id: I05b0ba18514c92070b5751a7c3ad47a9765baea6
2019-09-09 18:57:02 -07:00
Brian Duddie
71a921d828 Update sensors OWNERS
Test: n/a
Change-Id: Idbf1b969ab4372c0aeb37bff3066c391c69e64a5
2019-09-09 15:01:59 -07:00
Siarhei Vishniakou
489f5cd1cc Merge "Remove custom timestamp from hw/libhw/input" am: 6b14bd1a08 am: 14f4acea32
am: e35998b7a3

Change-Id: Ie8259869952aee389cefeb7d1df0a288ceee1a4f
2019-08-13 22:31:16 -07:00
Siarhei Vishniakou
14f4acea32 Merge "Remove custom timestamp from hw/libhw/input"
am: 6b14bd1a08

Change-Id: If9a4cf1d3ac09a1a1b853951f3af417669f10c54
2019-08-13 22:09:38 -07:00
Siarhei Vishniakou
1fc88e88f6 Remove custom timestamp from hw/libhw/input
These are no longer used by EventHub, and should not be carried forward.

Bug: 116601048
Test: presubmit only
Merged-In: I35129484d9945dcd4d291e0f2fac894e07c53c04
Change-Id: I35129484d9945dcd4d291e0f2fac894e07c53c04
2019-08-13 14:41:47 -05:00
Siarhei Vishniakou
dc00dd017e Remove custom timestamp from hw/libhw/input
These are no longer used by EventHub, and should not be carried forward.

Bug: 116601048
Test: presubmit only
Change-Id: I35129484d9945dcd4d291e0f2fac894e07c53c04
2019-08-12 14:20:09 -05:00