Pulse Audio binding

Stupid question… Does anyone use the Pulse Audio binding? Can someone help me get it working in OpenHAB?
Platform desktop pc running Deb 9

A forum seach for ‘pulseaudio’ returns 33 threads, I’ve read all 33

from the :pulseaudio add-ons doc

You need a running pulseaudio server whith module module-cli-protocol-tcp loaded and accessible by the server which runs your openHAB instance.

running

pactl list sinks short

yeilds a list with my audio sinks so I’m guessing module-cli-protocol-tcp is at least running
I’ve given openhab user group membership in audio pulse and pulse-access

pulse audio binding to install and reloading the bundle yields

02:20:19.744 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'pulseaudio:bridge:db56ea99' changed from UNINITIALIZED to INITIALIZING
02:20:19.746 [ERROR] [.pulseaudio.internal.PulseaudioClient] - Connection refused (Connection refused)
java.net.ConnectException: Connection refused (Connection refused)
	at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:?]
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[?:?]
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[?:?]
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[?:?]
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:?]
	at java.net.Socket.connect(Socket.java:589) ~[?:?]
	at java.net.Socket.connect(Socket.java:538) ~[?:?]
	at java.net.Socket.<init>(Socket.java:434) ~[?:?]
	at java.net.Socket.<init>(Socket.java:211) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.PulseaudioClient.connect(PulseaudioClient.java:607) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.PulseaudioClient.<init>(PulseaudioClient.java:126) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioBridgeHandler.lambda$1(PulseaudioBridgeHandler.java:131) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]
02:20:19.747 [ERROR] [.pulseaudio.internal.PulseaudioClient] - Connection refused (Connection refused)
java.net.ConnectException: Connection refused (Connection refused)
	at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:?]
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[?:?]
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[?:?]
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[?:?]
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:?]
	at java.net.Socket.connect(Socket.java:589) ~[?:?]
	at java.net.Socket.connect(Socket.java:538) ~[?:?]
	at java.net.Socket.<init>(Socket.java:434) ~[?:?]
	at java.net.Socket.<init>(Socket.java:211) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.PulseaudioClient.connect(PulseaudioClient.java:607) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.PulseaudioClient.checkConnection(PulseaudioClient.java:595) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.PulseaudioClient.sendRawRequest(PulseaudioClient.java:551) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.PulseaudioClient.listModules(PulseaudioClient.java:162) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.PulseaudioClient.update(PulseaudioClient.java:139) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.PulseaudioClient.<init>(PulseaudioClient.java:127) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioBridgeHandler.lambda$1(PulseaudioBridgeHandler.java:131) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]
02:20:19.749 [WARN ] [ommon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.NullPointerException: null
	at org.openhab.binding.pulseaudio.internal.PulseaudioClient.sendRawRequest(PulseaudioClient.java:554) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.PulseaudioClient.listModules(PulseaudioClient.java:162) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.PulseaudioClient.update(PulseaudioClient.java:139) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.PulseaudioClient.<init>(PulseaudioClient.java:127) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioBridgeHandler.lambda$1(PulseaudioBridgeHandler.java:131) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]

thanks for any hints
Andy

Did you check via. search already? I will just assume no… (not meant mean, but it happens so often)

That’s what I found on a fast search.

Thanks Elias
The first thread I found and read but it didn’t help.

I hadn’t considered a wider web search because I thought it was an OpenHAB binding problem.
again thank you
I think sound is a pretty important part of the system and it seems like this is tougher then it needs to be

so this is a Linux problem?

First I did not use the pulseaudio binding so far.

It could be. The binding states an error Connection refused so maybe your openHAB User is not allowed to access the pulseaudio Server.
So maybe a permission issue.
Or your Pulseaudio server has the wrong setting and does not allow connections.
:slight_smile: these are my thoughts.

I had PA working last week but abandoned it because while PA was responsive from OH, the reverse was useless. I make a change on say the volume on the computer and the OH instance would fail to see it.

I hand edit the files though so can’t help with PaperUI, but here’s my config files in case you find them helpful.

Thing definition:

