2020-06-10 16:33:29 +02:00
|
|
|
#!/bin/bash
|
|
|
|
function set_latency_offset() {
|
|
|
|
if [ $# != 1 ]; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
echo "Set latency offset to $1 µs" >&2
|
|
|
|
pactl set-port-latency-offset alsa_card.pci-0000_00_1b.0 analog-output-headphones $1
|
|
|
|
}
|
|
|
|
|
|
|
|
set_latency_offset -40000
|
|
|
|
trap "set_latency_offset 0" SIGINT SIGTERM EXIT
|
|
|
|
|
|
|
|
BASEDIR="$(dirname $(realpath -s $0))"
|
|
|
|
|
|
|
|
mkdir -p "$BASEDIR/data" "$BASEDIR/import"
|
|
|
|
|
|
|
|
docker run \
|
|
|
|
--rm \
|
|
|
|
-it \
|
|
|
|
--name osu \
|
|
|
|
--device /dev/dri \
|
|
|
|
--group-add $(getent group audio|cut -d: -f3) \
|
2020-08-25 13:19:30 +02:00
|
|
|
--group-add $(getent group video|cut -d: -f3) \
|
|
|
|
-e PULSE_COOKIE=/run/pulse/cookie \
|
|
|
|
-e PULSE_SERVER=/run/user/$(id -u)/pulse/native \
|
|
|
|
-e WAYLAND_DISPLAY \
|
|
|
|
-e XDG_RUNTIME_DIR \
|
2020-06-10 16:33:29 +02:00
|
|
|
-v "$BASEDIR/data/:/home/osu/osu/" \
|
|
|
|
-v "$BASEDIR/import/:$BASEDIR/import/" \
|
2020-08-25 13:19:30 +02:00
|
|
|
-v "$HOME/.config/pulse/cookie:/run/pulse/cookie" \
|
|
|
|
-v "${XDG_RUNTIME_DIR}:${XDG_RUNTIME_DIR}" \
|
2020-06-10 16:33:29 +02:00
|
|
|
r.sbruder.de/osu \
|
|
|
|
$@
|