Commit graph

81 commits

Author SHA1 Message Date
Kevin Rocard
55b1061d9c Audio: Run clang-format on all files
That will permit minimal change on future refactors.

Bug: 118203066
Test: compile
Change-Id: Ibed095d3821e2f7b6177faa07775bde9821459c7
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-11-28 17:54:35 -08:00
Keun Soo YIM
ff84c37bc1 pack VTS cc_test binaries as general-tests
Test: make general-tests
Bug: 120093339
Change-Id: I363450d205868f900e4925ccff1430e2a569f2a4
2018-11-27 16:11:41 -08:00
Kevin Rocard
4f62e23dd5 Audio VTS: Do not constrain implementation frameCount am: 069bc45044 am: b86e285537
am: e029bd11f8

Change-Id: Ia2c98e461ee7a39ef56e0f1b6e2dd85c446b6216
2018-10-03 16:28:44 -07:00
Kevin Rocard
e029bd11f8 Audio VTS: Do not constrain implementation frameCount am: 069bc45044
am: b86e285537

Change-Id: Id3c6275cdb5c9de079c425d8f252a6f3e9ac7b99
2018-10-03 16:22:39 -07:00
Kevin Rocard
069bc45044 Audio VTS: Do not constrain implementation frameCount
The test was assuming Stream::getFrameCount() would return the
AudioConfig::frameCount used to create the stream, similarly
to the sampleRate or the channelMask.

Nevertheless this is not the case as the AudioConfig::frameCount
field is not to used by Stream::openOutputStream (nor Input) as
the buffer size is chosen by the HAL, not the framework.

Thus the test can not assume the frameCount chosen by the HAL and
must not test for a particular value.

Test: atest VtsHalAudioV4_0TargetTest
Bug: 116169974
Change-Id: Ibbf0825f540957e01e7c512d851cb9628991f4c4
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-10-02 22:07:39 +00:00
jiabin
798e34e901 Test getActiveMicrophones API when mic is found on the device. am: 497edcc026
am: b2925defca

Change-Id: I290751baf02aefdf7a1bac6ea12f489a1a368c84
2018-09-27 11:43:31 -07:00
jiabin
497edcc026 Test getActiveMicrophones API when mic is found on the device.
Before this patch the default microphone was required to have characteristics
although it is not always an attached device, thus its characteristics can not
be known by the HAL. Additionally, the HAL might not know the active
microphone info of a input stream if it has not been started yet.

This patch only tests microphones which characteristics are reported by the HAL
and start the input stream before requesting active microphones.

Bug: 109787938
Test: vts-tradefed run vts --module VtsHalAudioV4_0Target
Change-Id: If55bfc8210d4f9443d34951f717c6772b46dde04
Merged-In: If55bfc8210d4f9443d34951f717c6772b46dde04
2018-09-26 10:05:15 -07:00
Kevin Rocard
426bea313a resolve merge conflicts of 2e32d37877 to master
Test: I solemnly swear I tested this conflict resolution.
Bug: None
Change-Id: I393be9e597ff1f72ec2c71efbbbc8e518398190a
2018-09-21 12:03:28 -07:00
Kevin Rocard
2e32d37877 Audio VTS: Workaround async HIDL destructor by sleeping am: d87a288e82
am: 988c4a3f48

Change-Id: I86f1f3d76a79449eb87f4ea193cbb52f4a73768a
2018-09-20 17:55:26 -07:00
Kevin Rocard
d87a288e82 Audio VTS: Workaround async HIDL destructor by sleeping
The test creates an instance of the Audio HAL then destroys it and create it again.
The test assumed that the destruction was synchronous when in fact it is async with
no way of knowing when the object has been destroyed.

As a result, until a better solution is found, sleep for 100ms to hopefully let enouth
time for the HAL destructor to return.

Bug: 112566489
Test: adb shell /data/nativetest64/VtsHalAudioV4_0TargetTest/VtsHalAudioV4_0TargetTest --gtest_filter=*OpenPrimaryDeviceUsingGetDevice
      atest VtsHalAudioV4_0TargetTest
Change-Id: I0ec75c12007d39060232632708722df5bf0f99d7
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-09-19 18:27:15 +00:00
Kevin Rocard
47b05b57b4 Merge "Audio VTS: Always check for Result::isOk()" into pie-vts-dev am: 2070f8b0b8 am: 3af66411da
am: 1a684e29da

Change-Id: I4e62224eda7a1b824b54356a72f9be3d2c218c81
2018-09-18 11:22:27 -07:00
Kevin Rocard
1a684e29da Merge "Audio VTS: Always check for Result::isOk()" into pie-vts-dev am: 2070f8b0b8
am: 3af66411da

