OpenSL ES would cause noise when adjust volume?

198 views
Skip to first unread message

Hu Tianjun

unread,
May 24, 2016, 9:59:22 AM5/24/16
to android-ndk
hi 
I've a audio player application using OpenSL ES. when the low latency request (AUDIO_OUTPUT_FLAG_FAST flag) have been accpeted by AudioTrack and AudioFlinger, I found that a noise would accur when adjusting volume. This is because the way change volume directly, every level jump happened between two sample point in pcm file while each volume change occur. 
mMixer->setParameter(name, AudioMixer::VOLUME, AudioMixer::VOLUME0, &vlf);
While other app without OpenSl ES have not such issue. Their volume changing is ramped , that means volume changed smoothly with more sample point.
mMixer->setParameter(name, AudioMixer::RAMP_VOLUME, AudioMixer::VOLUME0, &vlf);

So, in a word I found OpenSL ES would trigger noise when  adjusting volume for low latency . 
My questions :
1. Did google guys know this ? or am i missing something or making some mistake?
2. We know android audio latency is huge. So if Fast Track is one of the solutions, why do not apply it in AudioRecord and AudioTrack instead of only OpenSL ES.

Thank you .

Glenn Kasten

unread,
May 24, 2016, 7:04:57 PM5/24/16
to android-ndk
> 1. Did google guys know this ? or am i missing something or making some mistake?
Hu, thanks for reporting this problem.  I'm tracking this internally.
If you would like to track it publicly, please use https://code.google.com/p/android/issues/list
and reply here with the issue URL

> 2. We know android audio latency is huge. So if Fast Track is one of the solutions, why do not apply it in AudioRecord and AudioTrack instead of only OpenSL ES.
I assume you mean the SDK API android.media.* ?

Hu Tianjun

unread,
Jun 25, 2016, 12:09:00 AM6/25/16
to android-ndk
https://code.google.com/p/android/issues/detail?id=214219
Thank you Glenn

在 2016年5月25日星期三 UTC+8上午7:04:57,Glenn Kasten写道:
Reply all
Reply to author
Forward
0 new messages