raspberrypi – Unable to get USB Host (Mac) to recognize USB UVC Peripheral (Raspberry Pi Zero 2 W)

I am trying to create a simulated webcam peripheral with a Raspberry Pi Zero 2 W. It is a similar use case as this post on askubuntu: Unable to get video via uvc_gadget to the host pc

Like the setup in the referenced question, I am also setting up a loopback video source, creating a USB device and then running the uvc-gadget and seeing it successfully initiated.

root@raspberrypi:~ # ./setup.sh
/dev/video0
Loading composite module
Detecting platform:
  board : Raspberry Pi Zero 2 W Rev 1.0
  udc   : 3f980000.usb
Creating the USB gadget
Creating gadget directory g1
OK
Setting Vendor and Product ID's
OK
Setting English strings
OK
Creating Config
Creating functions...
    Creating UVC gadget functionality : uvc.0
OK
Binding USB Device Controller
OK
root@raspberrypi:~ # v4l2-ctl --list-devices
3f980000.usb (gadget.0):
    /dev/video1

VirtualCam (platform:v4l2loopback-000):
    /dev/video0 

I am also using the uvc-gadget from here: github.com/wlhe/uvc-gadget

root@raspberrypi:~ # uvc-gadget2 -d /dev/video2 -u /dev/video1 -r 1 -f 1
uvc device is 3f980000.usb on bus gadget.0
uvc open succeeded, file descriptor = 3

but that is where is stops. No USB device is showing up on the host system and I don’t know why.

I have enabled peripheral mode in /boot/firmware/config.txt:

#[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

#[cm5]
#dtoverlay=dwc2,dr_mode=host

[all]
dtoverlay=dwc2,dr_mode=peripheral
dtparam=spi=on

I have confirmed that my USB cable is in the OTG port and that it is a data cable. I was able to get this device to be recognized as a USB ethernet adapter following a tutorial that use config.txt and cmdline.txt.

Any thoughts on where this going sideways?

Read more here: Source link