Commit graph

581 commits

Author SHA1 Message Date
Kevin Rocard
fba21730f8 Audio: setParam improve status_t to Result consistency
The rest of the API (*::analyseStatus) returns NOT_SUPPORTED
when the legacy API returns -ENOSYS.

setParameter legacy -> treble shim did not follow this
conversion due to the legacy API stating that for get_paramers,
-ENOSYS should be returned if
"the implementation does not accept a parameter change while the
 output is active but the parameter is acceptable otherwise",
aka INVALID_STATE.

Thus setParameter shim used to return
 - OK for OK
 - INVALID_STATE for -ENOSYS
 - INVALID_ARGUMENTS for everything else

This leads to several problems:
 - an implementation of the legacy API can not report NOT_SUPPORTED
 - it is inconsistent with the rest of the status_t conversion methods
 - shim methods implemented over getParameter can not distinguish
   between different failures as required by the .hal documentation

Most importantly, on the system side, the Result is transformed to a
status_t again but without any special logic for methods wrapping
getParameter in the shim.
This can not be changed as the system can not know which methods
are implemented with a legacy wrapper under the Treble API boundary.

Thus setParam now converts status_t to Result in the same way
as all the other shim methods.

This patch is the second half of I41204c0807d2bd4675e941771cbc9a43d7d14855
that was reverted due to a merge conflict.

Bug: 72873273
Bug: 69811500
Bug: 69010523
Test: playback and record for media and voice call
Original-Change-Id: I41204c0807d2bd4675e941771cbc9a43d7d14855
Change-Id: I41328afce56ce31d4a26159ca2d4b16d14cce05b
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-04-20 17:05:17 -07:00
Kevin Rocard
147a454bb2 Audio: make core/4.0/default/Util.h version dependant
This patch does not have any functional change.
It refactors Util.h to make it version dependant.
This is needed in the next patch to add a helper
that uses HIDL types.

This patch is the fixed first half of
I41204c0807d2bd4675e941771cbc9a43d7d14855
that was reverted due to a merge conflict.

Bug: 72873273
Bug: 69811500
Bug: 69010523
Test: playback and record for media and voice call
Original-Change-Id: I41204c0807d2bd4675e941771cbc9a43d7d14855
Change-Id: Ie543519fa0dca62486b75f42bb0c8a93d6cad3c3
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-04-20 17:05:15 -07:00
Kevin Rocard
3d41027bc1 Audio V4: dump effect HAL using the standard debug()
A debugDump was used previously because the debug did not exist.
Now that the framework uses debug(), the HAL must also do so.

Bug: 78307161
Test: adb shell dumpsys media.audio_flinger
Change-Id: Ic5841d5284d742c572629249b80aa1de841983c7
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-04-20 22:15:15 +00:00
Kevin Rocard
3c50fab048 Merge "Revert "Audio: setParam improve status_t to Result consistency"" into pi-dev 2018-04-19 03:32:46 +00:00
Kevin Rocard
f26235fde0 Revert "Audio: setParam improve status_t to Result consistency"
This commit broke sailfish build in V4 due to 
https://cs.corp.google.com/android/hardware/interfaces/audio/core/all-versions/default/include/core/all-versions/default/PrimaryDevice.impl.h?q=hardware/interfaces/audio/core/all-versions/default/include/core/all-versions/default/PrimaryDevice.impl.h:251

not being updated.

This is really strange as
 1) sailfish should not build the V4 code in the first place
 2) walleye is not broken although it should be the broken code
 3) neither treehugger nor my local builds found this issue

Revert to give the time to investigate.

This reverts commit 2c6755a00c.

Reason for revert: <INSERT REASONING HERE>

Change-Id: Ibf5270c15d52212a41b3b4eb4c0fcfe82a08fd6b
2018-04-19 03:29:55 +00:00
Kevin Rocard
f21217f173 Merge "Audio: setParam improve status_t to Result consistency" into pi-dev 2018-04-19 02:08:06 +00:00
Mikhail Naganov
93a2065eca audio: Add VTS tests for new interface methods in V4.0
Add VTS tests for the following methods:
  IStreamOut::selectPresentation
  IPrimaryDevice::getBtHfpEnabled
  IPrimaryDevice::setBtHfpEnabled
  IPrimaryDevice::setBtHfpSampleRate
  IPrimaryDevice::setBtHfpVolume
  IPrimaryDevice::setBtScoHeadsetDebugName
  IPrimaryDevice::updateRotation

Fix the default implementation of IPrimaryDevice::setBtHfpVolume

Bug: 74037175
Test: VtsHalAudioV4_0TargetTest
Change-Id: I39beb05184d0ecdb2799de037e1c5c3c383f5494
2018-04-18 08:41:16 -07:00
Kevin Rocard
2c6755a00c Audio: setParam improve status_t to Result consistency
The rest of the API (*::analyseStatus) returns NOT_SUPPORTED
when the legacy API returns -ENOSYS.

setParameter legacy -> treble shim did not follow this
conversion due to the legacy API stating that for get_paramers,
-ENOSYS should be returned if
"the implementation does not accept a parameter change while the
 output is active but the parameter is acceptable otherwise",
aka INVALID_STATE.

Thus setParameter shim used to return
 - OK for OK
 - INVALID_STATE for -ENOSYS
 - INVALID_ARGUMENTS for everything else

This leads to several problems:
 - an implementation of the legacy API can not report NOT_SUPPORTED
 - is inconsistent with the rest of the status_t conversion methods
 - shim methods implemented over getParameter can not distinguish
   failures error required by the .hal documentation

Most importantly, on the system side, the Result is transformed to a
status_t again but without any special logic for methods wrapping
getParameter in the shim.
This can not be changed as the system can not know which methods
are implemented with a legacy wrapper under the Treble API boundary.

Thus setParam now converts status_t to Result in the same way
as all the other shim methods.

Bug: 72873273
Bug: 69811500
Bug: 69010523
Test: playback and record for media and voice call
Change-Id: I41204c0807d2bd4675e941771cbc9a43d7d14855
Merged-In: I41204c0807d2bd4675e941771cbc9a43d7d14855
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-04-17 20:59:32 -07:00
TreeHugger Robot
c4db9d17cd Merge "Audio V4: Use of EffectFlags over bitfield<EffectFlags>" into pi-dev 2018-04-10 19:34:22 +00:00
Kevin Rocard
4be23925c0 Audio V4: Use of EffectFlags over bitfield<EffectFlags>
This was breaking Treble interface consistency test.

Bug: 77853088
Test: play music effect work
Change-Id: Ieb54f9c154e346286da353d0c3cdc770574c9bfe
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-04-10 09:49:26 -07:00
Kevin Rocard
1fe076b44d Audio V4: Synchronize the devices between the policy XSD and .hal
- The ALL devices should not appear in the XSD as they are helpers for
enum value validity checks.
 - Add the V4 values HEARING AIDS, ECHO_CANCELLER, BLUETOOTH_BLE.
 - Sort the values in the same order as the enum values in
audio-base.h for easier comparison.

Bug: 77307068
Test: xmllint -xinclude --schema \
        hardware/interfaces/audio/4.0/config/audio_policy_configuration.xsd \
        out/target/product/walleye/vendor/etc/audio_policy_configuration.xml
Signed-off-by: Kevin Rocard <krocard@google.com>

