Name Chrome streams after their browser tabs

A browser extension reports audible tabs to moonmix-tabs-host, which matches
them to PipeWire streams by time and publishes the names for the mixer; streams
of one tab share a row. Ambiguous streams keep the browser's name. Without the
extension, a browser's only running stream shows its MPRIS title.

The smoke test no longer claims real audio hardware.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Opus 5.5 committed 2026-11-29 19:26:29 -08:00
1 parent b61d504234
commit e16cc1b2ad
31 files changed
+1830 -15

No files matched your search

+23
View File
@@ -13,6 +13,7 @@ set -eu
ROOT=$(cd "$(dirname "$0")/.." && pwd)
BUILD="$ROOT/_build/native/debug/build/cmd"
PROBE="$BUILD/moonmix-probe/moonmix-probe.exe"
TABS_HOST="$BUILD/moonmix-tabs-host/moonmix-tabs-host.exe"
GUI="$BUILD/moonmix/moonmix.exe"
SHOTS="${1:-}"
@@ -49,12 +50,19 @@ CONF
# Ubuntu's WirePlumber asks snapd before granting clients access; there is
# no snapd in a sandbox/CI container, so turn that off for the test session.
# No hardware either: the test noise must not reach the real speakers.
mkdir -p "$XDG_CONFIG_HOME/wireplumber/wireplumber.conf.d"
cat > "$XDG_CONFIG_HOME/wireplumber/wireplumber.conf.d/moonmix-test.conf" <<'CONF'
wireplumber.profiles = {
main = {
support.snapd-permission-prompting = disabled
script.client.access-snap = disabled
monitor.alsa = disabled
monitor.alsa-midi = disabled
monitor.bluez = disabled
monitor.bluez-midi = disabled
monitor.libcamera = disabled
monitor.v4l2 = disabled
}
}
CONF
@@ -160,6 +168,21 @@ meter() {
meter "${STREAM:-0}"
meter test_speakers
# Browser tab names: a fake browser with a real tab host.
if command -v python3 >/dev/null; then
echo "### browser tab names"
mkfifo "$LOGS/browser.in"
python3 "$ROOT/tools/fake-browser.py" "$TABS_HOST" "$LOGS/noise.wav" \
<"$LOGS/browser.in" >"$LOGS/browser.log" 2>&1 & BROWSER=$!; PIDS="$PIDS $BROWSER"
exec 5>"$LOGS/browser.in"
wait_for 'Smoke test tab | ' || { fail=1; cat "$LOGS/browser.log" "$XDG_RUNTIME_DIR"/moonmix/* || true; "$PROBE" || true; }
exec 5>&-
wait "$BROWSER" || { echo "FAIL: fake browser"; cat "$LOGS/browser.log"; fail=1; }
if [ -n "$(ls "$XDG_RUNTIME_DIR/moonmix")" ]; then echo "FAIL: tab host left its file"; fail=1; fi
else
echo "python3 not found; skipping browser tab names"
fi
if [ "$fail" != 0 ]; then
echo "### diagnostics"
echo "--- pw-play playback:"; cat "$LOGS/play.log"