Skip to content

Commit

Permalink
Add az01-specific scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
icedream committed Sep 24, 2023
1 parent 048bdc4 commit 29f5c67
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/sh

# which product are we running on?
APPNAME=`cat /sys/firmware/devicetree/base/inmusic,product-code`

# detect installation path of our custom scripts
scriptspath="$(command -v setup-prerequisites.sh)"
if [ -z "$scriptspath" ]; then
scriptspath="$(pwd)"
else
scriptspath="$(dirname "$scriptspath")"
fi

# set up cpu assignment and other device stuff
"$scriptspath"/setup-prerequisites.sh $APPNAME

# test for an existing bus daemon, just to be safe
if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
# if not found, launch a new one
eval `dbus-launch --sh-syntax`
fi

# set up screen/input rotation
source "$scriptspath"/setup-screenrotation.sh $APPNAME

# run upower if it is available
if command -v upower; then
"$(dirname $(readlink -f $(command -v upower)))/../libexec/upowerd" &
fi

# run command in gdbserver if wanted
if [ -n "${GDBSERVER:-}" ]; then
exec gdbserver :2345 mixxx "$@"
fi

exec mixxx "$@"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

IRQ=$1
CPU=$2
echo "Setting" $IRQ "to CPU: "$CPU
grep $IRQ /proc/interrupts | cut -d':' -f1 | tr -d " \t" | xargs -t -i sh -c 'echo $1 > /proc/irq/$2/smp_affinity_list' -- $CPU {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh

APPNAME=$1

# Increase priority to max for audio IRQ
grep -h irq/.*ffb20000 /proc/*/stat 2>/dev/null | cut -d' ' -f1 | xargs -i chrt -f -p 99 {}
# Setting GPU to CPU 1
set-irq-affinity.sh ffa30000 1
# Setting Audio to CPU 3
set-irq-affinity.sh ffb20000 3
# Setting Network to CPU 1
set-irq-affinity.sh eth0 1

if [ ! -e /sys/firmware/devicetree/base/serial@ff190000/control-surface ];
then
# Control surface is on USB (not UART) so setting USB to CPU 1:
set-irq-affinity.sh ehci_hcd 1
set-irq-affinity.sh ff540000 1
fi

# Enable external SD Card interface
echo external > /sys/bus/platform/devices/sd-mux/state

# Set GPU governor to performance mode
if [ $APPNAME == "JP21" ];
then
echo simple_ondemand > /sys/devices/platform/ffa30000.gpu/devfreq/ffa30000.gpu/governor
else
echo performance > /sys/devices/platform/ffa30000.gpu/devfreq/ffa30000.gpu/governor
fi

# Set midi output buffer size to max
echo 524287 > /sys/module/snd_seq_midi/parameters/output_buffer_size

# Disable vsync_on_pan, with the new Linux kernel vsync is on by default,
# and this line would add a double vsync, thereby halving the framerate.
# vsync_on_pan is a mechanism introduced by John Keeping
echo 0 >/sys/class/graphics/fb0/vsync_on_pan

# supressing debug output to avoid audio dropouts on USB/SD device plugging
dmesg -n crit
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

APPNAME=$1

panelRotationFile=/sys/firmware/devicetree/base/inmusic,panel-rotation
touchRotationFile=/sys/firmware/devicetree/base/inmusic,touch-rotation

[ -f $panelRotationFile ] && panelHex=`xxd -p -s2 -c2 $panelRotationFile` && panelDec=$((0x$panelHex))
[ -f $touchRotationFile ] && touchHex=`xxd -p -s2 -c2 $touchRotationFile` && touchDec=$((0x$touchHex))

if [ -n "$panelHex" ] && [ $(($panelDec % 90)) -eq 0 ]
then
[ $panelDec -gt 180 ] && let panelDec=panelDec-360

export AIR_SCREEN_ROTATION=$panelDec
echo Screen rotation is set to $panelDec

if [ -n "$touchHex" ] && [ $(($touchDec % 90)) -eq 0 ]
then
[ $touchDec -gt 180 ] && let touchDec=touchDec-360

let rotation=panelDec-touchDec
export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=rotate=$rotation
echo Touch rotation is set to $rotation
fi
else
echo Screen rotation has not been set
fi

0 comments on commit 29f5c67

Please sign in to comment.