Change-Id: I8b970d21eb0b3f256d6866be9ef935d12283076e
2018-04-04 22:18:48 +00:00
Kevin Rocard
60c1ad7797 Audio V4: Add metadata update to legacy API
The metadata API was not present in the legacy HAL which lots of
developer still use.

Test: Check the method is correctly called on each track change
Bug: 38184704
Bug: 69623109
Change-Id: If56b4ee3739194e49808cf24d728c791b0588f9f
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-30 10:21:48 -07:00
TreeHugger Robot
ab5c4f072c Merge "Support query microphones information." into pi-dev 2018-03-30 16:59:41 +00:00
TreeHugger Robot
1d6501ee52 Merge "Audio V4: Add V2 XML in V4 effect" into pi-dev 2018-03-28 20:48:18 +00:00
Kevin Rocard
1641a23adf Audio V4: fix typo in XSD for VTS
Bug: 76165942
Bug: 74037175
Bug: 38184704
Change-Id: If8acbdfd27af726620d53fbded139f1107817ef4
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-27 16:32:00 +00:00
Kevin Rocard
79f1a6faee Audio V4: Add V2 XML in V4 effect
The XML format has not changed. Symlink the V4 XSD to the V2.

Bug: 76165942
Bug: 38184704
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioEffectV4_0Target
Change-Id: I25a61c125c461c6c5b89d53142dcf887d6c94347
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-23 15:21:53 -07:00
jiabin
1b09e26909 Support query microphones information.
Add conversions between hal and framework.

Bug: 64038649
Bug: 75041465
Test: Manual Testing and Cts test
Change-Id: I88a292f0509e09467750affbe84350ed82cdd500
2018-03-21 15:24:20 -07:00
Kevin Rocard
a8da86e403 Audio V4: do not override V4 audo policy config XSD
The xsd did not have its version in its name, thus the V4 and V2 were
overwriting each other.

Bug: 38184704
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV4_0Target
Change-Id: Id7e733729a9afcdcc582f88a5527b6eb1c7283bf
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-21 14:43:36 -07:00
TreeHugger Robot
14dc815cdc Merge changes from topic "audio-hal-v4" into pi-dev
* changes:
  Audio V4: Update V2 tests to V4
  Fix issues in ReturnIn
  Audio V4: Duplicate V2 tests
2018-03-21 03:13:53 +00:00
Dean Wheatley
ce8b2734f7 Add 5.1.2, 5.1.4, 7.1.2, 7.1.4 output channel masks
They were supposed to be added by the change with id
I2f488462614114e4c82149460b030585981ae15e
but actually were not.

Also, rename OUT_TOP_CENTER_... to OUT_TOP_SIDE_...
according to Dean's suggestion.

Bug: 38184704
Bug: 63901775
Test: make
Change-Id: Ib263b06e4f3aa84525c2255f7a52f9bb39dbebcd
2018-03-19 09:38:00 -07:00
Kevin Rocard
e3afd40e91 Audio V4: Update V2 tests to V4
Bug: 74037175
Bug: 38184704
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV4_0Target
Change-Id: Ic8da941fc042b7ef838edf8fdac36b2f0fa1fd32
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-14 19:38:03 -07:00
Kevin Rocard
8532f6b2cc Fix issues in ReturnIn
Bug: 74037175
Test: compile
Change-Id: Icc3a0d1d489474de7c6255a014dccecc4dda4aa2
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-14 19:38:03 -07:00
Kevin Rocard
18f463eeae Audio V4: Duplicate V2 tests
Because VTS must no be modified for old API version (except bug fixes),
as that could break retrocompatiblity.
As a result, a full copy is made. This commit is only:
$ cp -r core/2.0/vts/ core/4.0/vts
$ cp -r effect/2.0/vts/ effect/4.0/vts

With a V2 replaced by V4 test target name to avoid conflict.

Bug: 38184704
Test: Compile
Change-Id: Iddf9e7a9d42bfe84cf067a08d249a9cc0e6b7241
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-14 19:38:03 -07:00
Aniket Kumar Lata
d93a3adab5 audio: Register Bluetooth service with audio HAL
Register Bluetooth audio library with audio HIDL service.
Changes required for A2DP offload implementation.

Bug: 63932139
Bug: 68824150
Test: A2DP offload verified on supported codecs
Change-Id: Idd89f0d28903579d42bd0f33b0194fb8dc2ceaaa
(cherry picked from commit c5a5203114)
2018-03-12 19:18:21 +00:00
Mikhail Naganov
b7e7ccc648 audio HAL: Add missing input channel masks
The following masks added for input: 2.0.2, 2.1.2, 3.0.2, 3.1.2

Bug: 38184704
Bug: 63901775
Test: make
Change-Id: I9ffc2a1858068fdd9fe0777184ea8464e7ab0e3b
2018-03-07 19:27:02 +00:00
Kevin Rocard
bee7f4eb1e Audio V4: Declare support for 4.0 interface
Declare that the audio HAL service supports 4.0 as well as 2.0
interface.
Formatting done by clang-format.

Test: compile
Bug: 38184704
Change-Id: Iee842b141e1218f4f3779187339bde40680ec78a
Merged-In: Iee842b141e1218f4f3779187339bde40680ec78a
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
5ec293316e Audio V4: Implement the shim core 4.0 -> legacy
All the new files added are a copy of the 2.0 ones, with just the
version 2 that was changed to 4.

Due to the rollback on the retrocompatiblity breakage,
the split of implementation is not strictly needed any more.
This makes the current split in .impl.h and double include
unnecessary complicated.
This will need to be factorized in a future patch.

Bug: 38184704
Test: compile
Change-Id: I0d699ade7558ed68125b300f8522e2767ae1ee37
Merged-In: I0d699ade7558ed68125b300f8522e2767ae1ee37
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
91aa1af99a Audio V4: Add its own function to open the primary device
The primary device has its own type and a fixed name and
is not optional.

By having its own getter, the client does not have to downcast it.

Bug: 38184704
Test: compile
Change-Id: I7b22eb0e12bddabfe966a20fbeab37d974306b12
Merged-In: I7b22eb0e12bddabfe966a20fbeab37d974306b12
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
2696030063 Audio V4: Move service entry point to common
The HAL audio service entry point is not version dependant
and is common to core and effect.

Bug: 38184704
Test: compile
Change-Id: I143cf28490afc978791ccd7e8aeee2106cbb2ebd
Merged-In: I143cf28490afc978791ccd7e8aeee2106cbb2ebd
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
af7f78daa6 Audio V4: Implement the shim effect 4.0 -> legacy
All the new files added are a copy of the 2.0 ones, with just the
version 2 that was changed to 4.

Due to the rollback on the retrocompatiblity breakage,
the split of implementation is not strictly needed any more.
This makes the current split in .impl.h and double include
unnecessary complicated.
This will need to be factorized in a future patch.

Bug: 38184704
Test: compile
Change-Id: If412eb55ebf6afc773593547af9395a09b6825c2
Merged-In: If412eb55ebf6afc773593547af9395a09b6825c2
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
f1c1f6e7ac Audio V4: Update .hal doc to removal of audioSource
As multiple tracks can be connected to the same stream,
the audio source list can be found in metadata.

