diff --git a/Makefile b/Makefile index bbedb9c..cfcf662 100644 --- a/Makefile +++ b/Makefile @@ -64,8 +64,10 @@ ZIEL ?= horror.marha.de # Räumt vorher auf: ein noch laufendes OBS belegt sonst die Sendestrecke, # und der Tonweg wird sauber neu aufgebaut. +# Der Stream bekommt den vollen Ton, dieser Rechner bleibt still. +# Zum Mitschauen am selben Gerät: make stream MITHOEREN=1 stream: stream-stop - @scripts/stream.sh $(ZIEL) + @MITHOEREN=$(MITHOEREN) scripts/stream.sh $(ZIEL) # Zum Ausprobieren ohne Server, gegen das lokale MediaMTX stream-local: mtx diff --git a/README.md b/README.md index 9225f74..1c25b98 100644 --- a/README.md +++ b/README.md @@ -183,6 +183,12 @@ Ohne Passwort weist MediaMTX die Verbindung ab. Zuschauen braucht keins. das nicht — dort liefert `getDisplayMedia` unter Linux nur Tab-Ton, und Firefox gar keinen. +Der sendende Rechner bleibt dabei still. Der Ton läuft über eine Null-Senke, +deren Monitor OBS abgreift; auf die Lautsprecher geht nichts. Am Pegel im +Stream ändert das nichts, weil PipeWire die Monitor-Ports vom Regler der +Senke unberührt lässt. `make stream MITHOEREN=1` legt den Ton zusätzlich auf +dein gewohntes Gerät. + **Warum alle dasselbe Bild sehen** Jeder Player hält 4 Sekunden Abstand zur Live-Kante (`liveSyncDuration`). diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 9d25de9..641919f 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -516,9 +516,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -620,9 +617,6 @@ "arm" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -637,9 +631,6 @@ "arm" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -654,9 +645,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -671,9 +659,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -688,9 +673,6 @@ "loong64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -705,9 +687,6 @@ "loong64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -722,9 +701,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -739,9 +715,6 @@ "ppc64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -756,9 +729,6 @@ "riscv64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -773,9 +743,6 @@ "riscv64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -790,9 +757,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -807,9 +771,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -824,9 +785,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ diff --git a/scripts/stream.sh b/scripts/stream.sh index b4abb89..a40bef7 100755 --- a/scripts/stream.sh +++ b/scripts/stream.sh @@ -28,7 +28,8 @@ if ! timeout 3 bash -c "/dev/null; then exit 1 fi -scripts/ton.sh auf +# Der Ton geht nur in den Stream. MITHOEREN=1 legt ihn zusätzlich auf dein Gerät +scripts/ton.sh auf ${MITHOEREN:+mithoeren} mkdir -p "$P" "$BASIS/scenes" diff --git a/scripts/ton.sh b/scripts/ton.sh index 68d2438..c6be105 100755 --- a/scripts/ton.sh +++ b/scripts/ton.sh @@ -6,8 +6,10 @@ # nach fünf Minuten sind es Sekunden. Eine Null-Senke hängt an der Systemuhr # und liefert 48 kHz, also genau das, was der Encoder erwartet. # -# ton.sh auf Senke anlegen, zum Standard machen, Mithören einrichten -# ton.sh ab Standard zurückstellen, Senke entfernen +# ton.sh auf Senke anlegen und zum Standard machen. Der Ton +# geht nur in den Stream, der Rechner bleibt still. +# ton.sh auf mithoeren zusätzlich zurück auf dein gewohntes Gerät +# ton.sh ab Standard zurückstellen, Senke entfernen set -euo pipefail SENKE="filmabend" @@ -56,6 +58,20 @@ auf) sleep 1 fi + # Der Regelfall: der Ton geht nur in den Stream, hier bleibt es still. + # Am Pegel ändert das nichts — PipeWire lässt die Monitor-Ports vom Regler + # der Senke unberührt (monitor.channel-volumes ist aus), OBS bekommt also + # immer den vollen Ton. Genau deshalb macht Stummschalten allein auch nicht + # leise: das Mithören unten hängt am selben Monitor. + if [ "${2:-}" != "mithoeren" ]; then + # Eine Brücke aus einem früheren Lauf spielte sonst weiter auf die + # Lautsprecher — die Senke allein macht noch nicht still + pkill -f "node.name=filmabend-mithoeren" 2>/dev/null || true + wpctl set-default "$(id_von "$SENKE")" + echo "Ton geht nur in den Stream, $ZURUECK bleibt still." + exit 0 + fi + # Damit du selbst weiter über dein gewohntes Gerät hörst. # setsid, sonst nimmt der Prozess das Ende dieser Shell mit und du # hörst mitten im Film nichts mehr. @@ -103,7 +119,7 @@ ab) ;; *) - echo "Aufruf: ton.sh auf|ab" + echo "Aufruf: ton.sh auf [mithoeren] | ab" exit 1 ;; esac