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

Commit e6ef8300 authored by Alex Ray's avatar Alex Ray Committed by Android (Google) Code Review
Browse files

Merge "Remove conditional compilation of ATRACE functions"

parents 24ee6aaf 371eb975
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -66,9 +66,6 @@ LOCAL_CFLAGS += -DSTATE_QUEUE_INSTANTIATIONS='"StateQueueInstantiations.cpp"'

LOCAL_CFLAGS += -UFAST_TRACKS_AT_NON_NATIVE_SAMPLE_RATE

# uncomment for systrace
# LOCAL_CFLAGS += -DATRACE_TAG=ATRACE_TAG_AUDIO

# uncomment for dumpsys to write most recent audio output to .wav file
# 47.5 seconds at 44.1 kHz, 8 megabytes
# LOCAL_CFLAGS += -DTEE_SINK_FRAMES=0x200000
+5 −0
Original line number Diff line number Diff line
@@ -17,6 +17,11 @@
#define LOG_TAG "FastMixer"
//#define LOG_NDEBUG 0

/** Uncomment for systrace.
 * ATRACE_TAG will default to ATRACE_TAG_NEVER in the header.
 */
//#define ATRACE_TAG ATRACE_TAG_AUDIO

#include <sys/atomics.h>
#include <time.h>
#include <utils/Log.h>
+3 −7
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@

#define LOG_TAG "AudioFlinger"
//#define LOG_NDEBUG 0
#define ATRACE_TAG ATRACE_TAG_AUDIO

#include <math.h>
#include <fcntl.h>
@@ -25,6 +26,7 @@
#include <cutils/properties.h>
#include <cutils/compiler.h>
#include <utils/Log.h>
#include <utils/Trace.h>

#include <private/media/AudioTrackShared.h>
#include <hardware/audio.h>
@@ -1652,9 +1654,7 @@ void AudioFlinger::PlaybackThread::threadLoop_write()
    if (mNormalSink != 0) {
#define mBitShift 2 // FIXME
        size_t count = mixBufferSize >> mBitShift;
#if defined(ATRACE_TAG) && (ATRACE_TAG != ATRACE_TAG_NEVER)
        ATRACE_BEGIN("write");
#endif
        // update the setpoint when AudioFlinger::mScreenState changes
        uint32_t screenState = AudioFlinger::mScreenState;
        if (screenState != mScreenState) {
@@ -1666,9 +1666,7 @@ void AudioFlinger::PlaybackThread::threadLoop_write()
            }
        }
        ssize_t framesWritten = mNormalSink->write(mMixBuffer, count);
#if defined(ATRACE_TAG) && (ATRACE_TAG != ATRACE_TAG_NEVER)
        ATRACE_END();
#endif
        if (framesWritten > 0) {
            bytesWritten = framesWritten << mBitShift;
        } else {
@@ -2000,9 +1998,7 @@ if (mType == MIXER) {
            if (!mStandby && delta > maxPeriod) {
                mNumDelayedWrites++;
                if ((now - lastWarning) > kWarningThrottleNs) {
#if defined(ATRACE_TAG) && (ATRACE_TAG != ATRACE_TAG_NEVER)
                    ScopedTrace st(ATRACE_TAG, "underrun");
#endif
                    ATRACE_NAME("underrun");
                    ALOGW("write blocked for %llu msecs, %d delayed writes, thread %p",
                            ns2ms(delta), mNumDelayedWrites, this);
                    lastWarning = now;