Repository navigation
Desktop app for Linux (PipeWire) - #8
Merged
Merged
Conversation
… a PipeWire source - crates/desktop/src/linux: PipeWire engine (default-sink monitor capture, virtual mic audiobridge_mic, mic demand, default source, volume), MPRIS media keys, SNI tray, XDG autostart/paths, single instance (--quit); Windows modules behind cfg(windows) - packaging: scripts/package-linux.sh (tar.gz + install.sh, pacman package), launcher entry, icon - CI: linux job on the self-hosted runner; docs: README, AGENTS.md, CONTRIBUTING.md
With EGL vsync the swap waits for a frame callback that compositors do not send to a window on a hidden workspace. Any repaint there (device change, streaming, show request) blocked the UI thread in wl_display_dispatch_queue: compositor pings went unanswered, Hyprland offered to kill the app with SIGKILL (no cleanup, phone mic left as the configured default), and SIGTERM or Выход could not finish until the window was shown again. Linux now renders without vsync; the UI repaints only on changes.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The desktop app now runs on Linux with PipeWire (tested target: Arch / Omarchy, Hyprland), in both directions, with the same protocol v3: phones on 0.4.0 work with it unchanged. Windows code is unchanged apart from moving shared bits (
DeviceSummary, tray refresh,current_devices) behind a common API.Linux (
crates/desktop/src/linux/)stream.capture.sink, no target, so WirePlumber links it and moves it with the default). Runs only while a phone is connected and "Звук ПК" is on.audiobridge_mic(«AudioBridge: микрофон телефона»,Audio/Source+node.virtual). No driver; it exists while the service runs and disappears with the process (also on a crash). Mic demand = the node is actually being recorded from (stream stateStreaming).default.configured.audio.sourcein thedefaultmetadata, with the same remember/restore/resume logic as Windows.Props, set withwpctl; external changes are reported to the phone.--quitto stop the running one), XDG data/log dirs, PRETTY_HOSTNAME as the PC name, SIGTERM/SIGINT/SIGHUP clean shutdown.audiobridge.Packaging and CI
scripts/package-linux.sh:AudioBridge-<ver>-linux-x86_64.tar.gz(binary, launcher entry, icon,install.shfor a per-user install in~/.local) andaudiobridge-<ver>-1-x86_64.pkg.tar.zst(pacman; depends on pipewire, wireplumber, libglvnd, libxkbcommon, wayland).linuxjob on the self-hosted runner (clippy, tests, release build, package, artifactAudioBridge-linux-x86_64). The runner gets the PipeWire SDK without root from~/opt/pipewire-sdk/env.sh.How it was checked (all on the server)
cargo clippy -p audiobridge-desktop --all-targets -D warningson Linux and withcargo xwinfor Windows;cargo xwin build --release;cargo test -p audiobridge-desktop(Linux: 15 tests incl. new graph/volume/MPRIS/paths/autostart ones); core lib + rt_alloc; android-native host tests;:app:assembleDebug :app:testDebugUnitTest.examples/probeas the phone:audiobridge_micwithpw-record: 440 Hz at −9.0 dBFS;mic demand: truewhile recording,falseafter;wpctlshows 0.30, mute/unmute, Audio off/on stops/starts the loopback; an outsidewpctl set-volume 0.8is reported as 80;resume_mic_default, the next start makes it the default again;--quitandkill -9both leave noaudiobridge_*nodes behind.Found while testing: WirePlumber 0.5 configures
Audio/Source/Virtualnodes with input ports (null-sink style); for a stream-backed source that never completes, and a mono one stalls all of WirePlumber's linking. HenceAudio/Source+node.virtual(documented in AGENTS.md).Fixes after the first install on real Omarchy/Hyprland machines
install.shfalsely reported missing PipeWire (d9dddb8):ldconfig -p | grep -qunderpipefail—grep -qcloses the pipe,ldconfigdies of SIGPIPE, the pipeline fails. grep now reads the whole output. The per-user install then succeeded on both machines.pollinside libEGL'swl_display_dispatch_queueuntil the window was shown, SIGTERM did not exit within 10 s. After: the main thread stays in the event loop (epoll_pwait), SIGTERM exits in ~0.1 s with the user's mic restored. Compositor close → reopen →--quitstill work; the X11 window still renders; CPU while streaming stays low (no busy loop).kill -9with the phone mic as default,wpctl statusstill showsaudiobridge_micunder "Default Configured Devices". That is the remembered default in the metadata, not a leftover node (pw-cli ls Nodehas none).Release notes draft
Что нового: AudioBridge для Linux (PipeWire). Звук компьютера идёт на телефон, микрофон телефона появляется в Linux как «AudioBridge: микрофон телефона» — без драйверов. Пульт с телефона (громкость, mute, микрофон по умолчанию), кнопки наушников управляют плеерами через MPRIS, значок в трее, автозапуск. Пакет для Arch/Omarchy (
.pkg.tar.zst) и архив сinstall.shдля любого дистрибутива. Телефон обновлять не нужно: протокол прежний (v3).AudioBridge for Linux (PipeWire): PC audio to the phone, the phone mic as a PipeWire source, remote control, MPRIS media keys, tray, autostart. Pacman package and a tarball with a per-user installer. Same protocol v3: no phone update needed.