// Pulseaudio
Bridge pulseaudio:bridge:mypulse "Pulseaudio Bridge" @ "Home" [ipaddress="127.0.0.1", port=4712] {
        Thing pulseaudio:sink:mypulse:alsa_output_pci_0000_01_00_1_hdmi_stereo_extra1   "Pulseaudio HDMI" @ "Home"      [name="alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1"]
        Thing pulseaudio:sink:mypulse:alsa_output_pci_0000_00_1b_0_analog_stereo        "Pulseaudio Analog" @ "Home"    [name="alsa_output.pci-0000_00_1b.0.analog-stereo"]
}

Items:

// Pulseaudio
// HDMI
Dimmer pulseVolumeH             "Pulseaudio HDMI Volume [%s]"           <soundvolume>   (Pulseaudio)    {channel="pulseaudio:sink:mypulse:alsa_output_pci_0000_01_00_1_hdmi_stereo_extra1:volume"}
Switch pulseMuteH               "Pulseaudio HDMI Mute [%s]"             <soundvolume>   (Pulseaudio)    {channel="pulseaudio:sink:mypulse:alsa_output_pci_0000_01_00_1_hdmi_stereo_extra1:mute"}
String pulseStateH              "Pulseaudio HDMI State [%s]"            <info_blu_32>   (Pulseaudio)    {channel="pulseaudio:sink:mypulse:alsa_output_pci_0000_01_00_1_hdmi_stereo_extra1:state"}
// Analog
Dimmer pulseVolumeA             "Pulseaudio Analog Volume [%s]"         <soundvolume>   (Pulseaudio)    {channel="pulseaudio:sink:mypulse:alsa_output_pci_0000_00_1b_0_analog_stereo:volume"}
Switch pulseMuteA               "Pulseaudio Analog Mute [%s]"           <soundvolume>   (Pulseaudio)    {channel="pulseaudio:sink:mypulse:alsa_output_pci_0000_00_1b_0_analog_stereo:mute"}
String pulseStateA              "Pulseaudio Analog State [%s]"          <info_blu_32>   (Pulseaudio)    {channel="pulseaudio:sink:mypulse:alsa_output_pci_0000_00_1b_0_analog_stereo:state"}

Sitemap:

Group item=Pulseaudio {
        Frame label="HDMI" {
                Slider item=pulseVolumeH
                Switch item=pulseMuteH icon="soundvolume_mute" valuecolor=[==ON="#d51d2a"]  visibility=[pulseMuteH==ON]
                Switch item=pulseMuteH icon="soundvolume-100"  valuecolor=[==OFF="#01b459"] visibility=[pulseMuteH!=ON]
                Text item=pulseStateH
        }
        Frame label="Analog" {
                Slider item=pulseVolumeA
                Switch item=pulseMuteA icon="soundvolume_mute" valuecolor=[==ON="#d51d2a"]  visibility=[pulseMuteA==ON]
                Switch item=pulseMuteA icon="soundvolume-100"  valuecolor=[==OFF="#01b459"] visibility=[pulseMuteA!=ON]
                Text item=pulseStateA
        }
}

As can be seen in these files I also created a Pulseaudio group.

Just to throw in my two cents, I attempted pulseaudio and had good success when using another laptop as a pulseaudio client (it helped with getting the OS side of things iron’ed out). However I don’t think I was successful with getting OH to connect successfully, but I was attempting to do some TTS/pandora cli type things to a bluetooth speaker that was connected to OH.

Yes, and I was trying to find it but yesterday when I was researching this, I found a document that stated something to the effect that there are three ways pulseaudio generally gets implemented in Debian based distros. If I recall correctly, permissions to use the audio system are generated on the fly to allow the current user access. It’s a mite bit complex. Anyhow, if I can find it, I’ll post it

I thought about it and realized I’ve provisioned dozens of Linux servers, but none had audio. I had Mint on an old desktop and the sound (along with everything else) worked perfectly.

I’ve got the sound working on the host machine as a normal user (not root) so I’m making progress. I’ll report back when I get it working in OpenHAB. I’d just like to play sound files when a rule fires or whatever, like a phone ringing sound or doorbell sound.
I’m pretty sure at this point I could hack something using exec command or something but want to try to get the binding working properly

Thank you that is useful!

Fogot to mention, add OH to the ‘audio’, ‘pulse’ and pulse-access groups, that should fix any permission issues. Mine’s in the groups "lp audio video pulse pulse-access’.

EDIT: The command to do that as ‘root’ is:
usermod -a -G lp,audio,video,pulse,pulse-access openhab

