Support Orange Pi 5 Ultra

This commit is contained in:
leeboby
2024-07-19 10:47:52 +08:00
parent b4268718f0
commit 50eeb374fe
7 changed files with 49 additions and 11 deletions

View File

@@ -97,7 +97,7 @@ prepare_board() {
rockpro64|renegade-elite|pinebook-pro|station-p1)
BOARDFAMILY=rk3399
;;
orangepi5|orangepicm5|orangepicm5-tablet|orangepi5b|orangepi5plus|orangepi5pro|orangepi5max|orangepitab|orangepi900)
orangepi5|orangepicm5|orangepicm5-tablet|orangepi5b|orangepi5plus|orangepi5pro|orangepi5max|orangepi5ultra|orangepitab|orangepi900)
[[ $BOARD =~ orangepi5|orangepi5b ]] && echo host > /sys/kernel/debug/usb/fc000000.usb/mode
if [[ $BOARD =~ orangepicm5 ]]; then
while true; do
@@ -204,7 +204,7 @@ prepare_board() {
brcm_patchram_plus --bd_addr_rand --enable_hci --no2bytes --use_baudrate_for_download --tosleep 200000 \
--baudrate 1500000 --patchram /lib/firmware/BCM4345C0.hcd /dev/ttyS9 &
elif [[ $BOARD =~ orangepi5max ]]; then
elif [[ $BOARD =~ orangepi5max|orangepi5ultra ]]; then
rfkill unblock all
brcm_patchram_plus --bd_addr_rand --enable_hci --no2bytes --use_baudrate_for_download --tosleep 200000 \

View File

@@ -7,6 +7,8 @@ function onCtrlC () {
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}')
@@ -29,10 +31,16 @@ else
fi
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" &
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

View File

@@ -11,6 +11,9 @@ source /etc/orangepi-release
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)
if [[ ${BOARD} == orangepi5ultra ]]; then
hdmi1_card=$(aplay -l | grep "hdmi1" | cut -d ':' -f 1 | cut -d ' ' -f 2)
fi
if [[ $type == "main" ]]; then
@@ -53,4 +56,8 @@ arecord -D hw:${card},0 -d 5 -f cd -t wav /tmp/test.wav
echo "Start playing"
aplay /tmp/test.wav -D hw:${card},0
aplay /tmp/test.wav -D hw:${hdmi0_card},0
if [[ ${BOARD} == orangepi5ultra ]]; then
aplay /tmp/test.wav -D hw:${hdmi1_card},0
else
aplay /tmp/test.wav -D hw:${hdmi0_card},0
fi