Root privilege: the UVC gadget is created through the Linux USB gadget ConfigFS (/sys/kernel/config/usb_gadget) and kernel modules. The first time (and after a reboot, when the gadget does not exist yet) the setup cannot be done, or finds a half-done state, unless the application runs as root. Start the application with root privilege (sudo), the same as for the FTDI serial driver.

1. First checks

  1. Run the recovery script as root: sudo ./recover_uvc_gadget.sh (in the driver folder interfaces/Drivers/UVCGadget). It checks the kernel modules, the config.txt overlay, the UDC and a stale gadget and changes nothing. --fix repairs what can be repaired, --ftdi also releases FTDI interfaces from ftdi_sio.
  2. Read the driver start-up report: it lists the gadgets and functions found (for example uvc.usb0) with their formats, frame sizes and frame rates.
  3. The USB cable must go from the board's USB-C device (gadget) port to a host. The gadget is bound to the first UDC.

2. Message reference

MessageCauseWhat to do
UVCGadgetDeviceDriver: Failed to load UVCGadgetDeviceAPIThe API shared library is missing or built for another architecture (arm64 vs x86).Build the API library for the board and keep it next to the executable.
Stream '<name>' failed to list avaliable USB gadgets ... / ConfigFS USB Gadget path not found. Is the 'libcomposite' module loaded?ConfigFS or the libcomposite kernel module is not available.As root: modprobe libcomposite usb_f_uvc (or run the recovery script with --fix).
Stream '<name>' No avaliable USB gadgets.No gadget exists yet (first run after boot), or it could not be listed without root.Start the application as root; the driver creates the gadget during init.
CUVCGadgetDriver: missing function name, should be like 'uvc.usb0'functionName is missing from the driver section.Add "functionName": "uvc.usb0".
CUVCGadgetDriver: function '<name>' not found in device should be like 'uvc.usb0'The function name is not among the gadgets that were listed.Use a name from the start-up list.
UVCGadgetDeviceDriver: Failed to init UVC Gadget. Failed to parse ConfigFS for <function>The gadget is not bound or its setup failed. When a reason is known the message ends with (gadget setup failed: ...) – read that text first.Fix the reason in brackets; run the recovery script.
Reason: cannot create symlink: File existsA stale, half-built uvc_gadget was left in ConfigFS by an earlier run.Run sudo ./recover_uvc_gadget.sh --fix (tears down the stale gadget), then start again.
Reason: No UDC found/sys/class/udc is empty: the USB controller is not in peripheral mode, or the USB-C cable is not connected.On a Raspberry Pi 5 add dtoverlay=dwc2,dr_mode=peripheral under [pi5] or [all] in /boot/firmware/config.txt (a line under [cm5] is ignored on a Pi 5) and reboot.
Reason: modprobe ... Operation not permittedThe application is not running as root.Start the application with sudo.

3. Other problems

SymptomCauseFix
Host shows "unrecognized device" or nothing in Device ManagerThe gadget is not bound to the UDC (see above) or the cable is charge-only.Run the recovery script; use a data cable.
Works once, fails on the second startStale gadget left in ConfigFS.Recovery script --fix.
Video only at a low resolution or frame rateThe Pi 5's USB controller (dwc2) is USB 2.0 only (high-speed ceiling); the negotiated speed is printed when the host starts streaming.Choose a format, size and fps from the printed list; use MJPEG instead of uncompressed YUYV for larger frames.
Host picks a format the driver does not provideformat, width, height or fps not in the gadget's list.Use values from the start-up list.

4. UVCGadgetAPI3 (USB 3 boards, Rock 5B)