1 Like
andy@treehouse:~$ groups openhab
openhab : openhab tty dialout audio www-data pulse pulse-access
andy@treehouse:~$ 
19:07:31.782 [ERROR] [.pulseaudio.internal.PulseaudioClient] - Connection refused (Connection refused)

Gee that’s strange, that’s all the permissions OH should need. Are you running AppAmour or SE Linux security checking systems, if not that’s all I can think of.

No SE Linux or AppArmour, just bare bones Debian 9 with simple gnome desktop.
The plot thickens, last night I broke it and then half fixed it again. But openHAB still gets blocked. I plurged then reinstalled pulse as per several threads on the web. Didn’t fix problem. Then I set pulse to system and should no longer use permissions… still OpenHAB blocked
I think I need to dig into the .cfg files.I think the out of the box configuration is set to not allow connections for security

Ok, I remember adding the last line (tcp) to /etc/pulse/default.pa, it was recommended by some docs I read, don’t remember what docs though.

Here’s the section in that file where I appended the tcp line:

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply
load-module module-cli-protocol-tcp

EDIT: Found it, it’s in the PA Binding doc, 2nd line under ‘Supported Things’

I’m thinking you are right rastus, I think I did that at one point the first time and then I could enter commands in the terminal for the pa command line tool (pactl)
example:
pactl -s 192.168.7.2 list sinks
At first I could only get them to work as root. That led me to permissions issue which led me to add openhab to all groups
I wan’t sure I had the syntax right for the load-module command so thank you for the example
I will try again tonight.

I GOT IT WORKING!!! with a bluetooth speaker!

I have got the pulseaudio binding working in OpenHAB… yes

I made items for a sink and am using the REST api to control volume and mute on a blue tooth speaker

don’t ask me how, I have no idea. I’ve tried so many things with pulseaudio on my system, I don’t think it was the binding. Once I got the system to play sounds, I opened Paper UI and there were a few items in my inbox.
I got a ton of errors at first and think it may be because the items had a null value.

13:41:26.414 [INFO ] [smarthome.event.InboxRemovedEvent    ] - Discovery Result with UID 'pulseaudio:sink:12cb5aaa:bluez_sink_D8_8D_83_22_B0_1B_a2dp_sink' has been removed.
13:41:26.417 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'pulseaudio:sink:12cb5aaa:bluez_sink_D8_8D_83_22_B0_1B_a2dp_sink' changed from UNINITIALIZED to INITIALIZING
13:41:26.422 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'pulseaudio:sink:12cb5aaa:bluez_sink_D8_8D_83_22_B0_1B_a2dp_sink' changed from INITIALIZING to OFFLINE
13:41:26.422 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'pulseaudio:sink:12cb5aaa:bluez_sink_D8_8D_83_22_B0_1B_a2dp_sink' changed from OFFLINE to ONLINE
13:41:32.959 [INFO ] [smarthome.event.InboxRemovedEvent    ] - Discovery Result with UID 'pulseaudio:sink:12cb5aaa:auto_null' has been removed.
13:41:32.960 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'pulseaudio:sink:12cb5aaa:auto_null' changed from UNINITIALIZED to INITIALIZING
13:41:32.961 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'pulseaudio:sink:12cb5aaa:auto_null' changed from INITIALIZING to OFFLINE
13:41:49.069 [ERROR] [ernal.handler.PulseaudioBridgeHandler] - An exception occurred while calling the DeviceStatusListener
java.lang.IllegalArgumentException: Value must be between 0 and 100
	at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:58) ~[?:?]
	at org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:43) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioHandler.onDeviceStateChanged(PulseaudioHandler.java:232) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioBridgeHandler.lambda$0(PulseaudioBridgeHandler.java:67) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]
13:42:20.081 [ERROR] [ernal.handler.PulseaudioBridgeHandler] - An exception occurred while calling the DeviceStatusListener
java.lang.IllegalArgumentException: Value must be between 0 and 100
	at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:58) ~[?:?]
	at org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:43) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioHandler.onDeviceStateChanged(PulseaudioHandler.java:232) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioBridgeHandler.lambda$0(PulseaudioBridgeHandler.java:67) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]