Bug: 38184704
Test: none
Change-Id: I63e75fd4049fbe469b78cacf0adf44e9597cb422
Merged-In: I63e75fd4049fbe469b78cacf0adf44e9597cb422
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
e605e03361 Audio V4: Use string to identify audio Device
The name of an audio device is an opaque string that the
framework does not interpret (there are exceptions, see documentation)
and only uses as an ID to link
the audio_policy_configuration.xml and the audio device factory.

Previously it was an enum which meant that the vendors
could not implement the interface more than a set number of time
and that generic meaningless (secondary, auxiliary) names had
to be introduced.

Bug: 38184704
Test: compile
Change-Id: I9f3ac1928de8116974257951e016108c5820eded
Merged-In: I9f3ac1928de8116974257951e016108c5820eded
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
2b275704bc Fix potential missing '\0' when wrapping to legacy
The HAL API for port name is a C++ string of arbitrary
length.
Nevertheless the legacy API name had a maximum length.
Thus when wrapping from the new to legacy, the string
was truncated but no '\0' was added.

Bug: 38184704
Test: compile
Change-Id: I482363809718281e022041c2d5042e5800c5a617
Merged-In: I482363809718281e022041c2d5042e5800c5a617
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
f0878685d7 Audio V4: Cast conversion now deduce both types
That avoids to repeat the destination type which
can change between versions.

Bug: 38184704
Test: compile
Change-Id: I55c881afe5f6fc511ea01b19c5d46de12fb1e0d2
Merged-In: I55c881afe5f6fc511ea01b19c5d46de12fb1e0d2
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
c5af419ef2 Audio V4: Add V4 common utils
Bug: 38184704
Test: compile
Change-Id: I935fe4343ab517f7a8dc65e1b9720097a3ab34da
Merged-In: I935fe4343ab517f7a8dc65e1b9720097a3ab34da
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
63410e8da4 Audio V4: Do not forward notification detail
Those values are only for the framework, thus they should not be
available to the vendor.

Bug: 38184704
Test: compile
Change-Id: I05d3e506a85dbe66d51b7024fa9de45865bcf9db
Merged-In: I05d3e506a85dbe66d51b7024fa9de45865bcf9db
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
4b6169eec6 Audio V4: Remove system only enum values
Some enum values only used by the system were exposed to the vendor for
legacy reason. Remove them.

Bug: 38184704
Test: compile
Change-Id: I78254047a74d08bcdf2d7b285e874dbd497d5407
Merged-In: I78254047a74d08bcdf2d7b285e874dbd497d5407
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-06 11:30:51 -08:00
Kevin Rocard
4d46cea59c Audio V4: Add owner files for implementations
Bug: 38184704
Test: none
Change-Id: If45a4d7e16ecd045866230b48fde477d21f124e0
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-03-02 12:55:48 -08:00
Haynes Mathew George
a57f41d58c audio: Initialize processstate with vndbinder
Initialize processtate with vndbinder to allow
vendor components to talk via vndbinder

Test: re-launch android.hardware.audio@2.0 service
Change-Id: I9fafff157c5e497a8125b13741b56e0852534ffa
2018-02-28 12:35:18 -08:00
TreeHugger Robot
6b74491d15 Merge "Audio HAL V4: Add Hearing aid output device" 2018-02-16 21:36:13 +00:00
Kevin Rocard
b395bfe4bd Merge "Audio HAL V4: Switch back to 32 bit AudioDevice" 2018-02-16 19:40:35 +00:00
Mikhail Naganov
b6a8851f30 audio hal: Add a method to select presentation in a nex-gen media stream
This adds the following method:
  IStreamOut.selectPresentation

This corresponds to the following legacy parameters:
  AUDIO_PARAMETER_STREAM_PRESENTATION_ID
  AUDIO_PARAMETER_STREAM_PROGRAM_ID

Bug: 63901775
Test: make
Change-Id: I9ca6ead72b1ef80d2de582a6e4b051ee32fe1857
2018-02-15 11:21:55 -08:00
Mikhail Naganov
b2f1c0f857 audio hal: Allow using multiple devices with IStream.get/setDevice
To retain compatibility with existing usages of the "routing"
parameter, IStream.setDevice method must accept multiple devices
(as DeviceAddress). This happens when the patch being created
has multiple sinks.

As a consequence, IStream.getDevices needs to return a vector of
DeviceAddress structs.

Bug: 73240607
Test: make
Change-Id: I77aedeb435988363d30325d045f791f3785c8bb5
2018-02-15 11:21:55 -08:00
Mikhail Naganov
4899fba75e audio hal: Add methods for controlling BT HFP
HFP = Hands-Free Profile
Added following methods:
  IPrimaryDevice.getBtHfpEnabled
  IPrimaryDevice.setBtHfpEnabled
  IPrimaryDevice.setBtHfpSampleRate
  IPrimaryDevice.setBtHfpVolume

Bug: 73257469
Change-Id: I55c06c6b8981821c3bdc3a13c2cb5951c7ea33c1
Test: make
2018-02-15 11:21:55 -08:00
Mikhail Naganov
634c2a7e01 audio hal: Move setConnectedState from IStream to IDevice
It was a mistake to put this method on IStream, in fact
it belongs to IDevice.

Bug: 73087917
Change-Id: I3ece962343c8541b7891b6448eb43e2f9481ed8a
Test: make
2018-02-15 11:21:55 -08:00
Mikhail Naganov
124fac0142 audio hal: Add method for providing current device rotation to HAL
Added method:
  IPrimaryDevice.updateRotation

Bug: 73088071
Change-Id: I23e78b70fa8cb0dba964420519b939856aaa914e
Test: make
2018-02-15 11:21:55 -08:00
Mikhail Naganov
8878f57dd5 audio hal: Add BT SCO headset name setter
This adds the following method:
  IPrimaryDevice.setBtScoHeadsetName

Bug: 73001112
Test: make
Change-Id: I0ebe4defd980915b633365fa75eca65ff7dfc60a
2018-02-15 11:21:55 -08:00
Kevin Rocard
ace0b02fd9 Audio HAL V4: Add Hearing aid output device
This output is used to send audio to earring aid device
(usually through Bluetooth).

Bug: 38184704
Test: mm
Change-Id: I09ec4d2853ef04300fcda45bddb4a42209f19be0
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-14 17:44:33 -08:00
Kevin Rocard
bb90d89746 Audio HAL V4: Switch back to 32 bit AudioDevice
Switching to 64 bit has proven to be too much refactor
and the need is not immediate.

Instead in the next version of the Audio HAL,
AudioDevice will no longer be a bitfield and when multiple
devices will need to be passed, a list will be used.

Bug: 38184704
Test: mm
Change-Id: I8de14fc4ee69fb70fc1c4275b568093a5d0aec1b
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-14 17:44:12 -08:00
Zhuoyao Zhang
7dc6ce8107 Convert audio effect hal test to use VtsHalHidlTargetTestEnvBase
Bug: 64203181
Test: make vts
      vts-tradefed run vts -m VtsHalAudioEffectV2_0Target

Change-Id: Ifbdbfe5d5627f9281ba773cbeac718488d997efd
2018-02-08 12:45:17 -08:00
Kevin Rocard
87ac081930 Audio V4: Create audio V4.0 .hal makefiles
Run update-makefiles.sh to create all HAL makefiles.

