# alsa-pcm: Lower the frequency of USB gadget rate updates --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -2292,9 +2292,11 @@ last_pitch = (uint64_t)(1000000 / state->last_rate); } - /* The pitch adjustment is limited to 1 ppm */ - if (pitch == last_pitch) - return 0; + /* The pitch adjustment is limited to 1 ppm according to the spec, but + * let's avoid very granular changes so that we don't spam the host + * (and ourselves, if bind-ctls are enabled). */ + if (SPA_ABS((int)pitch - (int)last_pitch) < 10) + snd_ctl_elem_value_set_integer(state->pitch_elem, 0, pitch); CHECK(snd_ctl_elem_write(state->ctl, state->pitch_elem), "snd_ctl_elem_write");