forked from ghuntley/denon-prime4
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
buildroot-customizations/board/akai/az01/rootfs_overlay/usr/local/bin/run-mixxx.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "$@" |
6 changes: 6 additions & 0 deletions
6
buildroot-customizations/board/akai/az01/rootfs_overlay/usr/local/bin/set-irq-affinity.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {} |
41 changes: 41 additions & 0 deletions
41
buildroot-customizations/board/akai/az01/rootfs_overlay/usr/local/bin/setup-prerequisites.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
29 changes: 29 additions & 0 deletions
29
...droot-customizations/board/akai/az01/rootfs_overlay/usr/local/bin/setup-screenrotation.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|