On Friday 10 February 2006 19:07, Victor Lazzarini wrote:

> Not having tested realtime IO on Windows for a while, I
> was shocked to confirm that there is indeed some issue
> with input audio. I was getting a train of clicks  when running
> Csound5 with ASIO.
> 
> But hey, I found out why!
> 
> It just happens that -b has to be a multiple of ksmps. I have not
> checked the code, but it's simple. With -b512 and ksmps=100,
> clicks are there, but with -b100 (or -b200), the sound is perfect.

It is not unlikely that having an integer ratio of -b and ksmps
improves real time audio, especially with double buffering, simply
because of having the calls to the rtrecord and rtplay callbacks
more evenly distributed. For example, with your example, using -b512
would mean there is an rtrecord call in the first control period,
and then another rtrecord call followed by an rtplay call in the
sixth control period. With -b500, however, the rtplay would be called
in the fifth control period, avoiding the double calls to rtrecord
at the beginning of performance.