Open pfaion opened 4 years ago
pyuvc only defines these three values. It is an implementation of this spec. See Table 4-31
on page 95. My guess is that your webcam uses a newer UVC standard that is not supported by pyuvc.
Indeed it seems we implemented UVC 1.1 from 2005.
In 2012 they released UVC 1.5, which includes 3: 'Auto'
. Weirdly there seem to be no versions 1.2 to 1.4.
See this document, ctrl-f for Table 4-35
I feel like this might be something we should check against?
I had a quick look and it seems the USB specification includes an InterfaceProtocol
for all its interface classes (which UVC is an instance of).
Specifically, UVC 1.1 only has one valid value for this: PC_PROTOCOL_UNDEFINED
, see the UVC 1.1 spec.
UVC 1.5 additionally adds PC_PROTOCOL_15
as value, which seems to indicate that the device communicates over the UVC 1.5 spec. We would have to validate that. See the UVC 1.5 spec.
We can probably filter for the non-1.5 version in our custom libuvc fork: https://github.com/pupil-labs/libuvc/blob/master/src/device.c#L640-L643
/* Video, Streaming */
if (if_desc->bInterfaceClass == 14 && if_desc->bInterfaceSubClass == 2) {
got_interface = 1;
}
There is already some other filtering happening on the libusb_interface_descriptor
struct, which contains the uint8_t bInterfaceProtocol
member. I can give this a try at some point.
The question is, if we want to limit our libuvc fork to UVC 1.1 devices, or whether we want to expose this setting to the outside. The second option would require a change to pyuvc and Pupil as well in order to make it work.
I suggest adding support for that attribute in libuvc, and only accepting UVC 1.1 devices in pyuvc as it does not support later protocol versions. This way we do not need to adjust Pupil.
I enabled Manual Camera Selection and miss-clicked on my webcam instead of the Pupil cam. As a result the eye window crashed beyond recovery and only restarting Capture solved the issue.
See log
``` 2020-05-15 10:09:33,313 - eye1 - [DEBUG] uvc: Found device that mached uid:'1:5' 2020-05-15 10:09:33,423 - eye1 - [DEBUG] plugin: PluginThe error happens when drawing the UI for the UVC control Power Line frequency with: https://github.com/pupil-labs/pupil/blob/b3dda8cba54b2eff9503faa66e126bfce3c7b952/pupil_src/shared_modules/video_capture/uvc_backend.py#L808-L813
The debugger shows:
which obviously does not work. Not sure if this a bug in pyuvc?