Commit 695cf5ab authored by Alexander Tsoy's avatar Alexander Tsoy Committed by Takashi Iwai
Browse files

ALSA: usb-audio: Fix packet size calculation

Commit f0bd62b6 ("ALSA: usb-audio: Improve frames size computation")
introduced a regression for devices which have playback endpoints with
bInterval > 1. Fix this by taking ep->datainterval into account.

Note that frame and fps are actually mean packet and packets per second
in the code introduces by the mentioned commit. This will be fixed in a
follow-up patch.

Fixes: f0bd62b6 ("ALSA: usb-audio: Improve frames size computation")
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208353


Signed-off-by: default avatarAlexander Tsoy <alexander@tsoy.me>
Link: https://lore.kernel.org/r/20200629025934.154288-1-alexander@tsoy.me


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 6a6ca788
...@@ -1093,6 +1093,7 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep, ...@@ -1093,6 +1093,7 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep,
ep->freqn = get_usb_high_speed_rate(rate); ep->freqn = get_usb_high_speed_rate(rate);
ep->fps = 8000; ep->fps = 8000;
} }
ep->fps >>= ep->datainterval;
ep->sample_rem = rate % ep->fps; ep->sample_rem = rate % ep->fps;
ep->framesize[0] = rate / ep->fps; ep->framesize[0] = rate / ep->fps;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment