OSDN Git Service

audiohal: Make sure audio data transfer related commands go via FMQ
authorMikhail Naganov <mnaganov@google.com>
Tue, 31 Jan 2017 21:56:02 +0000 (13:56 -0800)
committerMikhail Naganov <mnaganov@google.com>
Fri, 3 Feb 2017 18:25:32 +0000 (10:25 -0800)
commita468fa84d13b085b1808f20f70d22ed9dbe3f3eb
tree66313f0202474ee666eeb3b58024979092450eec
parentbbd6adda5af693692c889b47ef1394a578c5baea
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
audio/2.0/IStreamIn.hal
audio/2.0/IStreamOut.hal
audio/2.0/default/StreamIn.cpp
audio/2.0/default/StreamIn.h
audio/2.0/default/StreamOut.cpp
audio/2.0/default/StreamOut.h