Pulseaudio-binding: use pulseaudio sink items as actual audio sinks

Hi Community, and Devs

I want to create a new AudioSink for openhab within the pulseaudio binding.

Before i get into the mess there is a question i’d like to ask.

My plan is to use the icedtea-pulseaudio package (http://icedtea.classpath.org/hg/icedtea-sound/file/a863d6ea5cfc) to provide the backend of this binding, because it offers methods to easily open connections to remote pulseaudio servers.
It seems to me that the package is quite old already. I’m wondering if it is a smart thing to develop a feature against that library.

Maybe there is a better way to do it?

EDIT: moved to development


I made a PR wich handle this use case (see above). I didn’t use the native protocol, nor the icedtea code you found, but the simple protocol (sending raw audio to a port linked to a sink). Because it was much more… well, simpler :wink:

So you have to use the pulseaudio module-simple-protocol-tcp server side, which will, once loaded, listen on a port and forward everything to the sink you have configured when loading the module.
pactl load-module module-simple-protocol-tcp sink= port=4711

The binding use the existing Thing “Audio Sink” and extends it by allowing it to connect to this port and broadcast raw audio.

I made a test release, testing welcome.