Re: USB Audio streaming start
Re: USB Audio streaming start
- Subject: Re: USB Audio streaming start
- From: Daniel Mack <email@hidden>
- Date: Mon, 24 Oct 2011 15:02:22 +0200
On 21.10.11 17:42, Vyacheslav Matyushin wrote:
> Thanks, Daniel.
>
> One more thing which I can't get is safety offset.
> How do I calculate it?
>
> One tip I found is:
> Sample offset is a feature designed for audio devices based on block
> I/O. Consider an output device as an example. If the audio device
> transfers data in a 32-sample block transaction, it must have at
> least 32 samples available when the audio engine wakes up. Otherwise,
> the engine won’t be able to queue up a block transfer, and will end up
> slipping a cycle, potentially resulting in a glitch. To solve this
> problem, you can specify a sample offset to guarantee that the higher
> levels stay a certain distance ahead of the I/O head.
>
> So does it really depend on the size of buffers I queue?
Yes, it must be at least the number of samples that you pack in one
single USB packet, as your driver can't queue less than that.
> If I queue some number of buffers each holding say 8 ms of data, should
> my safety offset be (number_of_samples_in_1ms * 8)?
> I guess it's too much..
No, it's not about the number of USB packets you queue ahead. It's about
the number of samples in the pre-queued packets for which you can still
alter the payload afterwards.
Btw - what kind of hardware is this driver for? And do you contemplate
relasing the source code at some point? Just curious ...
Daniel
_______________________________________________
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