Eleven - Thank you for your post.
I could not figure out from your post what your exact code change is.
Can you please upload your CL to AOSP?
See https://source.android.com/source/submit-patches.html
It will be easier to review there.
Thanks
On Monday, October 13, 2014 10:35:01 PM UTC-7, eleven xiang wrote:
>
> Dear All,
>
> firstly, I am sorry to trouble you for a Andriod Audio issue.
>
> in AudioTrackShared.cpp, for a recording case, we met below issue:
>
> recording case met overrun, so the inputThread will sleep a while, but
> AudioRecrodThread will continue to run and block at mCblk->mFutex.
> if right now, user stop the recording, and the inputThread has no chance
> to release mFutext, then to standby.
>
> And the client's interrupt was just called right before
> AudioRecordThread's obtainBbuffer try to wait mCblk->mFutex.
> @@ -209,13 +209,18 @@ status_t ClientProxy::obtainBuffer(Buffer* buffer,
> const struct timespec *reques
> }
> int32_t old = android_atomic_and(~CBLK_FUTEX_WAKE, &cblk->mFutex);
> if (!(old & CBLK_FUTEX_WAKE)) {
> int rc;
> if (measure && !beforeIsValid) {
> clock_gettime(CLOCK_MONOTONIC, &before);
> beforeIsValid = true;
> }
> int ret = __futex_syscall4(&cblk->mFutex,
> mClientInServer ? FUTEX_WAIT_PRIVATE : FUTEX_WAIT, old
> & ~CBLK_FUTEX_WAKE, ts);
>
> Then we will find that AudioRecrodThread will always be blocked, because
> RecordTrack's destory will also miss the wake mCblk->mFutex, for it was
> already Interrupted before.
>
> So I wonder why has below CBLC_INTERRUPT condition judgement before wake,
> Could we just remove it ?
>
> void ClientProxy::interrupt()
> {
> audio_track_cblk_t* cblk = mCblk;
> if (!(android_atomic_or(CBLK_INTERRUPT, &cblk->mFlags) &
> CBLK_INTERRUPT)) {
> (void) __futex_syscall3(&cblk->mFutex, mClientInServer ?
> FUTEX_WAKE_PRIVATE : FUTEX_WAKE,
> 1);
> }
> }
>
>
> Thanks
>
--
--
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
---
You received this message because you are subscribed to the Google Groups
"android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.