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

Commit 4e12dade authored by Glenn Kasten's avatar Glenn Kasten Committed by Android Git Automerger
Browse files

am 4361749d: Merge "AudioTrack: Never try to use the fast path if resampling is required"

* commit '4361749d':
  AudioTrack: Never try to use the fast path if resampling is required
parents af8a3e29 4361749d
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -878,6 +878,12 @@ status_t AudioTrack::createTrack_l(
    }
    }
    ALOGV("createTrack_l() output %d afLatency %d", output, afLatency);
    ALOGV("createTrack_l() output %d afLatency %d", output, afLatency);


    if ((flags & AUDIO_OUTPUT_FLAG_FAST) && sampleRate != afSampleRate) {
        ALOGW("AUDIO_OUTPUT_FLAG_FAST denied by client due to mismatching sample rate (%d vs %d)",
              sampleRate, afSampleRate);
        flags = (audio_output_flags_t) (flags & ~AUDIO_OUTPUT_FLAG_FAST);
    }

    // The client's AudioTrack buffer is divided into n parts for purpose of wakeup by server, where
    // The client's AudioTrack buffer is divided into n parts for purpose of wakeup by server, where
    //  n = 1   fast track with single buffering; nBuffering is ignored
    //  n = 1   fast track with single buffering; nBuffering is ignored
    //  n = 2   fast track with double buffering
    //  n = 2   fast track with double buffering
+0 −3
Original line number Original line Diff line number Diff line
@@ -32,9 +32,6 @@
// uncomment to enable fast mixer to take performance samples for later statistical analysis
// uncomment to enable fast mixer to take performance samples for later statistical analysis
#define FAST_MIXER_STATISTICS
#define FAST_MIXER_STATISTICS


// uncomment to allow fast tracks at non-native sample rate
//#define FAST_TRACKS_AT_NON_NATIVE_SAMPLE_RATE

// uncomment for debugging timing problems related to StateQueue::push()
// uncomment for debugging timing problems related to StateQueue::push()
//#define STATE_QUEUE_DUMP
//#define STATE_QUEUE_DUMP


+0 −2
Original line number Original line Diff line number Diff line
@@ -1218,10 +1218,8 @@ sp<AudioFlinger::PlaybackThread::Track> AudioFlinger::PlaybackThread::createTrac
            // mono or stereo
            // mono or stereo
            ( (channelMask == AUDIO_CHANNEL_OUT_MONO) ||
            ( (channelMask == AUDIO_CHANNEL_OUT_MONO) ||
              (channelMask == AUDIO_CHANNEL_OUT_STEREO) ) &&
              (channelMask == AUDIO_CHANNEL_OUT_STEREO) ) &&
#ifndef FAST_TRACKS_AT_NON_NATIVE_SAMPLE_RATE
            // hardware sample rate
            // hardware sample rate
            (sampleRate == mSampleRate) &&
            (sampleRate == mSampleRate) &&
#endif
            // normal mixer has an associated fast mixer
            // normal mixer has an associated fast mixer
            hasFastMixer() &&
            hasFastMixer() &&
            // there are sufficient fast track slots available
            // there are sufficient fast track slots available