Hi,
I have a system where the audio hardware supports 16KHz.
I've moved from Android 4.2.2 to 4.3 and now it seems there's no
resampling. If I play 44.1KHz media (e.g. music, ringtones) it results with
slow audio.
If I play 16KHz file it sounds good. On the previous release the resampling
was fine (done by audioflinger).
After code inspection, I found a fix for this issue,
in frameworks/av/services/audioflinger/Threads.cpp -
MixerThread::prepareTracks_l() :
// limit track sample rate to 2 x output sample rate, which changes at
re-configuration
uint32_t maxSampleRate = mSampleRate * 2;
uint32_t reqSampleRate = track->mServerProxy->getSampleRate();
if (reqSampleRate == 0) {
reqSampleRate = mSampleRate;
} else if (reqSampleRate > maxSampleRate) {
reqSampleRate = maxSampleRate;
}
mAudioMixer->setParameter(
name,
AudioMixer::RESAMPLE,
AudioMixer::SAMPLE_RATE,
(void *)reqSampleRate);
Since my HW works with 16KHz then all the 44.1KHz media is handled as
32KHz, hence it sounds slowly.
Is there a reason for this logic? audio quality limitation?
By removing the "else" part resampling works fine.
Is it a bug?
In 4.2.2 this logic is missing and there're no resampling issues.
Thanks,
Naaman
--
--
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
---
You received this message because you are subscribed to the Google Groups
"android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.