Commit graph

6 commits

Author SHA1 Message Date
Andreas Huber
40d3a9bd8c Convert all comments into "doxygen-ready" comments.
Bug: 36453077
Test: mma
Change-Id: I0b1f77dfae5d2258969e33d85ecf45401ffbdfaa
2017-03-29 08:53:58 -07:00
Mikhail Naganov
a1db22a3e5 audiohal: Pass thread identifiers to the client for priority adjustment
HALs are prohibited from using framework binder, and there is
no equivalent scheduling policy service in hwbinder. Thus, in order
to match priorities of FastCapture / Mixer threads with their
counterparts in the HAL, it is needed to request the priority boost
from audioflinger on behalf of the HAL.

Bug: 34131400
Change-Id: I7c8db9d520b4cf272d2896ad875752b109b57ab7
Test: check priority match between audioflinger's and hal's threads
2017-02-07 10:49:18 -08:00
Mikhail Naganov
a468fa84d1 audiohal: Make sure audio data transfer related commands go via FMQ
When outputting audio, the framework issues several HAL calls
from the same thread that writes into data FMQ. These calls
also need to be served on the same thread that writes audio data
to HAL. The same thing happens when audio input is commenced.

Add a command FMQ for passing different commands to the HAL thread.
This way, depending on the calling thread, the same call may go
either via hwbinder or via the command queue.

This dramatically reduces jitter in RTT measurements (although
doesn't improve the latency).

Bug: 30222631
Test: scripted RTT app
Change-Id: I04c826e2479d8210fd9c99756241156cda3143b6
2017-02-03 10:25:32 -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
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
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