Skip to content

fix(backend): discover user audio session runtime dir for PipeWire support - #6

Open
thijsdaniels wants to merge 2 commits into
silverfoxy:masterfrom
thijsdaniels:fix/pipewire-audio-discovery
Open

thijsdaniels wants to merge 2 commits into
silverfoxy:masterfrom
thijsdaniels:fix/pipewire-audio-discovery

Conversation

@thijsdaniels

Copy link
Copy Markdown

Summary

When Decktation runs with "flags": ["root"] under systemd (PluginLoader), the backend process runs as root (UID 0) and does not inherit the desktop session's XDG_RUNTIME_DIR.

Because of this, PortAudio / PipeWire cannot connect to the user session audio daemon at /run/user/<UID>/pipewire-0 and falls back to unpopulated raw ALSA hardware inputs. This caused the audio stream to record silence (leading to VAD filtering out 100% of captured audio and no transcription being generated).

Changes

  • Added runtime directory discovery in decktation_backend.py and wow_voice_chat.py before sounddevice / PortAudio is initialized.
  • Scans for the active user's runtime directory (/run/user/<UID>/pipewire-0) and sets XDG_RUNTIME_DIR, PIPEWIRE_RUNTIME_DIR, and PULSE_SERVER.
  • Allows PortAudio to connect directly to the active PipeWire session as a native client.

Testing

  • Tested on Bazzite Linux / SteamOS: verified that PluginLoader connects to PipeWire and captures directly from whatever microphone is selected as default by the desktop/OS (USB headset, standalone mic, etc.), without needing static ALSA hardware overrides.
  • Confirmed working both in Decky UI test recording and in-game via controller push-to-talk.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant