first commit

This commit is contained in:
Your Name
2026-02-07 20:22:48 +08:00
commit 1b9711d5e4
2270 changed files with 805872 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#!/bin/bash
trap 'onCtrlC' INT
function onCtrlC () {
echo 'Ctrl+C is captured'
killall gst-launch-1.0
exit 0
}
device_id=$(v4l2-ctl --list-devices | grep -A1 hdmirx | grep -v hdmirx | awk -F ' ' '{print $NF}')
v4l2-ctl -d $device_id --set-dv-bt-timings query 2>&1 > /dev/null
width=$(v4l2-ctl -d $device_id --get-dv-timings | grep "Active width" |awk -F ' ' '{print $NF}')
heigh=$(v4l2-ctl -d $device_id --get-dv-timings | grep "Active heigh" |awk -F ' ' '{print $NF}')
es8388_card=$(aplay -l | grep "es8388" | cut -d ':' -f 1 | cut -d ' ' -f 2)
hdmi0_card=$(aplay -l | grep "hdmi0" | cut -d ':' -f 1 | cut -d ' ' -f 2)
hdmi1_card=$(aplay -l | grep "hdmi1" | cut -d ':' -f 1 | cut -d ' ' -f 2)
hdmiin_card=$(arecord -l | grep "hdmiin" | cut -d ":" -f 1 | cut -d ' ' -f 2)
gst-launch-1.0 -e v4l2src device=$device_id ! videoconvert ! video/x-raw,format=NV12,width=${width},height=${heigh} ! mpph265enc ! h265parse ! queue ! mpegtsmux ! filesink location="/home/orangepi/hdmiin_video_$(date +"%Y%m%d_%H%M%S").ts"
while true
do
sleep 10
done

View File

@@ -0,0 +1,25 @@
#!/bin/bash
echo 0 > /sys/devices/platform/fd8b0030.pwm/pwm/pwmchip*/export
echo 10000 > /sys/devices/platform/fd8b0030.pwm/pwm/pwmchip*/pwm0/period
echo 8000 > /sys/devices/platform/fd8b0030.pwm/pwm/pwmchip*/pwm0/duty_cycle
echo normal > /sys/devices/platform/fd8b0030.pwm/pwm/pwmchip*/pwm0/polarity
echo 1 > /sys/devices/platform/fd8b0030.pwm/pwm/pwmchip*/pwm0/enable
sleep 3
while true
do
a=$(cat /sys/class/thermal/thermal_zone0/temp)
time=$(date)
pwm=$(echo ${a} | awk '{printf("%d",$1*0.15-800)}')
if (( $pwm > 8500 ))
then
pwm=8500
elif (( $pwm < 5000 ))
then
pwm=5000
fi
echo ${pwm} > /sys/devices/platform/fd8b0030.pwm/pwm/pwmchip*/pwm0/duty_cycle
echo [${time}] Thermal value: ${a}, write fan PWM cycle ${pwm}
sleep 5
done

View File

@@ -0,0 +1,48 @@
#!/bin/bash
trap 'onCtrlC' INT
function onCtrlC () {
echo 'Ctrl+C is captured'
killall gst-launch-1.0
exit 0
}
source /etc/orangepi-release
device_id=$(v4l2-ctl --list-devices | grep -A1 hdmirx | grep -v hdmirx | awk -F ' ' '{print $NF}')
v4l2-ctl -d $device_id --set-dv-bt-timings query 2>&1 > /dev/null
width=$(v4l2-ctl -d $device_id --get-dv-timings | grep "Active width" |awk -F ' ' '{print $NF}')
heigh=$(v4l2-ctl -d $device_id --get-dv-timings | grep "Active heigh" |awk -F ' ' '{print $NF}')
es8388_card=$(aplay -l | grep "es8388" | cut -d ':' -f 1 | cut -d ' ' -f 2)
hdmi0_card=$(aplay -l | grep "hdmi0" | cut -d ':' -f 1 | cut -d ' ' -f 2)
hdmi1_card=$(aplay -l | grep "hdmi1" | cut -d ':' -f 1 | cut -d ' ' -f 2)
hdmiin_card=$(arecord -l | grep "hdmiin" | cut -d ":" -f 1 | cut -d ' ' -f 2)
if [[ $XDG_SESSION_TYPE == wayland ]]; then
DISPLAY=:0.0 gst-launch-1.0 v4l2src device=${device_id} ! videoconvert \
! videoscale ! video/x-raw,width=1280,height=720 \
! waylandsink sync=false 2>&1 > /dev/null &
else
DISPLAY=:0.0 gst-launch-1.0 v4l2src device=${device_id} io-mode=4 ! videoconvert \
! video/x-raw,format=NV12,width=${width},height=${heigh} \
! videoscale ! video/x-raw,width=1280,height=720 \
! autovideosink sync=false 2>&1 > /dev/null &
fi
if [[ ${BOARD} == orangepi5ultra ]]; then
gst-launch-1.0 alsasrc device=hw:${hdmiin_card},0 ! audioconvert ! audioresample ! queue \
! tee name=t ! queue ! alsasink device="hw:${hdmi1_card},0" \
t. ! queue ! alsasink device="hw:${es8388_card},0" &
else
gst-launch-1.0 alsasrc device=hw:${hdmiin_card},0 ! audioconvert ! audioresample ! queue \
! tee name=t ! queue ! alsasink device="hw:${hdmi0_card},0" \
t. ! queue ! alsasink device="hw:${hdmi1_card},0" \
t. ! queue ! alsasink device="hw:${es8388_card},0" &
fi
while true
do
sleep 10
done

View File

@@ -0,0 +1,11 @@
[Unit]
Description=PWM-Fan-Simple-Control
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/pwm-fan
Restart=always
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,23 @@
# Usecase for device HDMI1/Display Port stereo playback on rockchip platforms
# For Audio in I2S mode
SectionDevice."HDMI1" {
Comment "HDMI"
Value {
PlaybackPriority 400
PlaybackPCM "hw:${CardId}"
If.1 {
Condition {
Type ControlExists
Control "iface=CARD,name='rockchip-hdmi1 Jack'"
}
True {
#JackControl "rockchip-hdmi1 Jack"
}
False {
#JackControl "rockchip-hdmi1 Jack"
}
}
}
}

View File

@@ -0,0 +1,8 @@
Syntax 2
Comment "Rockchip HDMI card"
SectionUseCase."HDMI" {
File "Hdmi.conf"
Comment "HDMI"
}