Sonos & playSound Issue: No Sound and NoError?

Hi,
I’m trying to create a simple “DoorBell” action with OpenHab2 Build#703 running on synology
The Default Audio Sink is defined.
If created an item switch to trigger a rule. The rule is correctly fired but no sound is played:

rule "DingDong"
when 
	Item DingDong received command
then
	logInfo("logInfoDingDong","DingDong Start")
	setMasterVolume(new PercentType(80))
    playSound("dingdong.mp3")
	playSound("sonos:CONNECTAMP:RINCON_000E58DA4B7601400","dingdong.mp3")
	logInfo("logInfoDingDong","DingDong End")
end

What’s weird, is that there is no sound played and NO error in the logs:

17:47:24.215 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'DingDong' received command ON
17:47:24.219 [INFO ] [marthome.event.ItemStateChangedEvent] - DingDong changed from OFF to ON
17:47:24.303 [INFO ] [arthome.model.script.logInfoDingDong] - DingDong Start
17:47:24.320 [INFO ] [arthome.model.script.logInfoDingDong] - DingDong End

Same with the console, command “+openhab> smarthome:audio play dingdong.mp3” No Sound, No error.

any idea to help me?

I’m not sure which volume setting the sonos binding is using for playing a sound, i nmy case (Say-command) it was the NotificationVolume. Since this chanel is hidden under “more” on PaperUI page for that thing it migth not be noticed. Try to increase that volume on your next ringing the doorbell. [Note: Doing to much test-runs with such sounds will decrease the WAF big time!!!]

Thank you.
I’ve updated my rule to set the Notification Volume to 80, but no change. No sound going out of my Sonos …

rule "DingDong"
when 
	Item DingDong received command
then
	logInfo("logInfoDingDong","DingDong Start")
	setMasterVolume(new PercentType(80))
	SonosCuisineNotificationVolume.sendCommand(80)
	playSound("dingdong.mp3")
	playSound("sonos:CONNECTAMP:RINCON_000E58DA4B7601400","dingdong.mp3")
	logInfo("logInfoDingDong","DingDong End")
end

Please set the binding log to DEBUG ( I think it is :“log:set DEBUG org.openab.binding.sonos” , it could be eclipse.smarthome as well)

Edit: Are you able to use the play commond from the karaf console? Using “smarthome:audio play doorbell.mp3”

@opus; thank you for your guidance.
I’ve set up the log level to DEBUG and here are the results:

22:42:30.134 [DEBUG] [thome.io.rest.core.item.ItemResource] - Received HTTP POST request at 'items/DingDong' with value 'ON'.
22:42:30.135 [DEBUG] [ntime.internal.engine.RuleEngineImpl] - Executing rule 'DingDong'
22:42:30.136 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'DingDong' received command ON
22:42:30.138 [DEBUG] [.sitemap.internal.SitemapEventOutput] - Sent sitemap event for widget 00 to subscription f9ceeb2f-db6e-4d6b-812d-fea524300a45.
22:42:30.139 [INFO ] [arthome.model.script.logInfoDingDong] - DingDong Start
22:42:30.139 [INFO ] [marthome.event.ItemStateChangedEvent] - DingDong changed from OFF to ON
22:42:30.141 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'SonosCuisineNotificationVolume' received command 80
22:42:30.142 [DEBUG] [ome.core.thing.internal.ThingManager] - Delegating command '80' for item 'SonosCuisineNotificationVolume' to handler for channel 'sonos:CONNECTAMP:RINCON_000E58DA4B7601400:notificationvolume'
22:42:30.142 [DEBUG] [.smarthome.config.core.Configuration] - Setting value (String) RINCON_000E58DA4B7601400 to field 'udn' in configuration class org.eclipse.smarthome.binding.sonos.config.ZonePlayerConfiguration
22:42:30.143 [DEBUG] [.smarthome.config.core.Configuration] - Setting value (Integer) 60 to field 'refresh' in configuration class org.eclipse.smarthome.binding.sonos.config.ZonePlayerConfiguration
22:42:30.144 [DEBUG] [ome.core.thing.internal.ThingManager] - Delegating update '80' for item 'SonosCuisineNotificationVolume' to handler for channel 'sonos:CONNECTAMP:RINCON_000E58DA4B7601400:notificationvolume'
22:42:30.151 [DEBUG] [.smarthome.config.core.Configuration] - Setting value (String) RINCON_000E58DA4B7601400 to field 'udn' in configuration class org.eclipse.smarthome.binding.sonos.config.ZonePlayerConfiguration
22:42:30.152 [DEBUG] [.smarthome.config.core.Configuration] - Setting value (Integer) 60 to field 'refresh' in configuration class org.eclipse.smarthome.binding.sonos.config.ZonePlayerConfiguration
22:42:30.160 [INFO ] [arthome.model.script.logInfoDingDong] - DingDong End

What looks strange is that I can’t see any action associated to the “playSound” command. Some actions are done for the 2 volume “rule commands” but nothing for the 2 playSound commands.

