I am experimenting with whether or not I can turn the OAK-D CM4 into a UVC Class Device using the USB 2.0 micro port on the OAK-D CM4.
With guidance from https://docs.luxonis.com/en/latest/pages/oak_webcam/ I Installed v4l2loopback and pyvirtualcamera and I'm able to get frames sent out to the v4l2 virtual interface /dev/video0
. Confirmed that they are the correct frames from my camera module.
I disabled the host mode in the the /boot/config.txt and made sure the legacy dwc2 controller is enabled
``
[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
#otg_mode=1
#dtoverlay=dwc2,dr_mode=host
dtoverlay=dwc2
```
Then I making sure to load the necessary modules in cmdline.txt
modules-load=dwc2,libcomposite,v4l2loopback
But after I place the plug a microUSB cable from the microUSB port of the OAK-D CM4 into a computer, the camera hard faults.
Traceback (most recent call last):
…
in_video = self.q_video.get()
^^^^^^^^^^^^^^^^^^
RuntimeError: Communication exception - possible device error/misconfiguration. Original message 'Couldn't read data from stream: 'cam_out' (X_LINK_ERROR)'
And afterwards (while the microUSB is plugged into the host computer) I cannot get the camera modules to reappear
Traceback (most recent call last):
…
self.device = dai.Device()
^^^^^^^^^^^^
RuntimeError: No available devices
Can I get some feedback on whether or not my approach for UVC using the OAK-D CM4 is feasible?