-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_ov7251.sh
More file actions
executable file
·22 lines (15 loc) · 897 Bytes
/
Copy pathsetup_ov7251.sh
File metadata and controls
executable file
·22 lines (15 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# Real Hardware Setup for OV7251 on Surface Pro 5
# This script detects IDs dynamically to avoid errors.
MDEV="/dev/media0"
# Find Entities
OV_ID=$(media-ctl -d $MDEV -p | grep "entity" | grep "ov7251" | awk '{print $3}' | tr -d ':')
CSI_ID=$(media-ctl -d $MDEV -p | grep "entity" | grep "ipu3-csi2 0" | awk '{print $3}' | tr -d ':')
echo "Linking OV7251 ($OV_ID) to CSI2 ($CSI_ID) on $MDEV..."
media-ctl -d $MDEV -l "$OV_ID:0 -> $CSI_ID:0[1]"
echo "Setting formats to 640x480 SBGGR10_1X10..."
# Identify subdevs dynamically if possible, or use the labels directly with quotes
media-ctl -d $MDEV --set-v4l2 "'ov7251 3-0060':0 [fmt:SBGGR10_1X10/640x480]"
media-ctl -d $MDEV --set-v4l2 "'ipu3-csi2 0':0 [fmt:SBGGR10_1X10/640x480]"
media-ctl -d $MDEV --set-v4l2 "'ipu3-csi2 0':1 [fmt:SBGGR10_1X10/640x480]"
echo "Setup complete. Start the ISP with: ./target/debug/surface-IR-rust"