in order to implement something similar to alsa_in
(which can be found in the tools directory from jack1)
i need a way to determine the samplerate and/or buffer
position of the sound interface.
you already stated, that you know the samplerate in firewire clock.
so the alsa_in dll could operate on firewire clock, for example.
i also need some absolute value. but if the samplerate is quite accurate,
it could be high granularity.
alsa_in operates like this:
double current_resamp_rate = 1.0;
process( nframes )
{
snd_pcm_delay( pcm, &delay )
offset = delay-target_delay;
double resamp_rate = nframes/(nframes+offset);
double diff_value = (current_resample_rate - resamp_rate) / catch_factor;
current_resample_rate += diff_value;
write( nframes * current_resample_rate );
}
I hope its clear, that this is in fact a dll.
So we might just use some cascades of dlls to get there.