Rock 5B kernel (6.1.43-rk2312): unbinding a UVC gadget while no program has its video node open hangs the kernel (the writing process cannot be killed, a normal reboot hangs: power cycle). Both API libraries and setup.rock5/rock5_camera_gadget.sh stop unbind safely (the video node is held during the unbind), and a second run of the same program reuses the gadget instead of unbinding it (since 2026-10-19 also UVCGadgetDeviceAPI; before, starting the program a second time hung it). Do not use echo "" > UDC or recover_uvc_gadget.sh --fix on a bound gadget there.
Message / symptomCauseWhat to do
Stream '<name>' driver section: ...A key of the driver section has the wrong type or an unknown name (format, control).See the UVC Gadget Driver keys.
gadget configuration rejected by UVCGadgetAPI3: ...Values out of range: fps 1..240, even width, each format / size once, maxPacket 1..3072, maxBurst 0..15, control default outside its range. All problems are listed.Fix the listed values.
key '...' ignored by UVCGadgetDeviceAPIformats / controls / ... given to the Pi 5 library, which builds a fixed gadget.Add "interfaceAPILib": "UVCGadgetAPI3".
the kernel does not allow setting the advertised controls (bmControls is read-only ...)Stock kernel: the PC sees only auto exposure mode + brightness.Rock 5B: install the patched usb_f_uvc (setup.rock5/usb_f_uvc-dma32/build_usb_f_uvc_dma32.sh install).
UDC ... is used by gadget '...'Another gadget (for example the camera script's or the Pi 5 library's with another name) holds the USB port.sudo rock5_camera_gadget.sh stop (gadget uvc_gadget), or remove the other gadget safely.
... its UVC video node was not found: not unbindingSafety stop: the library cannot hold the node, so it refuses an unbind that could hang the kernel.Reboot (the gadget is gone after a reboot).
PC sees the camera but no frames, board log swiotlb buffer is fullRock 5B: the USB controller reaches only the first 4 GB of RAM.Patched usb_f_uvc (frame buffers below 4 GB), or "zeroCopy": true (YUYV only).
The program hangs when started a second time (no output after the keyboard commands, cannot be killed; board log only uvc_function_unbind)Before 2026-10-19 UVCGadgetDeviceAPI rebuilt the gadget at every start: it unbound the existing gadget without holding its video node, and the Rock 5B kernel hangs on that (the process waits in usb_gadget_activate).Rebuild the API libraries: a gadget with the same configuration is now reused, any other one is unbound safely. A hung board needs a reboot (it can take minutes; power cycle if it does not come back).
ffplay / ffmpeg: No JPEG data found in imageThe frames are not MJPEG. Two causes: (1) ffplay: -vcodec mjpeg only chooses the decoder, it does not ask the camera for MJPEG, so ffplay gets the camera's FIRST format (e.g. YU12) and decodes it as JPEG. (2) The model does not send the format / size the PC asked for (UVCGadgetDeviceAPI offers YUYV and MJPEG at 6 sizes whatever the model can send).(1) List mjpeg first in formats, or use ffmpeg (there -vcodec mjpeg before -i does select MJPEG): ffmpeg -f dshow -video_size 640x512 -framerate 30 -vcodec mjpeg -i video="UVC Camera" -c copy -f mjpeg - | ffplay -f mjpeg -. (2) Use UVCGadgetAPI3 with a formats list of what the model sends (ffmpeg -list_options true -f dshow -i video="UVC Camera" shows the offer). The model must check GetNegotiatedFormat() and GetNegotiatedSize(w, h) and send that format at that size.
Picture purple / green but the shapes are rightThe model sends bytes that are not YUYV as YUYV, for example 16-bit grey frames (2 bytes per pixel like YUYV, so the size fits).Convert the frames: BlackKite's FCSwitch turns 16-bit grey (high byte = luma, chroma 128) into YU12 / YUYV / MJPEG once at init.
YU12 picture green / striped / wrong coloursThe PC chose YU12 (planar 4:2:0) but the model still writes YUYV bytes.In the frame callback check GetNegotiatedFormat() == EFormat::YU12 and write the Y, U, V planes (w×h×1.5 bytes).
Lower frame rate than asked (e.g. 1280x720 YU12 at 20 fps gives ~17)USB 2 link: the endpoint carries at most 24.5 MB/s (maxPacket 3072); the start-of-stream report prints LIMITED.Smaller size, MJPEG, or a USB 3 link with maxBurst.
Camera name on the PC does not changeWindows keeps the name it saw first for the same USB id and serial number.Change productId or serialNumber, or uninstall the device in Device Manager.
Board resets during heavy work, or disappears after 15 minutesPower through the PC's USB-C port without a PD contract is not enough under load; KDE suspends the board when idle.Separate power supply; sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target.

5. UVCGadgetGigEAPI (GigE Vision camera on the network)

The start report names the interface, address, MAC, MTU, formats and sizes. See GigE Vision camera.

Symptom / messageCauseFix
gadget configuration rejected by UVCGadgetGigEAPI: format MJPEG is not a GigE Vision format hereThe GigE camera offers mono8, mono16, yuyv and rgb only.Use those in formats; keep MJPEG / YU12 for the USB camera.
GVCP port 3956: bind ... (another GigE camera emulator or GigE Vision device software running?)Another program (a second emulator stream, another simD instance, a camera simulator) holds UDP 3956.One GigE camera per computer: stop the other program.
network interface '...' not found or not up (interfaces: ...)networkInterface does not match an interface that is up; the message lists them.Use a listed name or address, or "".
The client does not find the cameraNot in the same subnet as the client, a firewall drops UDP 3956 on the board, or the stream is not set up yet (the camera exists from SetupCamera() on).Board and PC in one subnet (e.g. 10.0.0.15/24 and 10.0.0.9/24); open UDP 3956; check the start report. GenICam driver: "cameraName": "?" lists what the producer sees. A client opens it by its user name (DeviceUserID, start value cameraName); a tool that writes DeviceUserID renames it until the program restarts.
Found and opened, but no frames (status acquisition started, frames counting on the board)The PC firewall drops the image packets (they come from the board, not as an answer).GenTL producers send a packet to the camera first (firewall traversal) or install firewall rules; for an own client allow the program in the Windows firewall.
Status no frame counts up, nothing is sentThe model gives no frames: no callback set, or it returns 0 (e.g. a size other than 640x512 on Windows, where BlackKite cannot scale).Set the callback before the client starts; use the native size on Windows.
Incomplete frames / late counts upMore data than the link or the receiver takes: e.g. 1280x1024 RGB8 at 60 fps = 236 MB/s on 1 Gbit/s.Smaller size, Mono8, lower AcquisitionFrameRate, or GevSCPD / packetDelayNs for a slow receiver.
Through the Balluff producer a white box with the Balluff logo appears in the picture after ~200 frames (about 6.6 s at 30 fps)Balluff mvGenTLProducer draws it into the images: "You are either using an unsupported third party device or an unsupported third party GenTL producer and your free evaluation period has ended". The camera sends clean frames (received without the producer, tests/gigeclient, they are byte-identical to the video files).A Balluff licence for third-party devices, or another GenTL producer (apiOptions.producer).
The client loses the camera after a pause in the debuggerHeartbeat: no command within GevHeartbeatTimeout (default 3 s) releases the camera and stops the acquisition.Raise heartbeatTimeoutMs (or the client's GevHeartbeatTimeout) while debugging.