WarpKVM

Raspberry Pi

HDMI capture on a Raspberry Pi CM4 at 4K30 and 1080p120, or a Pi 4B at 1080p60, with the 22-pin RK628H adapter.

The 22-pin adapter plugs into a Raspberry Pi camera port. An install script builds the driver on the Pi against Raspberry Pi OS's kernel headers and installs a device tree overlay, so there is no kernel to build or flash.

Photo of the 22-pin adapter wired to a Raspberry Pi CM4 on a carrier board: HDMI into the adapter, a 22-pin ribbon into the camera connector

Which Pi

Raspberry Pi CM4Raspberry Pi 4B
PortCAM1, 4 lanes, 22-pinCamera port, 2 lanes, 15-pin
Cable22-pin, straight through22-pin to 15-pin camera adapter cable
3840x2160 @ 3030.00 fps, no errorsToo fast for 2 lanes
1920x1080 @ 120120.00 fps over 1200 frames, no errorsToo fast for 2 lanes
1920x1080 @ 6060.00 fps60.00 fps

Measured on Raspberry Pi OS Lite (64-bit, Debian 13) with kernel 6.18. The Pi 4B column comes from a CM4 limited to two lanes, which is the same chip and capture driver as a Pi 4B. Two lanes carry at most about 1800 Mbps each, and 1080p120 or 4K30 in YUV 4:2:2 need about 2400.

The Raspberry Pi 5 uses a different camera interface and is not supported yet.

Install

  1. Install Raspberry Pi OS Lite (64-bit). Power off and connect the bridge to the camera port: CAM1 on a CM4.
  2. Power on, then:
wget https://github.com/WarpKVM/rk628-bridge-boards/archive/refs/heads/main.tar.gz
tar xf main.tar.gz
cd rk628-bridge-boards-main/hosts/raspberry-pi-cm4
sudo sh install.sh
sudo reboot
  1. After the reboot, check it:
sh ../rk628-check.sh

install.sh builds and installs the driver, installs the overlay, turns off camera_auto_detect, and adds one dtoverlay=rk628 line to /boot/firmware/config.txt, keeping a backup next to it. If the build stops on missing headers, run sudo apt install linux-headers-rpi-v8 first. Undo with sudo sh uninstall.sh.

Options

Arguments to install.sh are added to the overlay line:

OptionUse it when
2laneTwo-lane port: Pi 4B, or CM4 CAM0. Tops out at 1080p60
int_gpio=<n>Your carrier wires connector pin 18 to SoC GPIO n. On the WarpKVM CM4 carrier this is int_gpio=26. Without it the driver polls once a second
reset_gpio=<n>Your carrier wires pin 17 to SoC GPIO n instead of the camera power line
cam0The bridge is on CAM0 instead of CAM1 (use with 2lane)

For example, a Pi 4B: sudo sh install.sh 2lane.

Good to know

  • Frames come out as UYVY, not NV12. rk628-check.sh 30 frames.uyvy saves 30 of them.
  • Pin 17 is the bridge's reset. On a Pi camera connector it is the camera power enable, which the CM4 device tree gives to a camera power regulator. That regulator holds the pin low and keeps the bridge in reset, so the overlay turns it off.
  • Change mode by loading an EDID. The source follows within a few seconds:
wget https://raw.githubusercontent.com/WarpKVM/rk628-bridge-boards/main/hosts/edid/1080p120.hex
v4l2-ctl -d /dev/v4l-subdev0 --set-edid=pad=0,file=1080p120.hex,format=hex
  • If a mode is too fast for the link, rk628-check.sh stops after a few seconds and says so instead of hanging.

HDMI audio over I2S on the Pi is not tested yet.

On this page