There are a bunch of patches coming related to this in Cupcake. The
app can either ask for the default latency or it can ask for the
latency and request something bigger.

On Feb 27, 6:50 am, AndroidJimmy <[email protected]> wrote:
> I meet a problem about creating AudioTrack failed with larger audio
> output latency.
> It fails in AudioTrack::set(), blocked by codes below:
>
>     if (frameCount < minFrameCount) {
>       LOGE("Invalid buffer size: minFrameCount %d, frameCount %d",
> minFrameCount, frameCount);
>       return BAD_VALUE;
>     }
>
> I think this code is for guaranteeing there are enough buffer and
> sample in AudioTrack to wait for audio output consuming the output
> data.
>
> In MediaPlayerService::AudioOutput::open(),  AudioTrack is created by
> codes below:
>
>     new AudioTrack(mStreamType, sampleRate, format, channelCount,
> frameCount*bufferCount);
>
> framecount is determined by frameCount = (sampleRate*afFrameCount)/
> afSampleRate; In most situation, sampleRate is usually 44100,
> bufferCount is hard-code in PV(4) and SONIVOX_PLAYER/VORBIS_PLAYER
> (DEFAULT_AUDIOSINK_BUFFERCOUNT 4).
>
> So if there is a larger output latency, PV/SONIVOX_PLAYER/
> VORBIS_PLAYER may not create an AudioTrack with enough bufferCount.
> These may happen when output is a larger latency network device, such
> as BlueTooth, etc.
>
> Is there a way to prevent from creating AudioTrack fail under this
> situation?
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to