[PATCH] ALSA: usb-audio: Apply async workaround for Scarlett 2i4 2nd gen

Gregor Pintar grpintar at gmail.com
Wed Apr 22 20:55:22 CEST 2020


On Wed, 22 Apr 2020 Alexander Tsoy wrote:
> В Вт, 21/04/2020 в 21:31 +0200, Takashi Iwai пишет:
> > I wonder, though, whether we can correct the rounding error in the
> > driver code, too.
> 
> I'm not sure if it's possible with currently used Q16.16 arithmetic.

Maybe calculate fixed correction shifts (like it would be feedback)?
Something like leap year.

In endpoint.c:
static inline unsigned get_usb_high_speed_rate(unsigned int rate)
{
	return ((rate << 10) + 62) / 125;
}
I guess 62 tries to round it, but exact number is needed. So exact value for
44100 should be 361267.2. For 48000 it is 360448.
If only we can deliver that 0.2 by shifting rate somehow?

At least maybe it would be better to disable sample rates that do not divide
by 1000 on SYNC playback endpoints, if there are others sample rates.

But I'm not familar with the code or USB.



More information about the Alsa-devel mailing list