summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2015-05-06 08:46:52 -0700
committerAndy Hung <hunga@google.com>2015-05-12 09:30:51 -0700
commitdb4c031f518ae5806af73756273ff32cd8d0e4f8 (patch)
tree62f9e0541acccc3acacf808d2a3cdad130eb819b /services/audioflinger
parent18aa27016a94d0fee243637a80fd0741f89e08f2 (diff)
downloadframeworks_av-db4c031f518ae5806af73756273ff32cd8d0e4f8.zip
frameworks_av-db4c031f518ae5806af73756273ff32cd8d0e4f8.tar.gz
frameworks_av-db4c031f518ae5806af73756273ff32cd8d0e4f8.tar.bz2
Update sampling rate to 192kHz for devices
Change-Id: I0a83206be51d7ae18ccf85b94b2127356307be69
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/AudioMixer.cpp7
-rw-r--r--services/audioflinger/Threads.cpp7
2 files changed, 8 insertions, 6 deletions
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp
index 7040af4..1348d08 100644
--- a/services/audioflinger/AudioMixer.cpp
+++ b/services/audioflinger/AudioMixer.cpp
@@ -708,11 +708,10 @@ bool AudioMixer::track_t::setResampler(uint32_t trackSampleRate, uint32_t devSam
// FIXME this is flawed for dynamic sample rates, as we choose the resampler
// quality level based on the initial ratio, but that could change later.
// Should have a way to distinguish tracks with static ratios vs. dynamic ratios.
- if (!((trackSampleRate == 44100 && devSampleRate == 48000) ||
- (trackSampleRate == 48000 && devSampleRate == 44100))) {
- quality = AudioResampler::DYN_LOW_QUALITY;
- } else {
+ if (isMusicRate(trackSampleRate)) {
quality = AudioResampler::DEFAULT_QUALITY;
+ } else {
+ quality = AudioResampler::DYN_LOW_QUALITY;
}
// TODO: Remove MONO_HACK. Resampler sees #channels after the downmixer
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 7feb63b..5ef017f 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -5328,11 +5328,11 @@ AudioFlinger::RecordThread::RecordThread(const sp<AudioFlinger>& audioFlinger,
}
initFastCapture =
// either capture sample rate is same as (a reasonable) primary output sample rate
- (((primaryOutputSampleRate == 44100 || primaryOutputSampleRate == 48000) &&
+ ((isMusicRate(primaryOutputSampleRate) &&
(mSampleRate == primaryOutputSampleRate)) ||
// or primary output sample rate is unknown, and capture sample rate is reasonable
((primaryOutputSampleRate == 0) &&
- ((mSampleRate == 44100 || mSampleRate == 48000)))) &&
+ isMusicRate(mSampleRate))) &&
// and the buffer size is < 12 ms
(mFrameCount * 1000) / mSampleRate < 12;
break;
@@ -6435,6 +6435,9 @@ status_t AudioFlinger::RecordThread::RecordBufferConverter::updateParameters(
return NO_ERROR;
}
+ ALOGV("RecordBufferConverter updateParameters srcMask:%#x dstMask:%#x"
+ " srcFormat:%#x dstFormat:%#x srcRate:%u dstRate:%u",
+ srcChannelMask, dstChannelMask, srcFormat, dstFormat, srcSampleRate, dstSampleRate);
const bool valid =
audio_is_input_channel(srcChannelMask)
&& audio_is_input_channel(dstChannelMask)