OpenHAB Pulsaudio binding fails to connect to pulseaudio server

Hey All, for the last couple of weeks I’ve been trying (off and on) to to get openhab to connect to pulseaudio.

My openhab “host” device is a beagleboneblack running ubuntu and installation went quite smooth.

In sitemaps/demo.sitemap I added the following switch to a frame:

Switch item=Sink_FF_Multiroom_Muted label="Mute All Audio"

Followed by adding the following to rules/demo.rules:

/* MUSIC */
rule "mute pulseaudio sink on incoming call"
when
    Item Incoming_Call received update
then
if (Incoming_Call.state==ON) {
    Sink_FF_Multiroom_Muted.sendCommand(ON)
} else {
    Sink_FF_Multiroom_Muted.sendCommand(OFF)
}
end

and adding this to items/demo.items:

Switch Sink_FF_Multiroom_Muted { pulseaudio="Test:combined:MUTED" }

(Test used to be Main, but I changed it along the way for testing purposes)

This all was topped of by the following configuration(s) in openhab.cfg

############################## Pulseaudio Binding #####################################
#
# PulseaudioServer IP address
pulseaudio:Main.host=192.168.7.2

# PulseaudioServer Port (optional, defaults to 4712)
# pulseaudio:Main.port=4713

and

############################## Pulseaudio Binding #####################################
#
# PulseaudioServer IP address
pulseaudio:Main.host=192.168.7.1
pulseaudio:Test.host=192.168.7.1
#pulseaudio:Main.host=192.168.7.2

# PulseaudioServer Port (optional, defaults to 4712)
# pulseaudio:Main.port=4713
pulseaudio:Test.port=4712

The first config shows me trying to connect to the pulseaudio server (running on system level) on the beaglebone black. The second one shows me trying to connect to the pulseaudio system running on my “development” machine running ubuntu. Both devices are loaded with the pulse-tcp-plugin and allowing anonymous connections.

All of them had the same result in the openhab log file:

2015-12-11 09:53:45.357 [WARN ] [b.p.internal.PulseaudioBinding] - connection to pulseaudio server in not available for the given itemName [itemName=Sink_FF_Multiroom_Muted, audio-item-name=combined, serverId=Test, command=MUTED] => querying for values aborted!

Any pointers would be greatly appreciated!

Bump…

Anyone who has a clue? Is more information needed?

Try to access the pulseaudio server from the commandline of your openhab server, e.g. like : pactl -s 192.168.7.2 list sinks
If that is not working your pulseaudio is not configured correct. Check if you have loaded “module-cli-protocol-tcp”.

Hey tbraeutigam, thank you for your reaction! Pulseaudio is accessible from commandline using the pactl command. Sinks are listed (only 1, over the hdmi connection). We also loaded module-cli-protocol-tcp with success.

We can connect to the server from other Pulseaudio servers, but not from openhab.

The pulseaudio binding is using the same connection/protocol as the pactl command. So if you can access the pulseaudio server via pactl (executed on the openhab servers commandline) the binding should be able to connect to. Another way to test the connection is via telnet, start:

telnet 192.168.7.2 4712

on your openhab servers commandline. If it can connect, the pulseaudio binding must be able to connect to.