Change-Id: I08841ccfa99aedec0de6aa1752f39cb5530b26c7
2018-09-18 11:06:53 -07:00
Kevin Rocard
e8957a35ea Audio VTS: Always check for Result::isOk()
A test was not checking for the Result::isOk() resulting
in an assert being triggered in HIDL code if the HAL crashed.

Test: (sleep 0.3; adb shell pkill audio) &
      adb shell /data/nativetest64/VtsHalAudioV4_0TargetTest/VtsHalAudioV4_0TargetTest
      # Test finishes in failure but does not crash
Signed-off-by: Kevin Rocard <krocard@google.com>

Change-Id: I97a6213fe82a5e9a6eb333dc1dc2476102610b58
2018-09-06 18:22:23 +00:00
Kevin Rocard
eb2b0093cf Allow getCapturePosition to return 0 frames for unprepared streams
For device supporting getCapturePosition,
VTS only allowed unprepared stream to return INVALID_STATE.
Now also allow for the stream to return 0 frames similarly to the other
non started states.

Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target
Bug: 110367728
Cherry-piked from: d01dc3edac9e92981e7ae419d0e7622f753acf94
Merged-In: Ibdf8df8cb8809e98c40a50035371df6893fe4da4
Change-Id: Ibdf8df8cb8809e98c40a50035371df6893fe4da4
Signed-off-by: Kevin Rocard <krocard@google.com>
(cherry picked from commit 6c9c6e62c1)
2018-08-29 10:29:07 -07:00
Kevin Rocard
8073d8e41c Audio VTS was testing wrong uninitialized variable due to typo
The test was testing a uninitialized variable instead of testing
the result of the tested method.

Bug: 110963314
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target
Merged-In: I9a212eef690ae627fd7f7dbfaf4a0b4047c491b3
Change-Id: I9a212eef690ae627fd7f7dbfaf4a0b4047c491b3
Signed-off-by: Kevin Rocard <krocard@google.com>
(cherry picked from commit 72641e7ad0)
2018-08-28 17:46:41 +00:00
Kevin Rocard
7a25163fff Merge changes from topic "share-buffer" am: 54c3572e99 am: 0005ac0e55
am: f09c8e2d49

Change-Id: Ia853174e0443417ec6406a8a03a551e3e86c7ddd
2018-08-17 18:43:28 -07:00
Kevin Rocard
0005ac0e55 Merge changes from topic "share-buffer"
am: 54c3572e99

Change-Id: I4a8bb74e3dee81cdd0fc478c49acd0771467f227
2018-08-17 17:13:35 -07:00
Kevin Rocard
616d82ddc6 Aaudio: Implement app shareable flag instead of -size hack
am: 51cdd13351

Change-Id: Ifbf493566c45e003ddba23996c8722f3f4c74d4f
2018-08-17 17:13:19 -07:00
jiabin
d03e8f0848 Test getActiveMicrophones API when mic is found on the device.
Before this patch the default microphone was required to have characteristics
although it is not always an attached device, thus its characteristics can not
be known by the HAL. Additionally, the HAL might not know the active
microphone info of a input stream if it has not been started yet.

This patch only tests microphones which characteristics are reported by the HAL
and start the input stream before requesting active microphones.

Bug: 109787938
Test: vts-tradefed run vts --module VtsHalAudioV4_0Target
Change-Id: If55bfc8210d4f9443d34951f717c6772b46dde04
2018-08-16 13:34:36 -07:00
Kevin Rocard
86910f0fc5 Audio default HAL: hidl_memory size must be positive
hidl_memory size is not used on the framework side but is checked by the
hidl framework to be a sensible value.
Due to a hack in O and P, the value can be negative, this leads to
errors in HIDL.

This patch make sure the hidl_memory size is always positive and thus
not affected by the hack.

Test: adb shell data/nativetest64/write_sine/write_sine -pl -m3 -x
Bug: 38118159
Change-Id: Ie53c46c558e8042d74ee32b55219195da82e4bcc
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-08-15 18:06:00 +00:00
Kevin Rocard
51cdd13351 Aaudio: Implement app shareable flag instead of -size hack
Test: adb shell data/nativetest64/write_sine/write_sine -pl -m3 -x
Bug: 38118159
Change-Id: I2e2fc5801ee9f45565be6f989c0d83d0fdf54618
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-08-10 18:27:35 +00:00
Kevin Rocard
9d7cb65c6b Aaudio: Implement app shareable flag instead of -size hack
Test: adb shell data/nativetest64/write_sine/write_sine -pl -m3
Bug: 38118159
Change-Id: I2e2fc5801ee9f45565be6f989c0d83d0fdf54618
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-08-02 23:49:07 +00:00
Kevin Rocard
4c93e5b2ca Audio VTS was testing wrong uninitialized variable due to typo am: 72641e7ad0
am: 1fd78abb44

Change-Id: I92a62d7fe6f12087b481f095655bfbcb753a52c8
2018-06-28 20:07:34 -07:00
Kevin Rocard
1fd78abb44 Audio VTS was testing wrong uninitialized variable due to typo
am: 72641e7ad0

Change-Id: I590efc99f853e1db7fa0747f9c91946913bb3679
2018-06-28 20:03:20 -07:00
Kevin Rocard
72641e7ad0 Audio VTS was testing wrong uninitialized variable due to typo
The test was testing a uninitialized variable instead of testing
the result of the tested method.

Bug: 110963314
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target
Change-Id: I9a212eef690ae627fd7f7dbfaf4a0b4047c491b3
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-06-29 01:36:46 +00:00
Kevin Rocard
923383bf43 Merge "Allow getCapturePosition to return 0 frames for unprepared streams" into pi-dev am: 9d114dbf88
am: 4c3731d522

Change-Id: Ia1ed9cf9f0a46d3a5b13623a456931633b991cab
2018-06-26 12:34:15 -07:00
Kevin Rocard
4c3731d522 Merge "Allow getCapturePosition to return 0 frames for unprepared streams" into pi-dev
am: 9d114dbf88

Change-Id: I18581d63b035e39bbfaf1b8e6b4136f44f792fca
2018-06-26 12:28:19 -07:00
Kevin Rocard
6c9c6e62c1 Allow getCapturePosition to return 0 frames for unprepared streams
For device supporting getCapturePosition,
VTS only allowed unprepared stream to return INVALID_STATE.
Now also allow for the stream to return 0 frames similarly to the other
non started states.

Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target
Bug: 110367728
Cherry-piked from: d01dc3edac9e92981e7ae419d0e7622f753acf94
Change-Id: Ibdf8df8cb8809e98c40a50035371df6893fe4da4
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-06-26 10:29:12 -07:00
Kevin Rocard
0f8133feeb Do not log error on open output/input stream negotiation
The HAL has a negotiation mechanism where if an open output/input
stream is made with unsupported parameters, it will return
a valid config and UNSUPPORTED_PARAMETRS.
This negotiation was confusingly logged as error.

Test:  "adb logcat -s DeviceHAL" show no error on successful
       playback/capture
Change-Id: I5383cdcfdf8a0ca66768ffc106a1b651b9d8b2d1
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-06-21 15:44:39 -07:00
jiabin
ae3196f757 Fix getActiveMicrophones vts failure.
As there could be no mic on the device, the active microphones may not
always exist. With currently implementation in qcom hal, we need to
start the stream to have active microphones. In that case, just check
the return value of the call.

Bug: 109787938
Test: vts-tradefed run vts --module VtsHalAudioV4_0Target
Change-Id: Ia9f5160a278d6c788f8f5eb17b8b276fe1d66076
2018-06-08 15:02:08 -07:00
Kevin Rocard
2581746011 Merge "VTS tests should be static" into pi-dev am: 318d3c4ff6
am: c9e570ac24

Change-Id: I81b38d4855730df19fbf7c03d6255e29def0e53a
2018-05-17 19:34:12 -07:00
Kevin Rocard
c9e570ac24 Merge "VTS tests should be static" into pi-dev
am: 318d3c4ff6

Change-Id: Ib35487ad1645737056935cbf3c60b95e3de16a9c
2018-05-17 19:10:49 -07:00
Kevin Rocard
271d7aaf11 VTS tests should be static
VTS tests can only depend on NDK shared libraries,
they are pushed and run on older desert version.

In theory the VTS tests should be built against the NDK,
but this is not possible due to all the system dependencies.

Bug: 78871270
Test: compile
Change-Id: I48fbffd0316efc151917071c54aa19e533c615df
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-05-16 18:04:57 -07:00
android-build-team Robot
165514bee8 Merge changes I29bbf6bf,Ib0b03fb6 into pi-dev am: 8f3b492c83
am: 610f34929c

Change-Id: Ic3257186e3d33004b57edca79a677bb9126203ac
2018-05-04 17:42:02 -07:00
android-build-team Robot
610f34929c Merge changes I29bbf6bf,Ib0b03fb6 into pi-dev
am: 8f3b492c83

Change-Id: I4382fd70c9937526d8e1a808bda15cb24ec72bc0
2018-05-04 17:26:10 -07:00
android-build-team Robot
8f3b492c83 Merge changes I29bbf6bf,Ib0b03fb6 into pi-dev
* changes:
  Audio HAL HIDL wrapper: Fix incorrect conversion of TTY Mode
  Audio V4 VTS: test setter even if getter is NOT_SUPPORTED
2018-05-05 00:18:23 +00:00
Steven Moreland
c2e9bfd25a rename hidl_enum_{iterator,range}
am: c90461c738

