diff options
author | Glenn Kasten <gkasten@android.com> | 2014-02-10 18:10:53 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-02-10 18:10:53 +0000 |
commit | 4e12dadeec10993d2f77cce96600e73ca0dd86e2 (patch) | |
tree | f327a43d0acf2c2aefcd7572db1120eb0fa88fb1 | |
parent | af8a3e29422ec5de5e7f8befbc5253e68729a654 (diff) | |
parent | 4361749d74113069aafb0620a1189404205c58d0 (diff) | |
download | frameworks_av-4e12dadeec10993d2f77cce96600e73ca0dd86e2.zip frameworks_av-4e12dadeec10993d2f77cce96600e73ca0dd86e2.tar.gz frameworks_av-4e12dadeec10993d2f77cce96600e73ca0dd86e2.tar.bz2 |
am 4361749d: Merge "AudioTrack: Never try to use the fast path if resampling is required"
* commit '4361749d74113069aafb0620a1189404205c58d0':
AudioTrack: Never try to use the fast path if resampling is required
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 6 | ||||
-rw-r--r-- | services/audioflinger/Configuration.h | 3 | ||||
-rw-r--r-- | services/audioflinger/Threads.cpp | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 0609a22..0b8fd7e 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -878,6 +878,12 @@ status_t AudioTrack::createTrack_l( } 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 // n = 1 fast track with single buffering; nBuffering is ignored // n = 2 fast track with double buffering 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::Track> 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 |