Hi,
On 18.06.2009, at 22:27, Jussi Laako wrote:
No, generally data needs to be fed _to_ application
immediately when
it
becomes available after A/D conversion (PCI DMA completion interrupt).
Application(s) process the data and it is ought to go to D/A
conversion
on next hardware interrupt (PCI DMA reprogram interrupt), along with
time-synchronous data from other applications. This creates total
latency of inputhw+blocksize+outputhw. Generally input and output
latencies should be around few tens of samples (due to delta-sigma
converter resampling filters etc). And generally blocksize is also
kept
around 64 or so.
I think this is incorrect. The total latency should be inputhw
+2*blocksize+outputhw.
At timeoffset 0 the soundcard will start to capture samples. Until the
first sample makes it into the buffer there is a delay of inputhw (A/
D, transfer etc). You can't access the buffer until at least blocksize
samples have been captured. So the first buffer switch takes place at
timeoffset inputhw + blocksize.
Now you do your processing. No matter how fast you can do that you'll
have to wait until the next buffer switch will take place, which will
happen at timeoffset inputhw + blocksize + blocksize.
Transfer + D/A will add outputhw to the mix and you end out with the
first sample at your speakers at timeoffset inputhw + blocksize +
blocksize + outputhw.
Best,
Florian