Lines Matching refs:cblk
384 audio_track_cblk_t* cblk = mCblk; in start() local
389 mNewPosition = cblk->server + mUpdatePeriod; in start()
390 cblk->lock.lock(); in start()
391 cblk->bufferTimeoutMs = MAX_STARTUP_TIMEOUT_MS; in start()
392 cblk->waitTimeMs = 0; in start()
393 android_atomic_and(~CBLK_DISABLED_ON, &cblk->flags); in start()
404 if (!(cblk->flags & CBLK_INVALID_MSK)) { in start()
405 cblk->lock.unlock(); in start()
408 cblk->lock.lock(); in start()
410 android_atomic_or(CBLK_INVALID_ON, &cblk->flags); in start()
413 if (cblk->flags & CBLK_INVALID_MSK) { in start()
414 status = restoreTrack_l(cblk, true); in start()
416 cblk->lock.unlock(); in start()
601 audio_track_cblk_t* cblk = mCblk; in setLoop_l() local
603 Mutex::Autolock _l(cblk->lock); in setLoop_l()
606 cblk->loopStart = UINT_MAX; in setLoop_l()
607 cblk->loopEnd = UINT_MAX; in setLoop_l()
608 cblk->loopCount = 0; in setLoop_l()
618 loopEnd - loopStart > cblk->frameCount || in setLoop_l()
619 cblk->server > loopStart) { in setLoop_l()
620 …oopCount %d, framecount %d, user %d", loopStart, loopEnd, loopCount, cblk->frameCount, cblk->user); in setLoop_l()
624 if ((mSharedBuffer != 0) && (loopEnd > cblk->frameCount)) { in setLoop_l()
626 loopStart, loopEnd, cblk->frameCount); in setLoop_l()
630 cblk->loopStart = loopStart; in setLoop_l()
631 cblk->loopEnd = loopEnd; in setLoop_l()
632 cblk->loopCount = loopCount; in setLoop_l()
896 sp<IMemory> cblk = track->getCblk(); in createTrack_l() local
897 if (cblk == 0) { in createTrack_l()
902 mCblkMemory = cblk; in createTrack_l()
903 mCblk = static_cast<audio_track_cblk_t*>(cblk->pointer()); in createTrack_l()
948 audio_track_cblk_t* cblk = mCblk; in obtainBuffer() local
950 uint32_t waitTimeMs = (waitCount < 0) ? cblk->bufferTimeoutMs : WAIT_PERIOD_MS; in obtainBuffer()
955 uint32_t framesAvail = cblk->framesAvailable(); in obtainBuffer()
957 cblk->lock.lock(); in obtainBuffer()
958 if (cblk->flags & CBLK_INVALID_MSK) { in obtainBuffer()
961 cblk->lock.unlock(); in obtainBuffer()
964 cblk->lock.lock(); in obtainBuffer()
970 cblk->lock.unlock(); in obtainBuffer()
974 cblk->lock.unlock(); in obtainBuffer()
977 if (!(cblk->flags & CBLK_INVALID_MSK)) { in obtainBuffer()
979 result = cblk->cv.waitRelative(cblk->lock, milliseconds(waitTimeMs)); in obtainBuffer()
980 cblk->lock.unlock(); in obtainBuffer()
985 cblk->lock.lock(); in obtainBuffer()
988 if (cblk->flags & CBLK_INVALID_MSK) { in obtainBuffer()
992 cblk->waitTimeMs += waitTimeMs; in obtainBuffer()
993 if (cblk->waitTimeMs >= cblk->bufferTimeoutMs) { in obtainBuffer()
996 if (cblk->user < cblk->loopEnd) { in obtainBuffer()
998 … "user=%08x, server=%08x", this, cblk->mName, cblk->user, cblk->server); in obtainBuffer()
1000 cblk->lock.unlock(); in obtainBuffer()
1002 cblk->lock.lock(); in obtainBuffer()
1004 android_atomic_or(CBLK_INVALID_ON, &cblk->flags); in obtainBuffer()
1006 result = restoreTrack_l(cblk, false); in obtainBuffer()
1010 cblk->lock.unlock(); in obtainBuffer()
1014 cblk->waitTimeMs = 0; in obtainBuffer()
1018 cblk->lock.unlock(); in obtainBuffer()
1024 framesAvail = cblk->framesAvailable_l(); in obtainBuffer()
1026 cblk->lock.unlock(); in obtainBuffer()
1029 cblk->waitTimeMs = 0; in obtainBuffer()
1035 uint32_t u = cblk->user; in obtainBuffer()
1036 uint32_t bufferEnd = cblk->userBase + cblk->frameCount; in obtainBuffer()
1045 audioBuffer->size = framesReq * cblk->frameSize; in obtainBuffer()
1051 audioBuffer->raw = (int8_t *)cblk->buffer(u); in obtainBuffer()
1205 audio_track_cblk_t* cblk = mCblk; in processAudioBuffer() local
1210 if (active && (cblk->framesAvailable() == cblk->frameCount)) { in processAudioBuffer()
1211 ALOGV("Underrun user: %x, server: %x, flags %04x", cblk->user, cblk->server, cblk->flags); in processAudioBuffer()
1212 if (!(android_atomic_or(CBLK_UNDERRUN_ON, &cblk->flags) & CBLK_UNDERRUN_MSK)) { in processAudioBuffer()
1214 if (cblk->server == cblk->frameCount) { in processAudioBuffer()
1222 while (mLoopCount > cblk->loopCount) { in processAudioBuffer()
1232 if (cblk->server >= mMarkerPosition) { in processAudioBuffer()
1240 while (cblk->server >= mNewPosition) { in processAudioBuffer()
1327 status_t AudioTrack::restoreTrack_l(audio_track_cblk_t*& cblk, bool fromStart) in restoreTrack_l() argument
1331 if (!(android_atomic_or(CBLK_RESTORING_ON, &cblk->flags) & CBLK_RESTORING_MSK)) { in restoreTrack_l()
1337 cblk->cv.broadcast(); in restoreTrack_l()
1338 cblk->lock.unlock(); in restoreTrack_l()
1348 cblk->sampleRate, in restoreTrack_l()
1357 uint32_t user = cblk->user; in restoreTrack_l()
1358 uint32_t server = cblk->server; in restoreTrack_l()
1366 setLoop_l(cblk->loopStart, cblk->loopEnd, cblk->loopCount); in restoreTrack_l()
1397 android_atomic_and(~CBLK_RESTORING_ON, &cblk->flags); in restoreTrack_l()
1402 android_atomic_or(CBLK_RESTORED_ON, &cblk->flags); in restoreTrack_l()
1403 cblk->cv.broadcast(); in restoreTrack_l()
1405 if (!(cblk->flags & CBLK_RESTORED_MSK)) { in restoreTrack_l()
1408 result = cblk->cv.waitRelative(cblk->lock, milliseconds(RESTORE_TIMEOUT_MS)); in restoreTrack_l()
1412 cblk->lock.unlock(); in restoreTrack_l()
1417 cblk->lock.unlock(); in restoreTrack_l()
1421 result, mActive, mCblk, cblk, mCblk->flags, cblk->flags); in restoreTrack_l()
1425 cblk = mCblk; in restoreTrack_l()
1427 cblk->lock.lock(); in restoreTrack_l()