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:
donghyub cho <donghyub.cho@lge.com>
Loading
Please register or sign in to comment