Commit 2d39059a authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

[media] gspca - main: Avoid clobbering all bandwidth when mic in webcam

Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarJean-François Moine <moinejf@free.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 5dae603d
...@@ -726,6 +726,23 @@ static int build_isoc_ep_tb(struct gspca_dev *gspca_dev, ...@@ -726,6 +726,23 @@ static int build_isoc_ep_tb(struct gspca_dev *gspca_dev,
ep_tb++; ep_tb++;
} }
/*
* If the camera:
* has a usb audio class interface (a built in usb mic); and
* is a usb 1 full speed device; and
* uses the max full speed iso bandwidth; and
* and has more than 1 alt setting
* then skip the highest alt setting to spare bandwidth for the mic
*/
if (gspca_dev->audio &&
gspca_dev->dev->speed == USB_SPEED_FULL &&
last_bw >= 1000000 &&
i > 1) {
PDEBUG(D_STREAM, "dev has usb audio, skipping highest alt");
i--;
ep_tb--;
}
/* get the requested bandwidth and start at the highest atlsetting */ /* get the requested bandwidth and start at the highest atlsetting */
bandwidth = which_bandwidth(gspca_dev); bandwidth = which_bandwidth(gspca_dev);
ep_tb--; ep_tb--;
......
Markdown is supported
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