Commit graph

46 commits

Author SHA1 Message Date
Martijn Coenen
e5b2271717 Merge "hidl_memory no longer owns passed-in handles." 2017-01-25 13:52:33 +00:00
TreeHugger Robot
6b058752c5 Merge "Use MQDescriptor typedefs for cleanup" 2017-01-23 15:56:44 +00:00
Hridya Valsaraju
790db1074c Use MQDescriptor typedefs for cleanup
Test: mm
Bug: 33815422

Change-Id: I41ca833231622a5a72970014cfcac400b512e44a
2017-01-23 15:56:24 +00:00
Martijn Coenen
45d4d3025d hidl_memory no longer owns passed-in handles.
So clean them up when done.

Bug: 33812533
Test: mma
Change-Id: Ic2fdfa703547a210b9915288d5a77dc8e329a1c6
2017-01-23 13:00:19 +01:00
Eric Laurent
f247b8df08 audio: add support for stub HAL in HIDL mode
Fixed broken functionality for some devices relying on
a stub HAL module to be present (e.g Fugu).

Bug: 34360879
Test: make and check stub HAL is loaded in HIDL passthrough mode

Change-Id: Ibad050d63827c4e49604273efd76ac8074bb00d2
2017-01-18 17:08:57 -08:00
Mikhail Naganov
3881d9362f Merge "audiohal: Fix incompatibility with legacy hal for writes" 2017-01-12 20:55:00 +00:00
Mikhail Naganov
ee901e3fd8 audiohal: Fix incompatibility with legacy hal for writes
The combo call to stream_out->write + get_presentation_position
wasn't delivering the results of these calls entirely
correctly. Since the 'WriteResult' struct was lacking the field
for returning the status of the call to
'get_presentation_position', the client could erroneously update
the presentation position to bogus values if the call to the
legacy HAL had failed.

Updated IStreamOut.WriteStatus to include the missing field,
and updated the code to fill it out.

Also fixed logspam resulting from calling a stubbed
stream_in->get_capture_position.

Bug: 30222631
Test: Loopback RTT, media CTS
Change-Id: I38ac3b01beb095e176b54608e11e71ae5d5eafb6
2017-01-12 09:39:56 -08:00
Yifan Hong
a18049ad13 Bp/nFoo -> Bp/nHwFoo.
Test: mma
Bug: 33554989
Change-Id: I4b3f852d20fdfc49f2da671dd3c12d618ffb4140
2017-01-11 13:14:59 -08:00
Mikhail Naganov
b29438ef70 audiohal: Re-implement stream read and write using FMQ
Result: no hwbinder calls due read / write session.

Added IStream.close method for explicitly freeing up of resources
consumed by the stream before automatic server objects reaping
gets to it.

Test: make, perform Loopback RTT, check traces
Bug: 30222631
Change-Id: I678559f6ef30026685df787cd2ba7c2ee449ed27
2017-01-05 09:04:14 -08:00
Martijn Coenen
028223775b Remove obsolete references to IPCThreadState/ProcessState.
Threadpool can now be configured/joined if needed with
configureRpcThreadpool() / joinRpcThreadpool().

Bug: 31226656
Test: mma
Change-Id: I0d7d9924cc8c8851cc2b61ebdae906204909890e
2016-12-30 14:00:31 +01:00
Eric Laurent
f6b8df28cf Merge changes I64f56526,I65c5c7ba
* changes:
  audio treble HAL: implement methods and structures for stream in MMAP mode
  audio: add methods and structures for streamin MMAP mode
2016-12-21 16:30:31 +00:00
Eric Laurent
7deb7dad39 audio treble HAL: implement methods and structures for stream in MMAP mode
Bug: 33398120
Test: make marlin-eng with ENABLE_TREBLE true
Change-Id: I64f56526c7c775b03191439188545171b565ef31
2016-12-20 16:18:34 -08:00
Eric Laurent
ed9fa0ed01 audio: add methods and structures for streamin MMAP mode
Bug: 33398120
Test: make marlin-eng with ENABLE_TREBLE true
Change-Id: I65c5c7ba0a94ba47dca78ace38ef3ae75ea7e3bf
2016-12-20 12:43:18 -08:00
Mikhail Naganov
685f0e36a1 Fix offload tracks playback
Translation between audio_offload_info_t and AudioOffloadInfo
was missing a field. This was causing compressed tracks to play
using 'deep_buffer' mode instead of 'offload'.

Changing output stream async callback methods to 'oneway',
since they don't require anything from the callee.

Change-Id: I27fe7fb715e421f102db21a10d34e1dc3134cf01
Test: play MP3 file with Play Music, check audioflinger dump
2016-12-16 17:18:08 -08:00
Yifan Hong
f35ee3b192 Revert "Revert "Update makefiles for Java package path.""
This reverts commit a8789f27cb.

