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
diff --git a/audio/2.0/IStreamIn.hal b/audio/2.0/IStreamIn.hal
index e34c95f..6f1f9df 100644
--- a/audio/2.0/IStreamIn.hal
+++ b/audio/2.0/IStreamIn.hal
@@ -91,7 +91,11 @@
* to the client;
* -- status queue is used for reporting operation status
* (e.g. amount of bytes actually read or error code).
- * The driver operates on a dedicated thread.
+ *
+ * The driver operates on a dedicated thread. The client must ensure that
+ * the thread is given an appropriate priority and assigned to correct
+ * scheduler and cgroup. For this purpose, the method returns identifiers
+ * of the driver thread.
*
* @param frameSize the size of a single frame, in bytes.
* @param framesCount the number of frames in a buffer.
@@ -105,15 +109,15 @@
* specified at the stream opening.
* @return statusMQ a message queue used for passing status from the driver
* using ReadStatus structures.
+ * @return threadInfo identifiers of the driver's dedicated thread.
*/
- prepareForReading(
- uint32_t frameSize, uint32_t framesCount,
- ThreadPriority threadPriority)
+ prepareForReading(uint32_t frameSize, uint32_t framesCount)
generates (
Result retval,
fmq_sync<ReadParameters> commandMQ,
fmq_sync<uint8_t> dataMQ,
- fmq_sync<ReadStatus> statusMQ);
+ fmq_sync<ReadStatus> statusMQ,
+ ThreadInfo threadInfo);
/*
* Return the amount of input frames lost in the audio driver since the last