Test: update-makefiles.sh
Bug: 38184704
Change-Id: I2532c4b9d1f0f6252ceaffbfb0c5d0a615400c72
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-01 16:17:34 -08:00
Kevin Rocard
eacb99697f Audio V4: More fixes of the audio 2.0 API
Remove unnecessary Result typedef.
Make bufferSizeFrames and burstSizeFrames unsigned
as they should not be negative.
Remove legacy AudioInterleave.
Remove implicit callflow annotation.
Make EffectConfigParameters a bitfield.

Bug: 38184704
Test: hardware/interfaces/update-makefiles.py
Change-Id: I33e6f7869d20ca0cad4123f32347754e5a514caa
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-01 16:17:34 -08:00
Ricardo Garcia
520e53d346 Audio V4: Support query microphones information
Get list of all/currently active microphones from hardware.
Part of the device enumeration feature.

Bug: 64038649
Test: test/vts-testcase/hal/script/update_makefiles.py
Change-Id: I08051f1d6013672dea8f3866776864e87ff35297
Rebased for 4.0 by:
Signed-off-by: Kevin Rocard <krocard@google.com>
Originally written by:
Signed-off-by: Ricardo Garcia <rago@google.com>
2018-02-01 16:17:34 -08:00
Kevin Rocard
c8d7bb7c84 Audio V4: Only expose one notification usage
Too many usages detail were previously exposed to the HAL.
All usages that should be handled identically by the HAL
are now the same value.

 - All notification types are now the same usages

Test: build
Bug: 38184704
Change-Id: I2096f995e249ab02bc29449c6d1a65b521dc13f7
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-01 16:17:34 -08:00
Eric Laurent
34daac8485 Audio V4: Add new api in XSD
Allow multiple concurrent opened profiles.
Allow mixPort to declare their preferred usage.
Allow to declare the default devicePort for a device type.

Bug: 38184704
Test: xmllint --noout --schema hardware/interfaces/audio/4.0/config/audio_policy_configuration.xsd  --xinclude out/target/product/taimen/vendor/etc/audio_policy_configuration.xml
Change-Id: If2afd9e83f8b023e6229496759dc525497af8d72
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-01 16:17:34 -08:00
Kevin Rocard
9efddc5596 Audio V4: Copy audio_policy_configure.xsd 2.0 to 4.0
That will make it easier to review the changes between 2.0 and 4.0.

Bug: 38184704
Test: none
Change-Id: Icb36a5b6e74ad89fb05dfe3ceee7b7f81801918d
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-01 16:17:34 -08:00
Kevin Rocard
14dbb1edce Audio V4: Forward tracks attributes to the hal
Forward to the HAL the audio usage, audio content types and volume
of playback tracks to the stream out they are playing to.

Forward to the HAL the audio source and volume of record tracks
to the stream in they are playing to.

This will allow the HAL to better tune its effects and remove the need
to inject a fake effect (volume listener) to get the tracks volume.

Bug: 38184704
Test: none
Change-Id: Iede0f7aa518608c3b3ce1497f059f672aac109b2
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-01 16:17:34 -08:00
Kevin Rocard
0fd5bc2dce Audio V4: Remove deprecated function and enum
The debugDump function was deprecated by the introduction of the
debug method in the IBase.

AudioMode CURRENT and INVALID should not be passed to the
vendor.

Bug: 38184704
Test: none
Change-Id: I0e14c71ce7216524587a6ba28cae0cdb821bae23
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-01 15:24:25 -08:00
Kevin Rocard
79c574082d Audio V4: bitfield enum now use the bitfield class
The audio HAL has lots of enums were each value is a specific bit
pattern (usually a single bit) and are expected to be used as a
combination of value (kind of like a bitfield).

Nevertheless the 2.0 methods only had the enums themselves in their
signatures which leads the HIDL API checkers to warn that invalid values
were passed.

Currently, there are no way to express a value which is a combination
of enum values. The closest thing is the bitfield type.

Thus transition all enums combination to bitfield.

Note that AudioDevice as NOT been transition systematically
as both the enums and the combination are meaningful:
 - the enum is one device
 - the combination is a list of device.

Test: none
Bug: 38184704
Change-Id: I155cf7bc5d88fc5cf8954903d55aa8d7ca458a4b
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-02-01 15:24:25 -08:00
Dean Wheatley
fd64afb0fd Audio V4: Add MSD formats and Device
Add MAT 1.0, 2.0, 2.1 audio formats
Add 5.1.2, 5.1.4, 7.1.2, 7.1.4 output channel masks
Add E_AC3_JOC audio format
Add MSD Device to allow an MSD HAL implementation separated from the
primary.

Bug: 38184704
Test: none
Change-Id: I2f488462614114e4c82149460b030585981ae15e
Original author:
Signed-off-by: Dean Wheatley <dwhea@dolby.com>
Ported to HAL 4.0:
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-31 23:09:23 -08:00
Kevin Rocard
8b010d2421 Audio V4: Add new Audio HAL API
Add new device to the device factory to allow vendors to split
their HAL implementations more.

AudioDevice bitfield is now 64bit to allow more devices to be added.

Add a new AudioDevice to support playing music to distant during voice
call.

A HAL can now declare if its MMAP buffer can be securely accessed
directly by untrusted apps.

Add AAC_XHE format.

Add BLE input source.

Bug: 38184704
Test: none
Change-Id: Ic2fbec4db71c7f688c8847ba39c72f51480c0727
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-31 23:09:23 -08:00
Kevin Rocard
71afcf1f87 Audio V4: Remove all non extensible enum value
The CNT, MAX enum values had two drawbacks:
 - they were invalid enum value that were part of the enum
   thus enum validity check would validate them although those values
   are only expected to be use in loops/validation code.
 - they are not extensible by vendors

The *_ALL enum values were not extensible by vendors.

Those values can instead be replaced by treble enum iterator and
helper functions.

Bug: 38184704
Test: none
Change-Id: I1a9527bb7311088e0abe22eceee92d21d9171ca4
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-31 23:09:23 -08:00
Kevin Rocard
260470f7b7 Audio V4: Fix doc comments for hidl-doc
hidl-doc does not support two consecutive documentation comments
/** ... */
/** ... */

In such case make the first one a non-doc comment.

This is a port of: http://android-review.googlesource.com/432140

Bug: 38184704
Test: none
Change-Id: I86cb10c655036ca49055ee007813c3e5af743eb5
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-31 23:09:23 -08:00
Kevin Rocard
74980b56eb Audio V4: Fix documentation and useable/untestable bugs
Add missing documentation, especially for failure cases
and methods that are optional.
Add missing operation status for testability.
Add format for getSupported* methods as they could not
be implemented in 2.0 for multi-format stream (HDMI).

