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

Skip to content
Commit 3ed4ff84 authored by donghyub.cho's avatar donghyub.cho Committed by Steve Kondik
Browse files

Fix bugs regarding looping play issue with sharedBuffer



1. Looping play error.
Looping SoundPool play with FastMixer sometimes does not work depends on audio frameCount.

2. When a audio is played with SoundPool, AudioTrack is created with the "AUDIO_OUTPUT_FLAG_FAST" flag.
If all the conditions such as callback transfer mode, mSharedBuffer, and sampling rate, for FastMixer usage are satisfied, then FastMixer is ready for working.
For instance, suppose that a audio frameCount is set as "6721" before StaticAudioTrackClientProxy class instance is created,[AudioTrack::createTrack_l()]
on playing, the initial value("6721") of "frameReady" is getting to be decreased by the value("240") of "current->mFrameCount"[FastMixer::onWork()]
After all, the value of "frameReady" is getting to be decreased, and the remaing value of "frameReady" getting to be "1".

3. On this moment, "underruns.mBitFields.mMostRecent" becames to be "UNDERRUN_PARTIAL"[FastMixer::onWork()],
and the value of "recentUnderruns" becames to be "1"[AudioFlinger::MixerThread::prepareTracks_l].
If the value of "recentUnderruns" is "1", then even though the vale of "track->mState" is "TrackBase::ACTIVE", "presentationComplete()" API will be called.
Therefore, looping play becames suddenly stop.

4. To prevent playing stop in this case, the routine of checking "recentEmpty" value is added.

Change-Id: I716aa987205021662da336c12a69407caacb99a5
Signed-off-by: default avatardonghyub cho <donghyub.cho@lge.com>
parent 0b971006
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment