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

Commit 48a0bfa6 authored by Glenn Kasten's avatar Glenn Kasten Committed by Android Git Automerger
Browse files

am 49dd5cf3: Merge "Log track name on obtain/releaseBuffer warnings" into jb-dev

* commit '49dd5cf3':
  Log track name on obtain/releaseBuffer warnings
parents cc0df657 49dd5cf3
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -97,9 +97,7 @@ public:

                // read-only for client, server writes once at initialization and is then read-only
                uint8_t     frameSize;       // would normally be size_t, but 8 bits is plenty

                // never used
                uint8_t     pad1;
                uint8_t     mName;           // normal tracks: track name, fast tracks: track index

                // used by client only
                uint16_t    bufferTimeoutMs; // Maximum cumulated timeout before restarting audioflinger
+3 −3
Original line number Diff line number Diff line
@@ -987,8 +987,8 @@ status_t AudioTrack::obtainBuffer(Buffer* audioBuffer, int32_t waitCount)
                    // timing out when a loop has been set and we have already written upto loop end
                    // is a normal condition: no need to wake AudioFlinger up.
                    if (cblk->user < cblk->loopEnd) {
                        ALOGW(   "obtainBuffer timed out (is the CPU pegged?) %p "
                                "user=%08x, server=%08x", this, cblk->user, cblk->server);
                        ALOGW(   "obtainBuffer timed out (is the CPU pegged?) %p name=%#x"
                                "user=%08x, server=%08x", this, cblk->mName, cblk->user, cblk->server);
                        //unlock cblk mutex before calling mAudioTrack->start() (see issue #1617140)
                        cblk->lock.unlock();
                        result = mAudioTrack->start();
@@ -1054,7 +1054,7 @@ void AudioTrack::releaseBuffer(Buffer* audioBuffer)
        // restart track if it was disabled by audioflinger due to previous underrun
        if (mActive && (mCblk->flags & CBLK_DISABLED_MSK)) {
            android_atomic_and(~CBLK_DISABLED_ON, &mCblk->flags);
            ALOGW("releaseBuffer() track %p disabled, restarting", this);
            ALOGW("releaseBuffer() track %p name=%#x disabled, restarting", this, mCblk->mName);
            mAudioTrack->start();
        }
    }
+2 −0
Original line number Diff line number Diff line
@@ -4287,6 +4287,7 @@ AudioFlinger::PlaybackThread::Track::Track(
        mCblk->frameSize = audio_is_linear_pcm(format) ? mChannelCount * sizeof(int16_t) : sizeof(uint8_t);
        // to avoid leaking a track name, do not allocate one unless there is an mCblk
        mName = thread->getTrackName_l((audio_channel_mask_t)channelMask);
        mCblk->mName = mName;
        if (mName < 0) {
            ALOGE("no more track names available");
            return;
@@ -4302,6 +4303,7 @@ AudioFlinger::PlaybackThread::Track::Track(
            //       this means we are potentially denying other more important fast tracks from
            //       being created.  It would be better to allocate the index dynamically.
            mFastIndex = i;
            mCblk->mName = i;
            // Read the initial underruns because this field is never cleared by the fast mixer
            mObservedUnderruns = thread->getFastTrackUnderruns(i);
            thread->mFastTrackAvailMask &= ~(1 << i);