mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
ALSA: usb: use multiple packets per urb for Wireless USB inbound audio
For Wireless USB audio devices, use multiple isoc packets per URB for inbound endpoints with a datainterval < 5. This allows the WUSB host controller to take advantage of bursting to service endpoints whose logical polling interval is less than the 4ms minimum polling interval limit in WUSB. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
2fd3f170e5
commit
a93455e1c3
1 changed files with 15 additions and 1 deletions
|
@ -636,8 +636,22 @@ static int data_ep_set_params(struct snd_usb_endpoint *ep,
|
||||||
if (usb_pipein(ep->pipe) ||
|
if (usb_pipein(ep->pipe) ||
|
||||||
snd_usb_endpoint_implicit_feedback_sink(ep)) {
|
snd_usb_endpoint_implicit_feedback_sink(ep)) {
|
||||||
|
|
||||||
|
urb_packs = packs_per_ms;
|
||||||
|
/*
|
||||||
|
* Wireless devices can poll at a max rate of once per 4ms.
|
||||||
|
* For dataintervals less than 5, increase the packet count to
|
||||||
|
* allow the host controller to use bursting to fill in the
|
||||||
|
* gaps.
|
||||||
|
*/
|
||||||
|
if (snd_usb_get_speed(ep->chip->dev) == USB_SPEED_WIRELESS) {
|
||||||
|
int interval = ep->datainterval;
|
||||||
|
while (interval < 5) {
|
||||||
|
urb_packs <<= 1;
|
||||||
|
++interval;
|
||||||
|
}
|
||||||
|
}
|
||||||
/* make capture URBs <= 1 ms and smaller than a period */
|
/* make capture URBs <= 1 ms and smaller than a period */
|
||||||
urb_packs = min(max_packs_per_urb, packs_per_ms);
|
urb_packs = min(max_packs_per_urb, urb_packs);
|
||||||
while (urb_packs > 1 && urb_packs * maxsize >= period_bytes)
|
while (urb_packs > 1 && urb_packs * maxsize >= period_bytes)
|
||||||
urb_packs >>= 1;
|
urb_packs >>= 1;
|
||||||
ep->nurbs = MAX_URBS;
|
ep->nurbs = MAX_URBS;
|
||||||
|
|
Loading…
Reference in a new issue