Change-Id: Ibd1094c631431fe63db1021a90e608b3e514c46d
2018-05-01 18:28:12 -07:00
Kevin Rocard
912bd4bf2f Audio HAL HIDL wrapper: Fix incorrect conversion of TTY Mode
The TTYMode enum numeric value was converted to a char* instead of its
literal value and vice versa.

Instead convert it to/from its literal value.
Eg: TTYMode::FULL -> "FULL" instead of "3"
    "FULL" -> 0 as atoi conversion would fail

Test: atest VtsHalAudioV4_0TargetTest
Bug: 71486871
Change-Id: I29bbf6bf3b5532269afcc5d39ea10eff2871bdea
Signed-off-by: Kevin Rocard <krocard@google.com>
Signed-off-by: Jungyee Yoo <jungyee.yoo@lge.corp-partner.google.com>
2018-05-01 17:07:31 -07:00
Kevin Rocard
c1d89888b9 Audio V4 VTS: test setter even if getter is NOT_SUPPORTED
Previously, the setter of optional properties were not tested
if the getter was not supported.
This was an issue as the framework rarely gets, most
often only sets as it consider having the ownership of those properties.
Thus implementation tend to only support set.

As a result optional setter were not tested although called by the
framework.

For example the default impl setTtyMode has a bug that was not detected
because the Pixel HAL does not support getTtyMode.

This patch makes sure to always test getter and setter.

Test: atest VtsHalAudioV4_0TargetTest
Bug: 71486871
Change-Id: Ib0b03fb6eb77cc0428a33eb463166dd7c339bd3d
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-05-01 17:07:29 -07:00
Steven Moreland
c90461c738 rename hidl_enum_{iterator,range}
This is actually a range, not an iterator.

Bug: 78573628
Test: m
Change-Id: Ie824a3eabcb7d5af94a8752e1498bdc8c7032e40
2018-05-02 00:06:33 +00:00
android-build-team Robot
c486a019dc Merge "Add AUDIO_MICROPHONE_CHANNEL_MAPPING_CNT." into pi-dev am: d5c9702411
am: 40789fc01f

Change-Id: I56af4389779b562150bd8a27487afa2a78b86a30
2018-04-30 16:50:09 -07:00
android-build-team Robot
d5c9702411 Merge "Add AUDIO_MICROPHONE_CHANNEL_MAPPING_CNT." into pi-dev 2018-04-30 23:05:33 +00:00
jiabin
ca3803f10e Add AUDIO_MICROPHONE_CHANNEL_MAPPING_CNT.
Bug: 75041465
Test: make
Change-Id: I2cb444637ddfa67949cb95af80c691fa6892b639
2018-04-30 14:21:58 -07:00
Jiabin Huang
ccbd556de8 Merge "Add vts for microphone enumeration APIs." into pi-dev am: 418b539737
am: 9ace003015

Change-Id: Ic1d07d90f89d4686cdddceb69398cf6c22205d37
2018-04-27 08:36:26 -07:00
jiabin
bad3b28b60 Add vts for microphone enumeration APIs.
Bug: 64038649
Test: run vts --module VtsHalAudioV4_0Target
Change-Id: If75ee585a9d865d010fc7d2a081b930fba022a20
2018-04-25 10:17:29 -07:00
Kevin Rocard
837dfd4c86 Merge changes I2f70f2ec,I9d77a59e,Ied3a657d,Ib6e9d017,I95db94ed, ... into pi-dev am: adf9e18c01
am: 8569e749d8

Change-Id: I34440ef83b9089b5548621f1f020d524c4516635
2018-04-24 18:32:24 -07:00
Kevin Rocard
d2f6be72ef Audio V4: Add missing VTS
Test: atest VtsHalAudioV4_0TargetTest
Bug: 74037175
Change-Id: I2f70f2ec6d4b1ee015de6b4937832903d945fdeb
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-04-24 10:47:50 -07:00
Kevin Rocard
82cef8d3f9 Audio V4: VTS Pause was testing resume
Bug: 74037175
Test: VtsHalAudioV4_0TargetTest
Change-Id: I9d77a59e69452e0891dc4e8e2cc2a14fef4fda41
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-04-23 21:59:44 -07:00
Kevin Rocard
64c3932736 Audio V4: factorize analyzeStatus
This factorization had not been ported from the AOSP patch.
The code is functionally identical.

Test: compile
Bug: 69010523
Change-Id: Ied3a657d7c219b580eb32377789096f6b2f6dc19
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-04-23 21:59:44 -07:00
Kevin Rocard
cff6813819 Audio V4: fix invalid SupportedChannelMasks test
Test was calling getSupportedSamplingRate instead of channel mask.

Bug: 77307068
Test: atest VtsHalAudioV4_0TargetTest
Change-Id: Ib6e9d017793edfc95853cab0c2955b8c801bc66f
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-04-23 15:28:20 -07:00