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

Skip to content
Commit 32dc26e7 authored by Jindong's avatar Jindong Committed by fang hui
Browse files

Sometimes no audio output after playing some clips using Files.apk

Sometimes after switching songs in Files, audio driver
enters "PAUSED" state, and no sound anymore.

In normal case, "paused" track will be removed from active tracks,
then audio hal will make this stream enter standby mode.

Actually there are two paths to move paused tracks into standby mode:
1> track underruns twice:
    if (--(track->mRetryCount) <= 0) {  // mRetryCount is 2
        tracksToRemove->add(track);
    } else {
        doHwPause = true;   // pause
    }
Unfortunately, this issue happened exactly in the middle state:
track underrun for the first time, it enters to paused state;
then before it underrun for second time, it is stopped due to MediaPlayer.

2> track is paused and code goes here:
    if (mStandby || !last ||
            track->presentationComplete(framesWritten, audioHALFrames) ||
            track->isPaused() ||
+           track->isStopped()) {
        tracksToRemove->add(track);
    }
But when the issue happens, track is in stopped state,
there is no logic to standby it anymore, so add one.

Change-Id: I70cac1f3d6b065690400f6a2363712d4642a9763
parent 429f364c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment