-
-
Notifications
You must be signed in to change notification settings - Fork 309
Getting Cameras Working on Surface Pro 5 (Debian 13 / Trixie) #2045
Description
Getting Cameras Working on Surface Pro 5 (Debian 13 / Trixie)
Hardware: Microsoft Surface Pro 5 (2017)
OS: Debian 13 (Trixie)
Kernel: 6.18.7-surface-1
Result
✅ Front camera (OV5693) — fully working
❌ Rear camera (OV8865) — detected but green image (ISP tuning file missing)
Steps Taken
- Install linux-surface kernel
The stock Debian kernel has poor Surface hardware support. Install the patched kernel from the linux-surface project:
bashwget -qO - https://raw.githubusercontent.com/linux-surface/linux-surface/master/pkg/keys/surface.asc
| gpg --dearmor | sudo dd of=/etc/apt/trusted.gpg.d/linux-surface.gpg
echo "deb [arch=amd64] https://pkg.surfacelinux.com/debian release main"
| sudo tee /etc/apt/sources.list.d/linux-surface.list
sudo apt update
sudo apt install linux-image-surface linux-headers-surface libwacom-surface
sudo reboot
-
Install IPU3 firmware
bashsudo apt install firmware-misc-nonfree
sudo cp /lib/firmware/intel/irci_irci_ecr-master_20161208_0213_20170112_1500.bin
/lib/firmware/intel/ipu3-fw.bin -
Install libcamera and tools
bashsudo apt install libcamera-tools libcamera-ipa gstreamer1.0-libcamera
gstreamer1.0-tools gstreamer1.0-plugins-base gstreamer1.0-plugins-good
v4l-utils -
Verify both cameras are detected
bashcam --list
Expected output:
1: Internal back camera (_SB_.PCI0.I2C3.CAMR)
2: Internal front camera (_SB_.PCI0.I2C2.CAMF)
-
Install and build v4l2loopback from source
The Debian package v4l2loopback-dkms 0.15.0 is incompatible with kernel 6.18.7-surface-1 due to changed V4L2 API signatures (v4l2_fh_add, v4l2_fh_del, removed setup_timer). Build from source instead:
bashsudo apt remove v4l2loopback-dkms
sudo apt install git dkms build-essential
git clone https://github.com/umlaeute/v4l2loopback.git
cd v4l2loopback
sudo make && sudo make install
sudo depmod -a -
Sign the module for Secure Boot
Secure Boot is enabled on Surface Pro 5 by default. The module must be signed:
bashsudo apt install kmod openssl
Create signing key
openssl req -new -x509 -newkey rsa:2048 -keyout ~/mok.key
-out ~/mok.crt -days 3650 -subj "/CN=v4l2loopback/" -nodes
Convert to DER format
openssl x509 -in ~/mok.crt -outform DER -out ~/mok.der
Sign the module
sudo /usr/src/linux-headers-6.18.7-surface-1/scripts/sign-file
sha256 ~/mok.key ~/mok.crt
/lib/modules/6.18.7-surface-1/updates/v4l2loopback.ko
Enroll the key
sudo mokutil --import ~/mok.der
sudo reboot
On reboot, follow the blue MOK Manager screen: Enroll MOK → Continue → Yes → enter password → Reboot.
- Load v4l2loopback with virtual devices
bashecho "options v4l2loopback devices=2 video_nr=20,21 card_label="Back Camera","Front Camera" exclusive_caps=1" |
sudo tee /etc/modprobe.d/v4l2loopback.conf
echo "v4l2loopback" | sudo tee /etc/modules-load.d/v4l2loopback.conf
sudo modprobe v4l2loopback
- PipeWire sees both cameras natively
No GStreamer loopback pipeline needed — PipeWire detects both cameras automatically via libcamera:
bashwpctl status
You should see ov5693 (front) and ov8865 (rear) listed under Video Devices.
For Firefox, enable PipeWire camera support:
Go to about:config
Set media.webrtc.camera.allow-pipewire to true
Restart Firefox
Known Issue — Rear Camera Green Image
The rear camera (OV8865) produces a green image in all applications. This is a known upstream issue — the ov8865.yaml ISP tuning/calibration file does not exist for the Surface Pro 5's specific hardware implementation. Without it, libcamera runs in uncalibrated mode and cannot correctly process the Bayer sensor output.
This is not a configuration problem — it requires ISP tuning work by the linux-surface or libcamera community.
Tracking: https://github.com/linux-surface/linux-surface/wiki/Camera-Support
Tested March 2026. Kernel 6.18.7-surface-1. Debian 13 Trixie.