Re: achieving very low latency
Re: achieving very low latency
- Subject: Re: achieving very low latency
- From: Jorge Chamorro <email@hidden>
- Date: Sat, 07 Jul 2012 05:31:02 +0200
On 07/07/2012, at 01:32, William Stewart wrote:
>
> On Jul 6, 2012, at 4:44 AM, Jorge Chamorro wrote:
>> On 05/07/2012, at 16:08, Hari Karam Singh wrote:
>>>
>>> As far the CoreAudio code goes, the trick is as you said, to preload at least part of the audio file, and then as also suggested, leave the audio graph running, feeding in silence until the sound is triggered at which point you start feeding the audio file. If you don’t wish to load the entire sound into memory, you need to feed the audio into the render callback via a ring buffer which you monitor from a separate thread and refill from disk when it depletes below a certain threshold.
>>
>> Hi,
>>
>> That's what I'm doing here <https://github.com/xk/node-sound> and the test <https://github.com/xk/node-sound/blob/master/tests/test00.js> shows that latency is still between 25 and 30 ms, so in my experience that won't cut it.
>>
> I don't understand the limitation you are describing. We consistenly measure the ability of many systems to achieve analog-in to analog-out latency under 5msec (and lower, depending on the quality of the driver implementation and the latency of the HW itself - DAC/ADC buffering, transport medium latency, etc).
>
> By looking at the various paths of the I/O, you can determine the latency of a sample placed in a buffer to when it will appear in the analog domain:
>
> Output buffer size
> + safety offset
> + presentation delay
>
> This is (and we've measured this) can be under 2.5msec, so there is something serious wrong in your characertisation of 25-30ms if you believe that this is all audio system latency
That test calls AudioQueueStart(player->AQ, NULL); at 10, 15, 20, 25, 30 ... 100 ms intervals, where player->AQ are 3ms sounds. I've not plugged it into the oscilloscope, but when I run it I hear clearly that at any interval below 25-30 it sounds identical.
--
Jorge.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden