Commit graph

24 commits

Author SHA1 Message Date
Kevin Rocard
92dcce0924 Audio V4: XSD device category was missing hearing aid
Bug: 77307068
Test: atest VtsHalAudioV4_0TargetTest
Change-Id: I9de9b826d01fe90c1a7d16631d0f808b29ad4775
Signed-off-by: Kevin Rocard <krocard@google.com>
2018-04-21 01:32:34 -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
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
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
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
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
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
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
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