13:42:51.092 [ERROR] [ernal.handler.PulseaudioBridgeHandler] - An exception occurred while calling the DeviceStatusListener
java.lang.IllegalArgumentException: Value must be between 0 and 100
	at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:58) ~[?:?]
	at org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:43) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioHandler.onDeviceStateChanged(PulseaudioHandler.java:232) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioBridgeHandler.lambda$0(PulseaudioBridgeHandler.java:67) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]
13:43:22.102 [ERROR] [ernal.handler.PulseaudioBridgeHandler] - An exception occurred while calling the DeviceStatusListener
java.lang.IllegalArgumentException: Value must be between 0 and 100
	at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:58) ~[?:?]
	at org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:43) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioHandler.onDeviceStateChanged(PulseaudioHandler.java:232) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioBridgeHandler.lambda$0(PulseaudioBridgeHandler.java:67) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]
13:43:53.112 [ERROR] [ernal.handler.PulseaudioBridgeHandler] - An exception occurred while calling the DeviceStatusListener
java.lang.IllegalArgumentException: Value must be between 0 and 100
	at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:58) ~[?:?]
	at org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:43) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioHandler.onDeviceStateChanged(PulseaudioHandler.java:232) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioBridgeHandler.lambda$0(PulseaudioBridgeHandler.java:67) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]
13:44:24.117 [ERROR] [ernal.handler.PulseaudioBridgeHandler] - An exception occurred while calling the DeviceStatusListener
java.lang.IllegalArgumentException: Value must be between 0 and 100
	at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:58) ~[?:?]
	at org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:43) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioHandler.onDeviceStateChanged(PulseaudioHandler.java:232) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioBridgeHandler.lambda$0(PulseaudioBridgeHandler.java:67) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]
13:44:55.130 [ERROR] [ernal.handler.PulseaudioBridgeHandler] - An exception occurred while calling the DeviceStatusListener
java.lang.IllegalArgumentException: Value must be between 0 and 100
	at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:58) ~[?:?]
	at org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:43) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioHandler.onDeviceStateChanged(PulseaudioHandler.java:232) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioBridgeHandler.lambda$0(PulseaudioBridgeHandler.java:67) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]
13:45:26.141 [ERROR] [ernal.handler.PulseaudioBridgeHandler] - An exception occurred while calling the DeviceStatusListener
java.lang.IllegalArgumentException: Value must be between 0 and 100
	at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:58) ~[?:?]
	at org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:43) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioHandler.onDeviceStateChanged(PulseaudioHandler.java:232) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioBridgeHandler.lambda$0(PulseaudioBridgeHandler.java:67) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]
13:45:57.152 [ERROR] [ernal.handler.PulseaudioBridgeHandler] - An exception occurred while calling the DeviceStatusListener
java.lang.IllegalArgumentException: Value must be between 0 and 100
	at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:58) ~[?:?]
	at org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:43) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioHandler.onDeviceStateChanged(PulseaudioHandler.java:232) ~[?:?]
	at org.openhab.binding.pulseaudio.internal.handler.PulseaudioBridgeHandler.lambda$0(PulseaudioBridgeHandler.java:67) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]

There are more if anybody is interested in trying to figure out what is going on there. This is when I first click on the items in my inbox and it makes things

1 Like

the following does not work

smarthome:audio play doorbell.mp3

the default sink is set to

System Speaker (with mp3 support)
in Paper UI
any hints?

Edit: I got this working but still having problems with it working reliably
see thread

I wanted to add that the default port in the documentation is wrong,
pulseaudio, by default opens port 4713, not 4712, so that’s where some errors might arise

Thank you for the clue and welcome to the community Robert. Most of my problems with audio in OpenHAB were cured by switching from plain vanilla Debian to Mint Linux but I’ve still yet to get the pulse binding to do anything. If the documentation for the binding is incorrect I will make a pull request and fix it.

Thanks Andrew, i spent some time reading the sources. i was wrong: 4712 is the port to be used for the cli protocol. You can test this with “echo -e ‘list-sinks\n’ | nc 4712”
For this to work the module-cli-protocol-{tcp,unix} has to be loaded first.

alright, i’ve had success doing this.
I have an online sink now.
I fixed the Regex patterns used in the binding to match given sink names against the output from pulseaudio. I’ll open a pull-request on the binding

1 Like