Discussion:
unknown
1970-01-01 00:00:00 UTC
Permalink
[snip]
=20
Replace selection of alternate setting 0 with clearing of the endpoint
halt feature at video stream stop for bulk-based devices. Let's refrain=
from blaming Microsoft this time, as it's not clear whether this
Windows-specific but USB-compliant behaviour was specifically developed=
to handle bulkd-based UVC devices, or if the camera just took advantage=
of it.
=20
---
drivers/media/usb/uvc/uvc_video.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
=20
diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/=
uvc_video.c
index 103cd4e..29147fd 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -1850,7 +1850,19 @@ int uvc_video_enable(struct uvc_streaming *strea=
m, int enable)
=20
if (!enable) {
uvc_uninit_video(stream, 1);
- usb_set_interface(stream->dev->udev, stream->intfnum, 0);
+ if (stream->intf->num_altsetting > 1) {
+ usb_set_interface(stream->dev->udev,
+ stream->intfnum, 0);
+ } else {
+ /* UVC doesn't specify how to inform a bulk-based device
+ * when the video stream is stopped. Windows sends a
+ * CLEAR_FEATURE(HALT) request to the video streaming
+ * bulk endpoint, mimic the same behaviour.
+ */
+ usb_clear_halt(stream->dev->udev,
+ stream->header.bEndpointAddress);
+ }
+
uvc_queue_enable(&stream->queue, 0);
uvc_video_clock_cleanup(stream);
return 0;
=20
--=20
Regards,
Oleksij


--A5R6K99WVqJid11dqc1iHfxgHEeo9iOla
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iF4EAREIAAYFAlMFre8ACgkQHwImuRkmbWkyzwD9Fn9DuNnbkgcKTBD9Dlmx5jni
YBtZGz4AQiFI9vXm2pQA/0ltfUe6sb/wkOGhrxOaKZFgA3AwjXR4WVaebaQx6qCa
=qxHB
-----END PGP SIGNATURE-----

--A5R6K99WVqJid11dqc1iHfxgHEeo9iOla--

Loading...