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

PrevNext  Index
DateMon, 13 Jun 2016 00:04:30 +0200
From Markus Grabner <[hidden] at w42 dot at>
To[hidden] at lists dot jackaudio dot org
Follow-UpFons Adriaensen Re: [Jack-Devel] fractional frame rates for alsa_in and alsa_out
	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

* Attachment: '0001-using-fractional-sample-rate.patch'
content-type: text/x-patch
PrevNext  Index

1465769110.21086_0.ltw:2,a <1821963.6Sb3eEYRbK at mark>