Skip to content

WSL2 self-heal: symlink the pulse socket WSLg actually creates - #5

Open
shavalejames-blip wants to merge 1 commit into
jaredrhod:mainfrom
shavalejames-blip:main
Open

WSL2 self-heal: symlink the pulse socket WSLg actually creates#5
shavalejames-blip wants to merge 1 commit into
jaredrhod:mainfrom
shavalejames-blip:main

Conversation

@shavalejames-blip

Copy link
Copy Markdown

Summary

  • PortAudio's ALSA pulse plugin looks for the socket at the standard XDG runtime path regardless of $PULSE_SERVER, but WSLg only creates one at /mnt/wslg/PulseServer. Without a symlink, audio playback crashes the process outright ("terminate called ... dumped core") instead of failing cleanly.
  • run.sh now re-links /run/user/$UID/pulse/native to /mnt/wslg/PulseServer on every launch (the tmpfs runtime dir resets each reboot), only when needed.

Test plan

  • bash -n run.sh passes
  • Simulated the broken state (removed the native symlink) and confirmed the heal snippet recreates it correctly
  • With the healed symlink in place, verified sounddevice (used by mouth.py/ears.py) can query devices and play a tone with no crash
  • Confirmed no-op on setups where WSLg already provisions a working symlink

🤖 Generated with Claude Code

https://claude.ai/code/session_015QgYjuW3CoTZVuvJPo1eBk

PortAudio's ALSA pulse plugin looks for the socket at the standard
XDG runtime path regardless of $PULSE_SERVER, but WSLg only creates
one at /mnt/wslg/PulseServer. Without this symlink, audio playback
crashes the process outright instead of failing cleanly. The tmpfs
dir resets every reboot, so this re-links on every launch.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QgYjuW3CoTZVuvJPo1eBk
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