Update for opicm5

This commit is contained in:
baiywt
2024-06-25 15:36:36 +08:00
parent 87992befbb
commit 52624375b8
11 changed files with 21891 additions and 20 deletions

View File

@@ -98,7 +98,30 @@ prepare_board() {
BOARDFAMILY=rk3399
;;
orangepi5|orangepicm5|orangepicm5-tablet|orangepi5b|orangepi5plus|orangepi5pro|orangepi5max|orangepitab|orangepi900)
[[ $BOARD =~ orangepi5|orangepi5b|orangepicm5 ]] && echo host > /sys/kernel/debug/usb/fc000000.usb/mode
[[ $BOARD =~ orangepi5|orangepi5b ]] && echo host > /sys/kernel/debug/usb/fc000000.usb/mode
if [[ $BOARD =~ orangepicm5 ]]; then
while true; do
echo "set host!"
echo host > /sys/kernel/debug/usb/fc000000.usb/mode
sleep 0.5
count=0
for i in {1..3}; do
sleep 0.5
echo "check"
if [[ "$(cat /sys/kernel/debug/usb/fc000000.usb/mode)" == "host" ]]; then
((count++))
else
break
fi
echo "check host $count"
done
[[ $count -eq 3 ]] && break
echo "fail"
done
fi
if [[ ${BOARD}x == orangepicm5-tabletx ]]; then
tinymix -D 2 aw87xxx_profile_switch_0 Music
@@ -108,9 +131,9 @@ prepare_board() {
if [[ ${BOARD}x == orangepicm5x ]]; then
declare -A led_map=(
["lan2"]="end|eth"
["lan1"]="enP3"
["wan"]="enP4"
["wan"]="end|eth"
["lan1"]="enP4"
["lan2"]="enP3"
)
for led in "${!led_map[@]}"; do

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -8,16 +8,18 @@ echo "Start MIPI CSI Camera Preview!"
export XDG_RUNTIME_DIR=/run/user/1000
patterns="rkisp0-vir0 rkisp0-vir1 rkisp0-vir2 rkisp1-vir0 rkisp1-vir1 rkisp1-vir2"
if [[ -c /dev/video51 ]]; then
gst-launch-1.0 v4l2src device=/dev/video33 io-mode=4 ! video/x-raw,format=NV12,width=720,height=576,framerate=15/1 ! xvimagesink > /dev/null 2>&1 &
gst-launch-1.0 v4l2src device=/dev/video42 io-mode=4 ! video/x-raw,format=NV12,width=720,height=576,framerate=15/1 ! xvimagesink > /dev/null 2>&1 &
gst-launch-1.0 v4l2src device=/dev/video51 io-mode=4 ! video/x-raw,format=NV12,width=720,height=576,framerate=15/1 ! xvimagesink > /dev/null 2>&1
elif [[ -c /dev/video31 ]]; then
gst-launch-1.0 v4l2src device=/dev/video22 io-mode=4 ! video/x-raw,format=NV12,width=720,height=576,framerate=15/1 ! xvimagesink > /dev/null 2>&1 &
gst-launch-1.0 v4l2src device=/dev/video31 io-mode=4 ! video/x-raw,format=NV12,width=720,height=576,framerate=15/1 ! xvimagesink > /dev/null 2>&1
elif [[ -c /dev/video11 ]]; then
gst-launch-1.0 v4l2src device=/dev/video11 io-mode=4 ! video/x-raw,format=NV12,width=720,height=576,framerate=15/1 ! xvimagesink > /dev/null 2>&1
else
echo "Can not find camera!!!"
fi
devices_info=$(v4l2-ctl --list-devices)
#devices_id=("/dev/video44" "/dev/video53" "/dev/video62" "/dev/video71")
for pattern in $patterns; do
devices_id+=("$(echo "$devices_info" | awk -v pattern="$pattern" '$0 ~ pattern {getline; print $NF}')")
done
for device_id in "${devices_id[@]}"; do
if [[ -c "$device_id" ]]; then
gst-launch-1.0 v4l2src device=$device_id io-mode=4 ! \
video/x-raw,format=NV12,width=720,height=576,framerate=15/1 ! xvimagesink > /dev/null 2>&1 &
fi
done