From 398f21348e5100289f6e5be30c8b5257fa04aaf9 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Fri, 31 Jan 2014 13:30:15 +0200 Subject: AudioTrack: Never try to use the fast path if resampling is required Unless AudioFlinger was built with FAST_TRACKS_AT_NON_NATIVE_SAMPLE_RATE enabled, AudioFlinger would deny using the fast path (and internally fall back to the normal codepath) when it realized that resampling was required. Since the buffer size calculations within AudioFlinger don't take resampling into account properly (see the calculation below "AUDIO_OUTPUT_FLAG_FAST denied" in audioflinger/Threads.cpp, just below the hunk that this patch changes), make sure AudioTrack doesn't try to use the fast path if resampling is required. This removes the possibility to enable FAST_TRACKS_AT_NON_NATIVE_SAMPLE_RATE in AudioFlinger since it AudioTrack now won't even try to use the fast path for content that requires resampling, regardless of the AudioFlinger configuration. Change-Id: Icf0f8ad50bf0fdb84657f518c0120aa0535f23f9 --- services/audioflinger/Configuration.h | 3 --- services/audioflinger/Threads.cpp | 2 -- 2 files changed, 5 deletions(-) (limited to 'services') diff --git a/services/audioflinger/Configuration.h b/services/audioflinger/Configuration.h index bc2038a..0754d9d 100644 --- a/services/audioflinger/Configuration.h +++ b/services/audioflinger/Configuration.h @@ -32,9 +32,6 @@ // uncomment to enable fast mixer to take performance samples for later statistical analysis #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() //#define STATE_QUEUE_DUMP diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 73429ec..072e5fd 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -1218,10 +1218,8 @@ sp AudioFlinger::PlaybackThread::createTrac // mono or stereo ( (channelMask == AUDIO_CHANNEL_OUT_MONO) || (channelMask == AUDIO_CHANNEL_OUT_STEREO) ) && -#ifndef FAST_TRACKS_AT_NON_NATIVE_SAMPLE_RATE // hardware sample rate (sampleRate == mSampleRate) && -#endif // normal mixer has an associated fast mixer hasFastMixer() && // there are sufficient fast track slots available -- cgit v1.1