pgaskin / pulseaudio-win32

An up-to-date PulseAudio build for Windows with an installer, service, socket support, bug fixes, and new features.
https://pgaskin.net/pulseaudio-win32
MIT License
72 stars 6 forks source link

Pulseaudio for WSL configuration #10

Open pawelurbanski opened 3 years ago

pawelurbanski commented 3 years ago

Dear Patrick, I am filing this issue after exhausting the following paths to solve my problem:

If you could help out with a working configuration if you happen to have one or clarify a bit more the following: What configuration directory is used by the windows service? There are 3 possible places or more, where configuration files can be or are placed:

Which files should be modified to enable TCP protocol and allow connections from WSL. The WSL virtual machine is assigned a local network address from the pool in 172.16.0.0/12 - I found this vale in a few threads on the web.

Last but not least. Any hints about proper configuration on the WSL Linux side besides setting the $PULSE_SERVER environment variable to the assigned IpP address?

Thank you in advance for your time and help... Pawel

pgaskin commented 3 years ago

The %PROGRAMFILES(x86)%\PulseAudio\etc\pulse\system.pa.d\ is the correct folder to place the system config fragments. I may add support for loading it from ProgramData later.

For setting the sever from the WSL2 side, based on what I know right now, I recommend adding export PULSE_SERVER="tcp:$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }')" to $HOME/.profile, then adding a Windows Firewall rule to allow the WSL2 network to access TCP port 4713. I haven't tested this yet since I don't use WSL2 right now, but it should work fine.

If anyone else is using WSL1, note that you can use the AF_UNIX interop and hardcode the default-server address in /etc/pulse/client.conf to point to the UNIX socket created by PulseAudio.