Change-Id: I69980b580a556188ba868bb096ae1590b01759f5
2016-12-13 22:20:16 +00:00
Yifan Hong
a8789f27cb Revert "Update makefiles for Java package path."
This reverts commit ab0792ccdc.

Change-Id: I47fc272d9fa8875e3d7ccb10cb748c738fbf8135
2016-12-13 22:18:34 +00:00
Yifan Hong
ab0792ccdc Update makefiles for Java package path.
use V1_0 instead of 1.0.

Bug: 33554192

Test: hidl_test_java
Change-Id: Ic2d95265df10914a60a5bb743d75e839948838c3
2016-12-13 11:32:56 -08:00
TreeHugger Robot
9f8a790d82 Merge "Update for colliding names in arguments and results." 2016-12-10 03:28:05 +00:00
Yifan Hong
acb010882d Update for colliding names in arguments and results.
Test: compiles

Bug: 33277700
Change-Id: I0c1a62fdea3617a06120f548105f778e011cb576
2016-12-09 14:26:58 -08:00
Mikhail Naganov
0771ac17b9 Make audiohal service 'oneshot' to avoid double restart on crash
audioserver receives a change that makes it to crash once it
detects that audiohal server has crashed (because audioflinger
can't gracefully restore the state of the audio system).

As audioserver.rc file prescribes restaring the audiohal on
audioserver restart, there is no need to rely on the init process
to restart the audiohal. Moreover, asking the init process to do
that causes a double restart of the audiohal service if it crashes.

Test: kill audio-hal process, watch dmesg and logcat
Change-Id: Iac4cc79cdc1a3debd2b9cfcdf42f11451d7ce24c
2016-12-09 18:53:22 +00:00
Mikhail Naganov
13f43f4afe audiohal: Do not log if EINVAL is received from get_presentation_position
This happens often, and it's normal. Avoid logging it down as this
causes logspam.

Bug: 33353073
Change-Id: Ia3b1b8af61bdf83e9bcde0e5bed0285af037df45
Test: cause the system to play some sounds (e.g. UI clicks), watch logcat
2016-12-07 17:08:04 -08:00
Yifan Hong
501839495f Update makefiles for hidlizing IBase.
A new dependency android.hidl.base@1.0 is added for
all projects.

Test: mma

Change-Id: Ia70d0eb0d74de06475a339698386d383d491a43a
2016-12-03 01:01:14 -08:00
Yifan Hong
7bdce32513 Merge "Update to use the correct logging library." 2016-12-02 18:42:01 +00:00
Yifan Hong
f9d303435d Update to use the correct logging library.
Test: mma compiles
Change-Id: Idb33dea5faaf1a5e54719c2a5a683d2d47e9b8e8
2016-12-01 17:47:02 -08:00
Mikhail Naganov
a9a58c150d Merge "Audio HAL: fixes for issues discovered after client conversion" 2016-12-02 00:06:16 +00:00
Mikhail Naganov
6e81e9bb3c Audio HAL: fixes for issues discovered after client conversion
Several issues addressed:

  -- added IDevice.supportsAudioPatches to query whether
     create/removeAudioPatch is actually supported by HAL;

  -- IStreamOutCallback proxy needs to be owned by IStreamOut
     implementation. In order for the client to reset the reference,
     added method IStreamOut.clearCallback;

  -- IDevice.open{Input|Output}Stream need to return a "suggested" audio
     config from HAL;

  -- code for converting between system/audio.h and HIDL
     data structures has been moved to
     android.hardware.audio.common@2.0-util library for reuse;

  -- added a workaround for the issue with QC effects HAL trying to write
     into the input parameters buffer, which is r/o by Binder design.

Bug: 30222631
Change-Id: I64af24d79c12d6ac3b0f87d085a821913e29237b
Test: tried using with WIP HIDL client on N5X
2016-12-01 13:48:58 -08:00
TreeHugger Robot
32094ca29f Merge changes I0b1a0979,I4aa89a39
* changes:
  Added AOSP license headers.
  Remove HIDL_GENERATED from things written by hand.
2016-11-30 18:15:48 +00:00
Steven Moreland
d6e4f03acf Remove HIDL_GENERATED from things written by hand.
find . -name "*.h" -exec sed -i 's/HIDL_GENERATED_\(.*\)_H_/\U\1_H/g' {}
+

They now match what would be generated by -Lc++-impl. This prevents
confusion over whether or not the files are autogenerated.

Change-Id: I4aa89a39907024aa9525df71ff3715979f431357
Similar commit: https://android-review.googlesource.com/#/c/305996/
Test: pass
2016-11-29 15:05:31 -08:00
Steven Moreland
d26dc50abb Always specify underlying enum type.
Bug: 33197891
Test: compiles
Change-Id: I3d4822ea9a665708302d3bd1460425fddf1dcda9
2016-11-29 14:22:10 -08:00
Steven Moreland
bbff14d4bb Merge "Update makefiles for logging." 2016-11-22 17:25:36 +00:00
Martijn Coenen
70b9a15df0 Use newly introduced hidl_handle.
Bug: 32089785
Test: builds
Change-Id: I27c7d3945e1fe390661bf322987011a00fe9b3fe
2016-11-22 09:03:11 +01:00
Steven Moreland
f8d68ec855 Update makefiles for logging.
Bug: 32943424
Test: pass
Change-Id: Ic88ce6adf04e0e36db53e4cc06ac2ec5a90c011c
2016-11-21 16:28:54 -08:00
Eric Laurent
a174588f8d Revert "Revert "Initial implementation of broadcast radio HAL.""
This reverts commit 2c2df013b2.
2016-11-21 10:41:22 -08:00
Eric Laurent
d82c3be1a5 Merge "Revert "Initial implementation of broadcast radio HAL."" 2016-11-19 04:27:42 +00:00
Eric Laurent
2c2df013b2 Revert "Initial implementation of broadcast radio HAL."
This reverts commit a33b3419a3.

Change-Id: I8e1c0f3891f02febe148e837b48b80e645a24ce2
2016-11-19 04:11:15 +00:00
TreeHugger Robot
4433847341 Merge "Initial implementation of broadcast radio HAL." 2016-11-19 02:26:07 +00:00
Eric Laurent
a33b3419a3 Initial implementation of broadcast radio HAL.
Test: make
Test: manual test with RadioTest app.

Bug: 31973526
Change-Id: I66199b95999aa92718bb325f8a4ec84a38e2dd69
2016-11-18 16:26:01 -08:00
Yifan Hong
6b920e43d3 Split libhidl into base and transport.
Bug: 32756130

Test: mma
Change-Id: Id21cf23abe2910f26bb7895511862443b93dc112
2016-11-18 00:00:54 -08:00
Mikhail Naganov
1054829502 Implement audio devices and streams HAL delegating to legacy HAL
Changes made to the .hal definition:

  - introduce Effect ID returned by the IEffectsFactory that
    needs to be passed to IStream.{add|remove}Effect; otherwise
    it's impossible to retrieve the underlying HAL effect handle;

  - change "bus address" in DeviceAddress to "string" type;

  - fix signature of some methods w.r.t. returning Result;

  - remove unused "struct AudioPatch".

Bug: 30222631
Test: make
Change-Id: Icb51729ef57bb2a5b0b78609735e7481bc04f95c
2016-11-15 08:52:39 -08:00
Yifan Hong
c2f2779d9d Update Android.bp to reexport dependent packages.
Test: mma
Change-Id: Iaca7300c366c2c9e860a29e6a111248d315cc5b4
2016-11-09 10:28:38 -08:00
Colin Cross
b785f5b82e Support genrules with multiple tools
To allow genrules with more than one tool, rename the tool property to
tools and make it an array, replace $tool with $(location <label>),
and use $() for other variables for consistency.

Bug: 31948427
Test: compare build.ninja
Change-Id: I3d714f70a2af0dc60faeee10e09b6ed166601f1d
2016-11-04 22:49:15 -07:00
Colin Cross
0dc44bd1d4 Remove unecessary include that no longer exists
I11496e4c3dd6d0d43f635886b46609cb8e430efc removed
hidl/IServiceManager.h, remove it from service.cpp.

Test: m -j android.hardware.audio@2.0-service
Change-Id: I9e45345b345acb1cc15343c889361c2775933cc3
2016-11-02 23:28:29 -07:00
Steven Moreland
fcd74ebcdc Running update makefiles.
https://android-review.googlesource.com/#/c/298160/

Test: pass
Change-Id: I14fcde2d3aacc8f8cd9221f2d69e2feae9ae1226
2016-11-02 10:24:33 -07:00
Steven Moreland
69727778a7 Stop all these merge conflicts.
Test: mma -j64
Change-Id: I319198af32adf1fef180c5c2c22ba4b360fa7609
2016-10-26 12:04:37 +02:00
Eric Laurent
27ef4d872d audio: add audio HAL service and sound trigger HAL implementation
Audio HAL service is common to audio, audio effect, sound trigger and
bradcast radio HALs.

Bug: 32022304
Change-Id: I3952b9c6de3a6b34e757942120320cf8ae036ed5
2016-10-19 16:11:32 -07:00
Mikhail Naganov
96b30be9d0 Define audio HAL
Created after hardware/audio.h with the following changes:

 - names changed to satisfy HAL style guide;

 - defined getter / setter methods for properties, and interfaces
   for devices where needed;

 - stream out callback changed to be used over RPC;

 - 'dump' method is already defined by BBinder, so in HAL
   interfaces it is replaced by 'debugDump'.

Note that audio data is currently transferred using byte buffer,
which is not effective due to memory copy and HwBinder transaction
involved. The transfer method will be changed to FastMessageQueue.

Bug: 30222631
Test: make

Change-Id: Ibb3bd940a91820e81d1a2b53b38d63b9e3de148a
2016-10-12 17:01:32 -07:00