Do you have an idea?

Did you try " Are you able to use the play commond from the karaf console? Using "smarthome:audio play doorbell.mp3""
Please check on PaperUI the setting of the NotificationVolume (under Control), a setting of 80 should be a bit to loud,-)

Yes, indeed I’ve tested the karaf command without succes.
The default AudioSink is correctly setup in the paperUI and if I try:


openhab> smarthome:audio play dingdong.mp3
openhab> smarthome:audio play dingdng.mp3
File 'dingdng.mp3' not found!
openhab> smarthome:audio play dingdong.mp3
openhab>

No result with the correct filename :wink:
I’ve upgraded to the build #732, but no change.

I’ve also tried the karaf command with the audiosink defined (to not use the default), but no sound:

openhab> smarthome:audio sinks
sonos:CONNECTAMP:RINCON_B8E937AA001201400
sonos:CONNECTAMP:RINCON_000E58DA1EBA01400
enhancedjavasound
sonos:CONNECTAMP:RINCON_000E58DA4B7601400
javasound
webaudio
sonos:CONNECTAMP:RINCON_B8E937AA002601400
sonos:CONNECTAMP:RINCON_B8E937A9FFE601400
openhab> smarthome:audio play sonos:CONNECTAMP:RINCON_000E58DA4B7601400 dingdong.mp3
openhab>

For the notificationVolume, I agree, if a notification comes out of the Sonos, this might be loudly, but today, it’s not the case:-)

Dumb question.
do you have the file “doorbell.mp3” in the folder “/etc/openhab2/sounds”?

Edit: Forget that question, it was DUMB. I saw the “file not found” message when trying it with a false named file.

1 Like

For what it’s worth: I noticed the same behaviour, starting today: say and play both stopped to work. Yesterday morning, my notifications still worked as shown in the logs, today they don’t.

First I thought there was an update responsible, however, I did not update in between.

Now that I think about it, I had a power outage however (of course just when I had disconnected my UPS for maintenance). Need to look further into this…

Following up on that: After another power loss to my RPi, everything works again. I remember that I had similar problems with the homekit and some other bundle as well. They simply didn’t do anything, no log messages execpt for restart messages, nothing.

After a couple of restarts (with no other changes), it suddently started working again…

Don’t know what solved this issue since I’ve made several changes, but, now, it’s working.
The actions Done:

  • Fresh Install of Openhab 2 final release
  • Leave conf files in the default folder and no more using Symbolic links to store them in another location
  • Create Sonos things using text things file and no more through the Things discovery

Thank you for your help and advice

Hum, not working right now.
Strange, looks like it’s working only one day and after an update on some Sonos items, channels or Things, the audiosink is broken.

I’m not sure if it is related, but on my system if I have too many things in the queue on a Sonos player, the audio stops working as the binding takes too long listing them. I think there is a fix in the works for this but you may try going into the Sonos PC app and clearing the queues for all of the Sonos devices in the system.

@yphyph01 please try the console command with doorbell.mp3, we don’t know dingdong.mp3. I am sure that doorbell.mp3 is working.
Another MP3 file was recently added in conf/sounds and I noticed that no sound was played when I tried it. Should try again.

Regarding your rule, I think it could be a problem to call playSound a second time while the first is probably
not yet finished. Of course if you are addressing not the same audio sink, that should be OK.

I just tried with barking.mp3 and it does not work while it works with doorbell.mp3.
Maybe Sonos does not like MP3 with a low bitrate and low sample rate (11025 Hz).
I opened an issue for that: https://github.com/openhab/openhab-distro/issues/417

@yphyph01: please try first with doorbell.mp3 and tell us what are the MP3 characteristics of your file dingdong.mp3.

@Lolodomo
I’ve already tried with the standard doorbell MP3 file but same symptoms.
The MP3 file is not the issue.
For the rule, I’ve modified it following your advice. Only one playSound command … I will update it with several audio sinks, when at least one will work.

@Mike_Bagdanoff
Thanks for this information. I’ll test cleaning it. Any issue opened on that issue?

Didi you try: “smarthome:audio play sonos:CONNECTAMP:RINCON_000E58DA4B7601400 doorbell.mp3” ?

You said at a moment that the issue was solved, does it means that it works sometimes and sometimes not ?

One time it was no more working for me and I thing I solved the problem by rebooting my Sonos.

@Lolodomo
My Dingdong file is played perfectly in direct on the Sonos system as well as the Doorbell one.
Its characteristics are 172 bitrate, 48000 Hz in mode joint stereo
But with the barking file, I can not play it on Sonos. The system says that it can not play 11025Hz files.

For my issue with openhab audio sinks, I’ve tried @Mike_Bagdanoff advice and … It works. Once cleaned, the Karaf commands and my rule are play on Sonos audio sinks. So I guess there is an issue between openhab and Sonos queue management.

Thanks all for your support

I fixed this issue with queue reading. You are not running OH 2 final version ?!