Hi!
A while ago I initiated work on a Linux driver for Line6 devices (now under
sound/usb/line6 in the Linux kernel tree). Some of these devices have weird sample rates
(39062.5Hz, derived from the 10MHz USB clock divided by 256). The alsa_in and alsa_out
jack clients are convenient tools to use such Line6 devices together with more
standardized hardware operating at, e.g., 48kHz. However, alsa_in only supports integer
sample rates, and even after a couple of minutes, alsa_in doesn't detect the correct
resampling factor 1.2288 (48000/39062.5), but still reports the initial approximated value
1.228816 (48000/39062). Admittedly, the error isn't too big, but is larger than the
error of high-quality crystal oscillators. And, after all, why use an approximation if we
know better?
I modified alsa_in and alsa_out such that they accept a sample rate in floating point
format (command line option "-r") and query the fractional sample rate from the
ALSA driver to compute the initial estimation of the resampling factor (see attached
patch).
What do you think about this patch?
Kind regards,
Markus