]> git.sesse.net Git - ultimatescore/blob - ultimate.sh
Fix an issue where newer browsers would squeeze the secondary scorebugs.
[ultimatescore] / ultimate.sh
1 #! /bin/bash
2
3 if ! [ -d /srv/ultimate/opptak ]; then
4 #       sudo mount /dev/sda1 /srv/ultimate
5         sudo mount /dev/disk/by-uuid/af9070b1-ba86-4240-83b3-8b866b86a46b /srv/ultimate
6 fi
7
8 if ! ping -c 1 -t 1 10.42.1.1 >/dev/null; then
9         echo "Wireguard tunnel is not working (cannot ping 10.42.1.1), please fix before starting streaming."
10         exit
11 fi
12
13 # Set up BBR
14 for DEV in $( ip link | grep UP | cut -d" " -f2 | cut -d: -f1 | cut -d@ -f1 | grep -v lo ); do
15         sudo tc qdisc add root dev $DEV fq
16 done
17 echo bbr | sudo tee /proc/sys/net/ipv4/tcp_congestion_control
18 sudo ethtool -K enp0s31f6 tx off  # takes iperf from 750 to 920 mbit/sec!?
19
20 # Make sure CSS is up-to-date
21 sass score.scss score.css
22
23 # Start the client
24 if ! pidof ultimatescore > /dev/null; then
25         urxvt -e /home/sesse/dev/ultimatescore/client/ultimatescore &
26 fi
27
28 # Start Nageru
29 ( cd /home/sesse/dev/nageru/obj &&
30  ./nageru \
31         -c 6 \
32         -t /home/sesse/dev/ultimatescore/nageru/ultimate.lua \
33         -M /home/sesse/dev/ultimatescore/nageru/ultimate.mapping \
34         -r /srv/ultimate/opptak \
35         --midi-mapping=akai_midimix.midimapping \
36         --http-x264 \
37         --x264-speedcontrol \
38         --x264-tune film \
39         --http-mux mp4 \
40         --http-audio-codec aac \
41         --x264-bitrate 4500 \
42         --http-audio-bitrate 128 \
43         --quick-cut-keys \
44         --mjpeg-export-cards=1-5 \
45         -m 0,1 -m 1,2 -m 2,3 -m 3,4 -m 4,5 -m 5,0
46         #-m 0,2 -m 1,3 -m 2,4 -m 3,5 -m 4,0 -m 5,1 \
47 )
48
49
50         #--output-card 4 \
51         #--output-buffer-frames 8.0