mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 21:37:44 +00:00
audio: Implement transient state testing
Add ModuleDebug.streamTransientStateDelayMs parameter to ensure that streams stay in transient states for the specified amount of time. This enabled sending commands from VTS while the stream is still in a transient state. Add 'getStatus' stream command to retrieve current positions, counters, and stream state. Previously we were planning to use a zero-sized burst command for that, however, after the introduction of stream state machines, the 'burst' command is not handled in every stream state, and may even affect the current state, thus it's no more usable for this purpose. Bug: 205884982 Test: atest VtsHalAudioCoreTargetTest Change-Id: I8717acace8d95d76bef2ec9fd6561796d7544992
This commit is contained in:
@@ -135,8 +135,8 @@ ndk::ScopedAStatus Module::createStreamContext(int32_t in_portConfigId, int64_t
|
||||
StreamContext temp(
|
||||
std::make_unique<StreamContext::CommandMQ>(1, true /*configureEventFlagWord*/),
|
||||
std::make_unique<StreamContext::ReplyMQ>(1, true /*configureEventFlagWord*/),
|
||||
frameSize,
|
||||
std::make_unique<StreamContext::DataMQ>(frameSize * in_bufferSizeFrames));
|
||||
frameSize, std::make_unique<StreamContext::DataMQ>(frameSize * in_bufferSizeFrames),
|
||||
mDebug.streamTransientStateDelayMs);
|
||||
if (temp.isValid()) {
|
||||
*out_context = std::move(temp);
|
||||
} else {
|
||||
@@ -242,6 +242,11 @@ ndk::ScopedAStatus Module::setModuleDebug(
|
||||
<< "while having external devices connected";
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
|
||||
}
|
||||
if (in_debug.streamTransientStateDelayMs < 0) {
|
||||
LOG(ERROR) << __func__ << ": streamTransientStateDelayMs is negative: "
|
||||
<< in_debug.streamTransientStateDelayMs;
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
|
||||
}
|
||||
mDebug = in_debug;
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user