[Jack-Devel] fractional frame rates for alsa_in and alsa_out

Markus Grabner mg.2848 at w42.at
Mon Jun 13 00:04:30 CEST 2016


	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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-using-fractional-sample-rate.patch
Type: text/x-patch
Size: 8987 bytes
Desc: not available
URL: <https://lists.linuxaudio.org/archives/jackaudio/attachments/20160613/c3358ff1/attachment.bin>


More information about the Jackaudio mailing list