Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33da4d7d authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

audio: Fix output blocking condition in the remote submix

During transition to AIDL, the condition for blocking writes
on the output stream of the remote submix was not transferred
correctly. This logic was fixed.

While testing the fixed logic, some deficiencies in the VTS
tests were found and also fixed.

Bug: 383982254
Test: atest --test-filter="AudioModuleRemoteSubmix*" VtsHalAudioCoreTargetTest
Change-Id: Iecd5ecd329d61764b314744eaf4afb6196a38e3e
parent 584871b6
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -77,17 +77,15 @@ StreamRemoteSubmix::~StreamRemoteSubmix() {
}

::android::status_t StreamRemoteSubmix::drain(StreamDescriptor::DrainMode) {
    usleep(1000);
    return ::android::OK;
}

::android::status_t StreamRemoteSubmix::flush() {
    usleep(1000);
    return ::android::OK;
    // TODO(b/372951987): consider if this needs to be done from 'StreamInWorkerLogic::cycle'.
    return mIsInput ? standby() : ::android::OK;
}

::android::status_t StreamRemoteSubmix::pause() {
    usleep(1000);
    return ::android::OK;
}

+2 −2
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@ bool SubmixRoute::hasAtleastOneStreamOpen() {
//   start was delayed
bool SubmixRoute::shouldBlockWrite() {
    std::lock_guard guard(mLock);
    return (mStreamInOpen || (mStreamInStandby && (mReadCounterFrames != 0)));
    return mStreamInOpen && (!mStreamInStandby || mReadCounterFrames == 0);
}

long SubmixRoute::updateReadCounterFrames(size_t frameCount) {
+251 −103

File changed.

Preview size limit exceeded, changes collapsed.