Test: compile
Bug: 38184704
Change-Id: I14ee5e02ef70a82df6de732f88b065810e9b032f
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-31 23:09:23 -08:00
Kevin Rocard
a4e6d8b1de Audio V4: Copy 2.0 .hal files in 4.0
That will ease review of the changes.
The only changes are:
 - replace all @2.0 by 4.0
   $ sed -i 's/@2\.0/@4\.0/g' */4.0/*.hal
 - replace all licence 2016 by 2018
   $ sed -i 's/2016/2018/g' */4.0/*.hal

Moving the .hal in a subfolder forces the package name and the
namespace to change.

This mean that the audio HAL 2.0 and 4.0 will not be consider
different version of the same HAL but two different HALs.

As a result to minimize code change due to tight deadline,
keep the 4.0 core in the audio folder.

Bug: 38184704
Test: hardware/interfaces/update-makefiles.sh
Change-Id: I7c7a826270c9933091f037b795806787e1284583
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-31 10:39:47 -08:00
Zhuoyao Zhang
f62c91f057 Convert audio hal test to use VtsHalHidlTargetTestEnvBase
Bug: 64203181
Test: make vts
      vts-tradefed run vts -m VtsHalAudioV2_0Target

Change-Id: I1f85216c992eabf70f7e907b5d2afc4fb59cbb4a
2018-01-23 18:20:56 -08:00
TreeHugger Robot
c44621da83 Merge "soundtrigger: Fall back to V2.0 if V2.1 is not present" 2018-01-22 23:55:28 +00:00
Mikhail Naganov
ce8d65b5ef soundtrigger: Fall back to V2.0 if V2.1 is not present
A device may not be configured to ship with ST V2.1 impl,
in this case the device will stuck in a boot loop because the
framework will be attempting to instantiate ST, but the
service will not have ST server side registered.

Since the service code is the same for all devices,
allow a fallback to ST V2.0. This way, if only V2.0 is present
on the device, it will be registered, and the framework
will find it. The actual version used can be determined by
examining output of 'lshal' command.

Also remove obsolete dependency on broadcast radio.

Bug: 63600413
Bug: 68823037
Test: Try taimen both with ST V2.0 and V2.1 impls
Change-Id: I484659b1df5a7e4b11db91d0cf75a7079786c766
2018-01-22 13:31:36 -08:00
Kevin Rocard
740224e3e0 Audio V4: move 2.0/vts to core/2.0/vts to match effect's vts
Move in order to adhere to the new folder organisation.

Bug: 38184704
Test: compile
Change-Id: I7398cab951ee628782f81098b57b04a1402b4041
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
fd79d157e7 Audio V4: Fix issues in the core vts raised by clang-format
This patch only contains cosmetic reformatting imposed by clang-format.

Bug: 38184704
Test: compile
Change-Id: Ic2a2386b976cf1df1e4e062b45688cd6115541d3
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
3887e24436 Audio V4: Rename audio/device to audio/core
The name device has already too many meaning, thus rename the main audio
api to core.

Bug: 38184704
Test: compile
Change-Id: I178dfef05af8f8579196affbe2cbc5f6c3f9af55
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
62588b69f6 Audio V4: Make effect default wrapper device independent
What was done in this patch:
 # move headers in all-versions/default folder for qualified inclusion
mkdir -p audio/effect/all-versions/include/effect/all-versions/default/
mv audio/effect/all-versions/*[hp] $_
 # Go in the all-versions header folder
cd $_
 # Use a macro for the version
sed -i '/^#/!s/V2_0/AUDIO_HAL_VERSION/g' *
 #Remove 2.0 includes
sed -i "/include.*2.0/d" *
 # Add include guard to make sure AUDIO_HAL_VERSION is set
sed -i '/limitations under the License/!b;N;a\n#include <common/all-versions/IncludeGuard.h>' *
 # Remove guard include macro
sed -i '/^#.*[H_]$/d' *
 # Remove LOG_TAG
sed -i '/LOG_TAG/d' *
 # Remove local include (include "XXX")
sed -i '/include.*"/{N;/\n$/d;D}' *
 # Replace implementation with inclusion
cd audio/effect/2.0/
git checkout HEAD^^
ls *h *cpp| sed -r 's/.*h$/\0 \0/;s/(.*)cpp/\1impl.h \0/' |xargs -L1 printf '1h;2,$H;$!d;g;s$namespace.*}[^\\n]*$#define AUDIO_HAL_VERSION V2_0\\\n#include <effect/all-versions/default/%s>\\\n#undef AUDIO_HAL_VERSION$\000%s\000'|xargs -0 -n2 sed -i
+ manual update of Android.bp and removal of duplicate include

Bug: 38184704
Test: compile
Change-Id: If99871516f3069fcb9e699ab670a665d7d507e7d
2018-01-20 10:49:57 -08:00
Kevin Rocard
1bd2a336bc Audio V4: Move the legacy effect wrapper before refactor
This will make diff much more clear and allow git to follow the files.

Bug: 38184704
Test: compile
Change-Id: I90deaad883a52ef8fbcd3109937f90d46d458f8c
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
22505e6bf1 Audio V4: Fix issues in the effect legacy wrapper raised by clang-format
This patch only contains cosmetic reformatting imposed by clang-format.

Bug: 38184704
Test: compile
Change-Id: If5e61eecd0a67fec19997792c9db73936ce7be2e
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
e9e4e16564 Audio V4: Make device default wrapper device independent
Bug: 38184704
Test: compile
Change-Id: I077d2d6176ba5d60c1994345b3164641ed5b4608
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
994705966e Audio V4: Move the legacy wrapper before refactor
This will make diff much more clear and allow git to follow the files.

Bug: 38184704
Test: compile
Change-Id: I946b20254dcda1cb31b48898d0b5f46b185ebafe
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
82cb03632c Audio V4: Fix issues in the legacy wrapper raised by clang-format
This patch only contains cosmetic reformatting imposed by clang-format.

Bug: 38184704
Test: compile
Change-Id: I57545f2b8de1e982028ef4794328741d91682e0c
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
cb9827c072 Audio V4: Transition legacy wrapper to Android.bp
Bug: 38184704
Test: compile
Change-Id: I950b3c38e1ae8093414ce1054a8530047a81ccca
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
1ae0401179 Audio V4: Move common test code in common folder
The previous patch made the test independent of the HAL version
As a result, move them in the version common folder.

Note that this patch is separated from the previous patch to ease
review.

Bug: 38184704
Test: compile
Change-Id: I98a46eb0b88ea786656200ab613afd2d36ed222d
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
b34af7c192 Audio V4: Make test helper version independent
Bug: 38184704
Test: compile
Change-Id: Ia9ec81ccbad1d7411fdc570ae6dd728dd1520065
2018-01-20 10:49:57 -08:00
Kevin Rocard
6891d7ec28 Audio V4: Make common helper version independent
The implementation uses the version provided by macro.

Bug: 38184704
Test: compile
Change-Id: Ib5565bdf77ed9e42fc8271a4317eb88681aefcd5
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
649142becc Audio V4: Move common files before refactor
This will make diff much more clear and allow git to follow the files.

Bug: 38184704
Test: compile
Change-Id: I41ccb41c334aa56d3935be333e6227dd99773766
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Kevin Rocard
dc874e08c6 Audio V4: Fix issues in common raised by clang-format
This patch only contains cosmetic reformatting imposed by clang-format.

Bug: 38184704
Test: compile
Change-Id: I2f8c74d1b976e1e4e74f85dd0e8350f9b16fb31a
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-01-20 10:49:57 -08:00
Mikhail Naganov
5697a9b27a soundtrigger: Switch audio service to load soundtrigger 2.1
Bug: 68823037
Test: check /proc/.../maps of android.hardware.audio@2.0-service
Change-Id: Ie244ca4ea548bdad8116d0a9f267bb41a6a6d50d
2018-01-19 10:43:39 -08:00
Steven Moreland
43ca3b0a37 Merge "Update makefiles for audio." am: e5b3e4b869 am: b87db68677
am: 55113b8256

Change-Id: I7c99c9450f8ac12fcd08cded9da31b1c89a6b474
2018-01-18 01:21:44 +00:00
Steven Moreland
55113b8256 Merge "Update makefiles for audio." am: e5b3e4b869
am: b87db68677

Change-Id: I30ba693f50ce05e4fe083e24be17bb5f8a3f13dd
2018-01-18 01:12:41 +00:00
Steven Moreland
11f290b1ba Update makefiles for audio.
This dependency is imported but not used, so it should technically
go in the Android.bp file.

Bug: 71863483
Test: none
Change-Id: I3ee391bdea47182689156b3243b75a3572f7d8bf
2018-01-17 11:25:24 -08:00
Mikhail Naganov
c098c15065 audio: Fix StreamOut ownership in default wrapper am: 718b510080 am: 890deeed1e
am: 9a58cc7b4c

Change-Id: Id350abe5d8d7b88334cbe11b56a4a37864c8f397
2017-12-22 00:11:12 +00:00
Mikhail Naganov
9a58cc7b4c audio: Fix StreamOut ownership in default wrapper am: 718b510080
am: 890deeed1e

Change-Id: I8a45ce49f6f0695a2be2f74e4a103efd6ce3483a
2017-12-22 00:03:36 +00:00
Mikhail Naganov
718b510080 audio: Fix StreamOut ownership in default wrapper
StreamOut::asyncCallback could became an owner of StreamOut
causing the destructor to be called on the offload callback
thread, while the legacy HAL is holding a mutex, which resulted
in a deadlock.

Removed erroneous usage of sp<StreamOut> in asyncCallback.
The legacy HAL joins the offload callback thread when closing
output stream, thus StreamOut destructor is guaranteed to finish
only after the offload callback thread has exited, and using
a raw pointer to StreamOut inside asyncCallback is correct.

Bug: 70863217
Change-Id: I0d77018cf3df5ad07251732733288d425dd836eb
Test: manual
2017-12-21 13:21:58 -08:00
Kevin Rocard
30944c7a73 Merge changes from topic "b/69811500" into oc-dev am: 61ae0a1fc7 am: d7d5d7a22d am: abec925f05
am: d7042bba2b

Change-Id: I7265aa584b13ddc16e690b94f1976f6aaf5b91fa
2017-12-07 05:54:12 +00:00
Kevin Rocard
27dfaa0941 Audio policy config: remove cross-module device port name uniqueness am: 503c3e0a4e am: c5ce355c24 am: e8e9cdcf5e
am: a0e6bbe78b

Change-Id: I7291fcf545bea544cafb81c47339de78ae9518db
2017-12-07 05:53:16 +00:00
Kevin Rocard
c66afe5dad Audio policy config: Device port (type,address) must be unique am: fa1f597442 am: d4112727b7 am: 7c7fc0c69a
am: ead5a3bed3

Change-Id: Ia7edf22a48118eb062f83ba355b948a8e5c4ab5b
2017-12-07 05:53:05 +00:00
Kevin Rocard
db6cdc5282 Audio policy config: allow vendor to extend module name am: 7558e8c6e4 am: ec55b2f024 am: 540748bc80
am: c8ef2e0e44

Change-Id: Iaceb3864f283f22e85c5f4332256b43ed709f82f
2017-12-07 05:52:55 +00:00
Kevin Rocard
d7042bba2b Merge changes from topic "b/69811500" into oc-dev am: 61ae0a1fc7 am: d7d5d7a22d
am: abec925f05

Change-Id: If1f7ce2a3bf45bfa5b147fe8f21eac21b5516f0b
2017-12-06 20:33:38 +00:00
Kevin Rocard
abec925f05 Merge changes from topic "b/69811500" into oc-dev am: 61ae0a1fc7
am: d7d5d7a22d

Change-Id: Id4c64ec8339a7a4112b482a3cef33095c3dabc79
2017-12-06 20:31:08 +00:00
Kevin Rocard
d7d5d7a22d Merge changes from topic "b/69811500" into oc-dev
am: 61ae0a1fc7

Change-Id: I8d3e90d9695330b87f8e93dff84b752ec18e5254
2017-12-06 20:28:07 +00:00
TreeHugger Robot
61ae0a1fc7 Merge changes from topic "b/69811500" into oc-dev
* changes:
  Audio HAL: Allow setters to not be implemented
  Audio VTS: HAL can support more than the native sampling rates
2017-12-06 20:18:12 +00:00
Kevin Rocard
a0e6bbe78b Audio policy config: remove cross-module device port name uniqueness am: 503c3e0a4e am: c5ce355c24
am: e8e9cdcf5e

Change-Id: Ieec5791e1864d87ea26a1743f4543d0ff07c2825
2017-12-06 19:51:18 +00:00
Kevin Rocard
ead5a3bed3 Audio policy config: Device port (type,address) must be unique am: fa1f597442 am: d4112727b7
am: 7c7fc0c69a

Change-Id: I669ff1e8e32b7e539d33d8f1a05ee06962836e60
2017-12-06 19:51:05 +00:00
Kevin Rocard
c8ef2e0e44 Audio policy config: allow vendor to extend module name am: 7558e8c6e4 am: ec55b2f024
am: 540748bc80

Change-Id: I7f0627e930fc7a8fe13ac13f708d0972c5747b23
2017-12-06 19:50:51 +00:00
Kevin Rocard
e8e9cdcf5e Audio policy config: remove cross-module device port name uniqueness am: 503c3e0a4e
am: c5ce355c24

Change-Id: I1e9225d0acd5515890fec9bc259b39f26b3c8e5e
2017-12-06 19:36:16 +00:00
Kevin Rocard
7c7fc0c69a Audio policy config: Device port (type,address) must be unique am: fa1f597442
am: d4112727b7

Change-Id: I4d24d58034d3a39fee66308b44620c956ad5c345
2017-12-06 19:36:08 +00:00
Kevin Rocard
540748bc80 Audio policy config: allow vendor to extend module name am: 7558e8c6e4
am: ec55b2f024

Change-Id: Ic7c5de5e7c215c43f2ea044a38bbf52ee71984ca
2017-12-06 19:36:03 +00:00
Kevin Rocard
c5ce355c24 Audio policy config: remove cross-module device port name uniqueness
am: 503c3e0a4e

Change-Id: Ibeef7dd1ad8db4a55b9e323c07d3a499289f7d73
2017-12-06 19:30:49 +00:00
Kevin Rocard
d4112727b7 Audio policy config: Device port (type,address) must be unique
am: fa1f597442

Change-Id: I03176086075fb2c2911edf3a470b0319cb8648b6
2017-12-06 19:30:44 +00:00
Kevin Rocard
ec55b2f024 Audio policy config: allow vendor to extend module name
am: 7558e8c6e4

Change-Id: I2acafb47c986e5886b0bacc0bb6c6419feae69e5
2017-12-06 19:30:34 +00:00
Kevin Rocard
3bcba14c36 Audio HAL: Allow setters to not be implemented
setSampleRate, setChannelMask, setFormat
may not be implemented by the HAL, although this is not documented in
the HAL API.
Currently the VTS test requires their implementation if the respective
getSupported{SampleRate,ChannelMask,Format} are supported.

Relax this requirement as the framework never calls those setters.

Note that the optionality of those functions will be documented
in the next HAL API version.

Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target -t CheckConfig.audioPolicyConfigurationValidation
Bug: 69811500
Change-Id: I3a390ae925cabd99e7f1ed4a627e71ad87b1b437
Signed-off-by: Kevin Rocard <krocard@google.com>
2017-12-05 15:42:10 -08:00
Kevin Rocard
02025847de Audio VTS: HAL can support more than the native sampling rates
getSupportedSampleRate should return the native sampling rates,
(IE. the sampling rates that can be played without resampling)
but other sampling rates can be supported by the HAL.

The test was too strict as it was failing if HALs were supporting more
sample rates than there native (optimized) ones.

For example, a HAL might have its best performance (no resampling)
on 48kHz but still support 16kHz through resampling.

Note: getSupportedSampleRate might be renamed to getNativeSampleRate in
the next major HAL revision to avoid ambiguity.

Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target -t CheckConfig.audioPolicyConfigurationValidation
Bug: 69811500
Change-Id: I1ec1ce422bc5039637463c6641060508f4ee892b
Signed-off-by: Kevin Rocard <krocard@google.com>
2017-12-05 15:14:17 -08:00
Kevin Rocard
503c3e0a4e Audio policy config: remove cross-module device port name uniqueness
This constraint was added due to an incorrect assumption
that device ports were identified by names whereas
they are by the (module,type,address) triplet.

Bug: 69442986
Test: xmllint validates an XML with two identically named devices in
      different modules.
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target -t CheckConfig.audioPolicyConfigurationValidation
Change-Id: I66d890d3c967bead4f2a287202c259009217996a
Signed-off-by: Kevin Rocard <krocard@google.com>
2017-12-04 14:29:19 -08:00
Kevin Rocard
fa1f597442 Audio policy config: Device port (type,address) must be unique
Device port are not identified by names but by their type and address
and the module they are in.

As a result, enforce this constraint in the XSD. Violating it results in
a policy parsing crash.

Bug: 69442986
Test: xmllint invalidates an XML with two devices of the same type
      and address
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target -t CheckConfig.audioPolicyConfigurationValidation
Change-Id: I84245f0fa80fef786a002c98073c166b6aaf2be4
Signed-off-by: Kevin Rocard <krocard@google.com>
2017-12-04 14:29:14 -08:00
Kevin Rocard
7558e8c6e4 Audio policy config: allow vendor to extend module name
Vendor are currently not allowed to extend the XML format.
As some enumeration are allowed to be extended, this mean that
the format must allow some extension mechanism.

This patch relaxes the definition of the module name field.
AOSP names are still allowed, but a vendor can add its own name
if prefixed with "vx_". Eg:
    <module name="vx_google_vr" halVersion="3.0">

Test: xmllint --xinclude --noout --schema hardware/interfaces/audio/2.0/config/audio_policy_configuration.xsd audio_policy_configuration.xml
      with audio_policy_configuration.xml containing a module named vx_google_vr
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target -t CheckConfig.audioPolicyConfigurationValidation
      on Pixel 2
Bug: 69442986
Signed-off-by: Kevin Rocard <krocard@google.com>

Change-Id: I4ead38535cce89bb8fe44cf23fa1146acd1271d6
2017-12-04 14:29:08 -08:00
Kevin Rocard
b5433136dd Add the audio team as owner of the audio VTS
am: c691e18332

Change-Id: I3fa55d02549c1827737f8e0d85bae99226506f17
2017-11-29 22:23:57 +00:00
Daniel Van Veen
ab185f7250 Merge "Fix inequality typo in StreamIn::getCapturePosition" am: ba3225718b am: 3770968cf9
am: d0161b948a

Change-Id: Idd1d697f45057872d1a88ed42487cc1e1859d229
2017-11-29 21:15:02 +00:00
Daniel Van Veen
3770968cf9 Merge "Fix inequality typo in StreamIn::getCapturePosition"
am: ba3225718b

Change-Id: I9ec534a8ec45525021180fa9219a1e3d4f34d0a7
2017-11-29 20:46:08 +00:00
Kevin Rocard
c691e18332 Add the audio team as owner of the audio VTS
Change-Id: I7744929814e3e7ba99f1cb664153cdffac58f01e
Merged-In: I514c37b3c9da3df700fa208e79ff6597f8914092
Signed-off-by: Kevin Rocard <krocard@google.com>
2017-11-29 12:41:25 -08:00
Mikhail Naganov
8c0c030ee9 Add OWNERS for audio-related HAL default implementations
Test: not needed
Change-Id: I2893c84ac2ac72095baac810947fac56235a9d79
Merged-In: Idefe7be10bde22866be82f87118b9b54e74c3f40
2017-11-29 12:39:55 -08:00
Treehugger Robot
ba3225718b Merge "Fix inequality typo in StreamIn::getCapturePosition" 2017-11-29 20:28:20 +00:00
Treehugger Robot
adf8208c52 Merge "Remove subdirs" 2017-11-29 17:53:33 +00:00
Daniel Van Veen
0c7d58b00a Fix inequality typo in StreamIn::getCapturePosition
This was preventing getCapturePosition() being called from
the default HIDL implementation.

Test: cts-tradefed run cts -m CtsMediaTestCases \
      -t android.media.cts.AudioRecordTest
Change-Id: I9c920108f68fb895a7f7a9d2ea27c291a91c1afb
2017-11-29 17:06:27 +00:00
Steven Moreland
7b9888217e Remove subdirs
Removing whenever I see these in code reviews.

Test: none
Merged-In: I4322f533a837d55618ec2ed2125e8966ace9d61d
Change-Id: I4322f533a837d55618ec2ed2125e8966ace9d61d
2017-11-28 17:19:46 -08:00
Steven Moreland
e5c6548346 Remove subdirs
Removing whenever I see these in code reviews.

Test: none
Merged-In: I4322f533a837d55618ec2ed2125e8966ace9d61d
Change-Id: I4322f533a837d55618ec2ed2125e8966ace9d61d
2017-11-28 14:23:43 -08:00
Steven Moreland
fcca4e23b7 Remove subdirs
Removing whenever I see these in code reviews.

Test: none
Merged-In: I4322f533a837d55618ec2ed2125e8966ace9d61d
Change-Id: I4322f533a837d55618ec2ed2125e8966ace9d61d
2017-11-28 14:22:43 -08:00
Chih-Hung Hsieh
dbd7e5f031 Merge "Use -Werror in hardware/interfaces/audio" am: 7a4422d2a5 am: ae9fb022a3
am: 5d8244ee3f

Change-Id: I0826ee82634360949a94b3ca51011fe52f9f8079
2017-11-28 19:18:04 +00:00
Chih-Hung Hsieh
ae9fb022a3 Merge "Use -Werror in hardware/interfaces/audio"
am: 7a4422d2a5

Change-Id: Ib0cf1e15856fd58f0f2ea726e3d5b94177ab33a1
2017-11-28 19:03:31 +00:00
Chih-Hung Hsieh
b38c1aebc1 Use -Werror in hardware/interfaces/audio
* Remove unused variables, lambda function parameters..

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I28e8eb1af434f62cab6f41285b9a400f7f57cd13
2017-11-28 17:11:33 +00:00
Xin Li
bb9e38fef9 Merge commit '1a06284b24f5eb7bb9c1fea0817da8898b3b1bff' from
oc-mr1-dev-plus-aosp into stage-aosp-master

Change-Id: I2a044eb8c9981d0a8198ffe2df55559afbd76341
Merged-In: I4fb9f18884f7ef21162015a0032c4431444f7025
2017-11-14 12:08:38 -08:00
Steven Moreland
8db261bc99 Updating makefiles for hidl_interface.
Bug: 64487114
Test: manual
Merged-In: Ie13d9e014cf2b81c18c67f551b4644fb9f0ba812
Change-Id: Ie13d9e014cf2b81c18c67f551b4644fb9f0ba812
2017-11-13 10:00:18 -08:00
Steven Moreland
a1169dd600 Update makefiles for hidl_interface.
Bug: 35570956
Test: manual
Change-Id: I7a220b78ee081240e1dc30ef5672ba39e3e98375
2017-11-10 09:06:55 -08:00
Steven Moreland
d28c1bdf62 Merge "Automatic mk -> bp." am: e5fd969f19 am: 72c720a4e3
am: 26013bf6ac

Change-Id: Id936fb4806d122045c771c951220361efeef10c6
2017-11-07 21:24:49 +00:00
Steven Moreland
26013bf6ac Merge "Automatic mk -> bp." am: e5fd969f19
am: 72c720a4e3

Change-Id: Icfc8b46117e94461906806023852836a0ace3a55
2017-11-07 21:21:40 +00:00
Steven Moreland
90e3a50f03 Automatic mk -> bp.
Automatic mk -> bp conversion for all modules here
which can be converted and built automatically.

Test: Soong resolves all dependencies
Bug: 37512442
Change-Id: Ib789212cb88d55731397c600d132e7c672c0d8be
2017-11-03 16:30:28 +00:00
TreeHugger Robot
2aa5fe9241 Merge "Audio VTS: improve audio policy validation error messages" 2017-10-28 07:11:23 +00:00
TreeHugger Robot
4c197ce183 Merge "Audio HIDL wrapper: Improve status_t to Return conversion for get_parameter" 2017-10-28 06:21:33 +00:00
TreeHugger Robot
7e156d1512 Merge "Add the audio team as owner of the audio VTS" 2017-10-24 02:31:10 +00:00
Kevin Rocard
f16fabef5d Add the audio team as owner of the audio VTS
Change-Id: I514c37b3c9da3df700fa208e79ff6597f8914092
Signed-off-by: Kevin Rocard <krocard@google.com>
2017-10-23 21:26:16 +00:00
Kevin Rocard
1a7432375b Audio HIDL wrapper: Improve status_t to Return conversion for get_parameter
set_parameter wrapper was converting status_t as such:
OK -> OK
-ENOSYS -> INVALID_STATE
everything else -> INVALID_ARGUMENTS

Which was inconsistent with the rest of the wrapper which was doing:
OK -> OK
-EINVAL -> INVALID_ARGUMENTS
-ENODATA -> INVALID_STATE
-ENODEV -> NOT_INITIALIZED
-ENOSYS -> NOT_SUPPORTED
everything else -> INVALID_STATE

Unfortunately, identical conversion can not be achieve as legacy
set_parameter specifically require
-ENOSYS -> INVALID_STATE
in `get_parameter` docstring:

     * If the implementation does not accept a parameter change while
     * the output is active but the parameter is acceptable otherwise, it must
     * return -ENOSYS.

As a result implement:
OK -> OK
-EINVAL -> INVALID_ARGUMENTS
-ENODATA -> INVALID_STATE
-ENODEV -> NOT_INITIALIZED
-ENOSYS -> INVALID_STATE              <--- unchanged
everything else -> INVALID_ARGUMENTS  <--- unchanged

Test: Playback and record over builtin & USB. Hangout call
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target
Bug: 67030461
Change-Id: I13649eb00f8465921e5c718c5d5df120e1262ff7
Signed-off-by: Kevin Rocard <krocard@google.com>
2017-10-20 05:13:28 +00:00
Tri Vo
71fae85bef Merge "Set pipe size to >1MB for debugDump test cases." am: d928053397 am: 04fcc83578 am: bd9b6d5c68
am: 976bfa63f8

Change-Id: I55a4c333ac6249d92f588e6c36c58590c01945ee
2017-10-18 03:30:27 +00:00
Tri Vo
976bfa63f8 Merge "Set pipe size to >1MB for debugDump test cases." am: d928053397 am: 04fcc83578
am: bd9b6d5c68

Change-Id: I0719153562f638d958f68f823bace7fb2dad3888
2017-10-18 02:56:55 +00:00
Tri Vo
bd9b6d5c68 Merge "Set pipe size to >1MB for debugDump test cases." am: d928053397
am: 04fcc83578

Change-Id: I268c1f1fd16732ffce1569a19d8efa47897fc329
2017-10-18 02:28:01 +00:00
Tri Vo
04fcc83578 Merge "Set pipe size to >1MB for debugDump test cases."
am: d928053397

Change-Id: If7cca83c1da491e5c399170e2669995e878fdc57
2017-10-18 02:21:29 +00:00
Tri Vo
7d35a3d0f2 Set pipe size to >1MB for debugDump test cases.
Test: VtsHalAudioV2_0Target
Change-Id: I2dd43851a43609ad2953030303edaeb684b63096
2017-10-17 16:51:33 -07:00
Tri Vo
1853d8b538 Merge "Use a pipe instead of tmp for debugDump tests." am: 458b8fa5bd am: c62e184a27 am: a56e32dca2
am: e9c924d756

Change-Id: Idfab4049352fa39ce52f712f95e1e98fa8fba5b7
2017-10-15 04:01:35 +00:00
Tri Vo
e9c924d756 Merge "Use a pipe instead of tmp for debugDump tests." am: 458b8fa5bd am: c62e184a27
am: a56e32dca2

Change-Id: I9f450d87bc7737e14ad4ed0bab9670c6765fd5e2
2017-10-15 03:44:38 +00:00
Tri Vo
a56e32dca2 Merge "Use a pipe instead of tmp for debugDump tests." am: 458b8fa5bd
am: c62e184a27

Change-Id: If0f38272ff7a4e7982ef9273ed09be7d70b9de16
2017-10-15 03:01:13 +00:00
Tri Vo
c62e184a27 Merge "Use a pipe instead of tmp for debugDump tests."
am: 458b8fa5bd

Change-Id: Ife2cfb8b89c0f550648ea28c339e7278015399c0
2017-10-15 02:56:25 +00:00
Tri Vo
6c00ac31bb Use a pipe instead of tmp for debugDump tests.
Audio hal does not have selinux permissions to files under
/data/locat/tmp. We pass an fd to a pipe to the HAL instead.

Bug: 67665722
Test: VtsHalAudioV2_0Target
Change-Id: I695917be1816ba007f48afab5e978ab31024ffba
2017-10-12 15:47:34 -07:00
Steven Moreland
1d7374c5e1 Update for Soong java makefiles. am: c3e80fa01e am: 0fff75dee1 am: 6c811964a1
am: 116161d94e

Change-Id: I33643636e2511de77fdf7de57777eb67edee2e52
2017-10-11 16:39:21 +00:00
Steven Moreland
116161d94e Update for Soong java makefiles. am: c3e80fa01e am: 0fff75dee1
am: 6c811964a1

Change-Id: I85ccbb4a15cd18938607f5bca4e065b9d7e0182b
2017-10-11 16:31:07 +00:00
Steven Moreland
6c811964a1 Update for Soong java makefiles. am: c3e80fa01e
am: 0fff75dee1

Change-Id: I5b524ccf13233f3696881a2a670b5d2134fd5f15
2017-10-11 16:27:24 +00:00