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

module-native-protocol-tcp is using the wrong port #12

Open Dracrius opened 2 years ago

Dracrius commented 2 years ago

I am using PulseAudio to setup a sink source for an OpenHAB instance using this to connect (https://www.openhab.org/addons/bindings/pulseaudio/) and I've notice some oddities. By default PulseAudio should be using 4712 for module-cli-protocol-tcp and 4713 for module-native-protocol-tcp but your version appears to use 4712 for module-native-protocol-tcp and so when you enable module-cli-protocol-tcp with module-native-protocol-tcp it kind of bumps module-cli-protocol-tcp to 4713.

I know this because openhab can only connect using module-cli-protocol-tcp. When both module-cli-protocol-tcp and module-native-protocol-tcp are loaded openhab can only see the server on 4713. If I disable module-native-protocol-tcp I can only connect on 4712 and if I use the old windows version from the pulseaudio site it also connects on 4712. Unfortunately with module-native-protocol-tcp disabled I can't do any pactl commands as it uses that protocol and a lot of that openhab bindings code is hard coded to 4712 so I can see the server but I can't connect to a sink.

Now I have post an issue about the hardcoding to them (https://github.com/openhab/openhab-addons/issues/11661) but unfortunately that doesn't mean there isn't an issue here to. The problem with this comes in the fact that if you try to define load-module module-native-protocol-tcp port=4712 which should fix it and allow me to have both running using the port argument, PulseAudios Server starts to act strange. Things will connect right quick like it is running fine but a pactl -s 127.0.0.1 list will time out and trying to send audio also appears to time out and neither show in the log. Now I tried to look through the win32 code to see what might be causing it but I can't find anything that should cause that behavior or the port change.

pgaskin commented 2 years ago

pa-win32 doesn't change the port from the module's default.

The timeout when changing the port would be because PA connects to that same port by default, so you'd need to change it in the client config too.

I'll look into this in more detail when I have time.