Live data from Hacker News

Driver adventures for a 1999 webcam

blog.benjojo.co.uk

21–30 of 78 posts

Re: Driver adventures for a 1999 webcam

#22
post #12

Reminds me when I had to read barcodes from a USB-connected barcode scanner on a Mac. The manufacturer supplied a closed-source library which only supported PPC code and they told me that they lost the source code, so I couldn't easily add intel support. In the end I sniffed the USB protocol of the windows driver and was delighted to see how they abused the control endpoint rather than setting up proper data endpoint…

> In the end I sniffed the USB protocol of the windows driver and was delighted to see how they abused the control endpoint rather than setting up proper data endpoints. Is there a better way to implement this? They seem to use it for any non-standard feature. My laptop's keyboard uses the control endpoint to control the LEDs.

you're supposed to use the control endpoint to negotiate which data endpoints to set up in what way for communication and then communicate over those.

In the case of this barcode scanner all communication was done over the control endpoint though.

Re: Driver adventures for a 1999 webcam

#23
>This means that all attempts to get data from it using the first USB interface would fail. Now you might ask, why does the webcam have an endpoint with a 0 byte MaxPacketSize on its first interface? Who knows!

Paper cuts like this is why the Linux Desktop isn't mainstream.

Re: Driver adventures for a 1999 webcam

#24
I did something very similar quite recently with an old Mustek DV3000 camera that had webcam functionality. I was shocked to find out that Linux actually supports it out of the box. The quality is trash so it's not really usable, but fun messing around with it nonetheless.

Re: Driver adventures for a 1999 webcam

#26

>This means that all attempts to get data from it using the first USB interface would fail. Now you might ask, why does the webcam have an endpoint with a 0 byte MaxPacketSize on its first interface? Who knows! Paper cuts like this is why the Linux Desktop isn't mainstream.

I am not sure I fully understand what you mean by your remark, but I am positive that this is not a situation most “mainstream desktop users” are ever going to encounter.

Re: Driver adventures for a 1999 webcam

#27

I did something very similar quite recently with an old Mustek DV3000 camera that had webcam functionality. I was shocked to find out that Linux actually supports it out of the box. The quality is trash so it's not really usable, but fun messing around with it nonetheless.

Linux support for old hardware is absolutely amazing. No matter how arcane or weird your gizmo is chances are someone wrote a driver for it that is still in support. This is one of those ways in which the open source world is way ahead of closed source, where you're sore out of luck even for relatively modern stuff (for instance: Firewire cards).

Re: Driver adventures for a 1999 webcam

#28
post #26

>This means that all attempts to get data from it using the first USB interface would fail. Now you might ask, why does the webcam have an endpoint with a 0 byte MaxPacketSize on its first interface? Who knows! Paper cuts like this is why the Linux Desktop isn't mainstream.

I am not sure I fully understand what you mean by your remark, but I am positive that this is not a situation most “mainstream desktop users” are ever going to encounter.

Yeah, I mean there are a lot of reasons why linux desktop isn't going mainstream anytime soon, but this is certainly not one of them.

Re: Driver adventures for a 1999 webcam

#29
This is pretty cool and impressive work! In a pleasant turn of events, "USB video device class" or UVC would have its initial release just 4 years later in 2003. Webcams implementing UVC, which most do since the early 2000s, communicate using a standard protocol which means almost any OS can access almost any webcam without any special drivers or software.

I have an 2012 Logitech webcam connected to an OpenBSD box. A cron job instructs ffmpeg to read from /dev/video0 every 10 minutes, which in turn writes a .jpg into a folder for creating a timelapse. Not bad for a random old webcam I had laying around.

https://en.wikipedia.org/wiki/USB_video_device_class

Re: Driver adventures for a 1999 webcam

#30

>This means that all attempts to get data from it using the first USB interface would fail. Now you might ask, why does the webcam have an endpoint with a 0 byte MaxPacketSize on its first interface? Who knows! Paper cuts like this is why the Linux Desktop isn't mainstream.

Is..is it not the webcam that's reporting the endpoint? Not Linux?
Post reply on HN