External device ports might not have dynamic profiles, for example,
ports for BT devices. Properly handle this case in the default
implementation.
Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Test: atest audiosystem_tests
Change-Id: I8d4bcbf6ccf2ba05436e68e3ba94567fc7610eb7
In the case when there is a problem with the legacy APM XML file,
the converter provides a default surround sound config. However,
the default implementation of IConfig::getSurroundSoundConfig did
not take an advantage of that, and was returning an empty config,
which is not accepted by VTS.
Also, improve logging messages: clarify the situation when no readable
audio policy XML file found, and use outer functions name for lambdas.
Bug: 293978054
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Iae069a0498009605ef5ededb9c9112efab08548a
otherwise a negative offset will result in long sleep
Bug: 295055755
Test: atest android.media.audio.cts.AudioPlaybackCaptureTest
Change-Id: Ie941cc2525e3ea42b53106ae3a65242794b1dd1b
With the current definition, it's an alias of default constructor. This
has very different meaning from std::string empty, especially that
static method String8::empty can still be called from instance context.
One of such bugs are present in in ParametersUtil.
Bug: 295394788
Test: make checkbuild
Change-Id: I9116a0c42a6a9e94116eaaaa0fd60568db428838
- remove the default address "0" for IN_SUBMIX and OUT_SUBMIX;
- remove the profiles in the device port and assign profiles when
connecting;
- make remote submix input to use "virtual" connection type,
same as the output;
- fix ModuleConfig in VTS to avoid returning devices with virtual
connections as "external devices" because they can actually
be connected even when connection simulation is disabled;
- fix TryConnectMissingDevice VTS test to disconnect the device
if the operation has unexpectedly succeeded.
Bug: 286914845
Bug: 294976817
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ife11c9c356d1b5dc587d08cef47294e3b29f65c5
Change audio worker threads priority to ..._URGENT_AUDIO to match
the coupled thread in the audio flinger.
Set SCHED_FIFO scheduler for FAST threads (also to match AF fast
mixer/capture threads). In order to enable that, grand SYS_NICE
capability to the HAL service process and provide "getTid"
function in the StreamWorker class. For testing, add a "FAST"
output to the "stub" module in the HAL configuration.
Bug: 286914845
Test: atest libaudioaidlcommon_test
Test: atest VtsHalAudioCoreTargetTest
Test: adb shell ps -A -T -o PID,TID,NI,PCY,PRI,RTPRIO,SCHED,CMD
for the HAL service process during VTS test. For regular
"reader"/"writer" threads should see 'NI 19, PRI 38',
for FAST "writer" should see 'NI -19, PRI 43, RTPRIO 3, SCH 1'
Change-Id: Iab7e21ebc139ff11cf9b7f4a1645960db8dadd43
Core HAL changes:
1. Add StreamPrimary implemented via StreamAlsa.
2. Align the configuration with the HIDL HAL.
3. Fix position retrieval vs. standby call.
4. Fix sleeps in StreamAlsa.
VTS changes:
1. Use several bursts for stream I/O test scenarios that check
observable position increase. This is because the position may
not be available until a couple of transfers have been made.
2. Do not require position increase for the scenarios that do
not make several bursts. As specified above, the position may
not have been increased for the ALSA case. Whereas, using
multiple bursts in all scenarios will increase test time, and
make the state machine transitions graph more complicated.
3. Hook up the test config file to shut down audioserver during
VTS tests, fix the test config file.
Bug: 286914845
Test: atest VtsHalAudioCoreTargetTest
Test: compare APM dumps for AIDL vs. HIDL
Change-Id: I85271564c664fa40008d60e82b32eaa66a99c68f
Rename DriverInterface::getPosition -> refinePosition. This reflects
the fact that the driver may provide more precise position, however
this is an optional operation.
Rename StreamIn/Out::mContext -> mContextInstance. This is
to emphasize that StreamIn/Out actually own the context and they
hold the real context instance, not just a reference/pointer
to it, like other classes involved in the inheritance chain.
Bug: 286914845
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Id7159f9bf3ee020dc7cf594ec35f5d59d23d7e31
Use stream switcher to obtain device address for creation
of a remote submix stream.
Bug: 286914845
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I8dde3d59e488c9621dce78ffd5249254ecfc0b1a
Since in the C and HIDL APIs the method for opening a stream
receives the device to connect to, some legacy HAL implementations
took an advantage of that. In AIDL APIs device port connection
process is more dynamic and independent of the stream creation.
To simplify porting of legacy implementations to AIDL, a helper
class StreamSwitcher is added. It emulates the legacy behavior
by allowing to postpone the stream implementation creation until
the connected device is known. Until that moment, it exposes
to the client a stub implementation of the stream interface.
Bug: 264712385
Bug: 286914845
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ie8ae0338fd22f705e00a34e56a7fa235eda5ed9e
Moving frame counter to the StreamContext class enables
switching stream drivers on the fly while keeping the frame
count monotonically increasing.
StreamWorkerCommonLogic now holds a pointer to StreamContext,
which makes redundant storing copies of the fields of the latter.
Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: If6716f4051c484b52927cbfe4032df7c907eb3a5
Since the client may end up never retrieving the interface
instance for sending it over Binder, postpone setting
of the scheduler policy to until that very moment.
Rename 'ChildInterface::getPtr' to 'getInstance' for clarity.
Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I31f9dd832c7f85f9632d1d389a8b1063d237d4c1
* changes:
audio: Move StreamContext ownership out from StreamCommonImpl
audio: Use ChildInterface in StreamCommonImpl
audio: Update StreamAlsa and alsa utils for built-in devices
audio: Simplify and extend alsa::Mixer
Upcoming implementations of the streams of the primary module
will need to change the underlying stream type depending on
the current connected device. The stream context must persist,
thus its life time must be bound to the IStreamIn/Out implementation.
Move the StreamContext instance under ownership of StreamIn/Out.
Add StreamCommonImpl::onClose so that the owner of the context
may know when it is safe to reset it.
Re-arrange the order of the arguments when creating a stream
so that the context always comes first.
Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Iaf13d4bc3a53cbfc27264d3abd1f6c417ece3941
Replace the pair of 'shared_ptr<>, Binder' with
the equivalent ChildInterface.
Fix logging of returned sub-objects to print their
Binder value instead of the local pointer.
Bug: 264712385
Test: m
Change-Id: I1350e7b3720c6244cd8527e1d021ee9577399291
Use new functions added to alsa proxy layer for opening
attached (built-in) devices.
Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ia2a47ff96fa62f99ce4ec4a0993ca3fd86f82c9d
Remove alsa::MixerControl. tinyALSA contains utility
functions for setting values in percents, they use
the same logic as used to be there for handling
the "volume" control. Use access serialization at
the mixer level, rather than for each control.
Move the call to 'mixer_open' to alsa::Mixer.
Add controls for capture (mic) mute and gain. They
will be used by the primary HAL.
Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I0fad994153de96aceec3eb8f2fec19805ec912f8
In UML, the initial state is a solid circle, the final
state is a double circle. In the Core HAL diagrams it
was the opposite.
Test: dot -Tpng stream-{in|out}-[async-]sm.gv -o ...
Change-Id: Id69f17d0a47227e744eb6dadcb5fee08c07bb0bd