Openhab 2 Squeezebox Text to speech?

alright, seems as we’re getting somewhere. karaf output:

openhab> smarthome:items list | grep sq_kuchl_power
sq_kuchl_power (Type=SwitchItem, State=ON, Label=Power, Category=null)
openhab> smarthome:links | grep sq_kuchl_power
sq_kuchl_power -> squeezebox:squeezeboxplayer:592AAC9D-2D85-4E22-9E16-B4460D36CE16:000000000000:power
sq_kuchl_power -> squeezebox:squeezeboxplayer:592AAC9D-2D85-4E22-9E16-B4460D36CE16:b827eb6a8241:power
sq_kuchl_power -> squeezebox:squeezeboxplayer:592AAC9D-2D85-4E22-9E16-B4460D36CE16:b827eb3fd714:power
openhab> smarthome:links | grep :power
sq_kuchl_power -> squeezebox:squeezeboxplayer:592AAC9D-2D85-4E22-9E16-B4460D36CE16:000000000000:power
sq_kuchl_power -> squeezebox:squeezeboxplayer:592AAC9D-2D85-4E22-9E16-B4460D36CE16:b827eb6a8241:power
sq_kuchl_power -> squeezebox:squeezeboxplayer:592AAC9D-2D85-4E22-9E16-B4460D36CE16:b827eb3fd714:power

and this is what i find in org.eclipse.smarthome.core.thing.link.ItemChannelLink.json:
first entry:

  "sq_kuchl_power -\u003e squeezebox:squeezeboxplayer:592AAC9D-2D85-4E22-9E16-B4460D36CE16:000000000000:power": {
    "class": "org.eclipse.smarthome.core.thing.link.ItemChannelLink",
    "value": {
      "channelUID": {
        "segments": [
          "squeezebox",
          "squeezeboxplayer",
          "592AAC9D-2D85-4E22-9E16-B4460D36CE16",
          "000000000000",
          "power"
        ]
      },
      "itemName": "sq_kuchl_power"
    }
  },

second entry:

  "sq_kuchl_power -\u003e squeezebox:squeezeboxplayer:592AAC9D-2D85-4E22-9E16-B4460D36CE16:b827eb6a8241:power": {
    "class": "org.eclipse.smarthome.core.thing.link.ItemChannelLink",
    "value": {
      "channelUID": {
        "segments": [
          "squeezebox",
          "squeezeboxplayer",
          "592AAC9D-2D85-4E22-9E16-B4460D36CE16",
          "b827eb6a8241",
          "power"
        ]
      },
      "itemName": "sq_kuchl_power"
    }
  },

aaaand third entry (that’s the right one!):

  "sq_kuchl_power -\u003e squeezebox:squeezeboxplayer:592AAC9D-2D85-4E22-9E16-B4460D36CE16:b827eb3fd714:power": {
    "class": "org.eclipse.smarthome.core.thing.link.ItemChannelLink",
    "value": {
      "channelUID": {
        "segments": [
          "squeezebox",
          "squeezeboxplayer",
          "592AAC9D-2D85-4E22-9E16-B4460D36CE16",
          "b827eb3fd714",
          "power"
        ]
      },
      "itemName": "sq_kuchl_power"
    }
  },

can i just delete the wrong things and safe the file?

Definitely on the right track!!

Yes, you can edit the json files by hand to delete the bogus Item-Channel links. But, you MUST stop openHAB before editing the file.

  • Stop openHAB
  • Make backup of json file in case you fat-finger something
  • Edit file
  • Start openHAB

One other thing…

If there are bogus Item-Channel links for the power item, I wonder if there also are bogus Item-Channel links for your other squeezebox items.

yes! no more errors!
thank you very much!

just one more thing: what is the squeezebox handler tryin’ to tell me?

2017-05-17 20:24:05.852 [INFO ] [ebox.handler.SqueezeBoxPlayerHandler] - player thing squeezebox:squeezeboxplayer:592AAC9D-2D85-4E22-9E16-B4460D36CE16:b827eb3fd714 has no server configured, ignoring command: REFRESH
2017-05-17 20:24:05.853 [INFO ] [ebox.handler.SqueezeBoxPlayerHandler] - player thing squeezebox:squeezeboxplayer:592AAC9D-2D85-4E22-9E16-B4460D36CE16:b827eb3fd714 has no server configured, ignoring command: REFRESH
2017-05-17 20:24:05.855 [INFO ] [ebox.handler.SqueezeBoxPlayerHandler] - player thing squeezebox:squeezeboxplayer:592AAC9D-2D85-4E22-9E16-B4460D36CE16:b827eb3fd714 has no server configured, ignoring command: REFRESH
2017-05-17 20:24:05.859 [INFO ] [ebox.handler.SqueezeBoxPlayerHandler] - player thing squeezebox:squeezeboxplayer:592AAC9D-2D85-4E22-9E16-B4460D36CE16:b827eb3fd714 has no server configured, ignoring command: REFRESH

I think it means that the player thing is not associated with a Squeezebox server.

In Paper UI, go to the Configuration page for your player. There’s a configuration parameter called Bridge Selection. That parameter should be the Thing UID of the Logitech Media Server.

Like this.

1 Like

perfect! my eternal gratitude goes to you, my friend!

You’re most welcome. Glad we got it working.

Now you can move on to what you really were trying to do before going down this rabbit hole. LOL

Hi!
I have a strange problem. I’m using voicerss.org as a text-to-speech service, and when a message is being played on my Squezebox Radio, some words or part of words are being skipped. For example, instead of the message:

“Good morning! Today weather forecast is 16 degrees, south wind with the speed 4 meters per second, …”

it plays:

“Good morn Today wer forecast es, south the speed per second…”

Each time different random parts are being skipped.
Moreover, after playing the morning greeting my OpenHAB rule commands Squeezebox to play an online radio stream. And it is being played with the same skipping of sounds! But right after I switch to another station using physical buttons on the player, and then switch back to the original station, it plays the stream like a charm, without any sound problems. So, looks like text-to-speech command sets some invalid playing settings, I’m not a professional here, so I don’t know which exactly.

Does anybody know what can be wrong?

No idea what couldbe wrong…but: actually since a few days (two weeks max. i guess…) I’m noticing a similar behavour: On the Squeezeplayer where I do all my TTS (Android phone with squeezeplayer, LMS on Synology NAS, selfmade local TTS)after reverting back to the radio stream from TTS, there are missing parts(like putting player on mute for a second or so) like you mention. Not having an issue with the TTS skipping though. Also the same: when i change the station to anotherone and back, normal operation resumes. I figured it was a problem with the squeezeplayer/LMS/router but reading your post made me wonder if it could be the binding. I’ll try to provoke the situation, put binding to DEBUG and report any findings…if any.
EDIT: OK, so i think i might have found something after going to TRACE. There are loads of “Updating channel currentPlayingTime” - and the sequence numbers are not in order, but seem to repeat - presumably when a skip happens. Look for state 16155 - it is followed by 16151 again!. Ever since i changed stations the numbers seem to rise only - and no more skipping.

2017-05-26 23:37:06.734 [TRACE] [ebox.handler.SqueezeBoxPlayerHandler] - Updating channel currentPlayingTime for thing xxx:yyy:zzz with mac mymac to state 16146
2017-05-26 23:37:06.736 [TRACE] [ebox.handler.SqueezeBoxPlayerHandler] - Updating channel currentPlayingTime for thing xxx:yyy:zzz with mac mymac to state 16147
2017-05-26 23:37:06.902 [TRACE] [ebox.handler.SqueezeBoxPlayerHandler] - Updating channel currentPlayingTime for thing xxx:yyy:zzz with mac mymac to state 16148
2017-05-26 23:37:07.902 [TRACE] [ebox.handler.SqueezeBoxPlayerHandler] - Updating channel currentPlayingTime for thing xxx:yyy:zzz with mac mymac to state 16149
2017-05-26 23:37:08.902 [TRACE] [ebox.handler.SqueezeBoxPlayerHandler] - Updating channel currentPlayingTime for thing xxx:yyy:zzz with mac mymac to state 16150
2017-05-26 23:37:09.902 [TRACE] [ebox.handler.SqueezeBoxPlayerHandler] - Updating channel currentPlayingTime for thing xxx:yyy:zzz with mac mymac to state 16151
2017-05-26 23:37:10.902 [TRACE] [ebox.handler.SqueezeBoxPlayerHandler] - Updating channel currentPlayingTime for thing xxx:yyy:zzz with mac mymac to state 16152
2017-05-26 23:37:11.902 [TRACE] [ebox.handler.SqueezeBoxPlayerHandler] - Updating channel currentPlayingTime for thing xxx:yyy:zzz with mac mymac to state 16153
2017-05-26 23:37:12.902 [TRACE] [ebox.handler.SqueezeBoxPlayerHandler] - Updating channel currentPlayingTime for thing xxx:yyy:zzz with mac mymac to state 16154
2017-05-26 23:37:13.902 [TRACE] [ebox.handler.SqueezeBoxPlayerHandler] - Updating channel currentPlayingTime for thing xxx:yyy:zzz with mac mymac to state 16155
2017-05-26 23:37:14.825 [TRACE] [ebox.handler.SqueezeBoxPlayerHandler] - Updating channel currentPlayingTime for thing xxx:yyy:zzz with mac mymac to state 16151
2017-05-26 23:37:15.902 [TRACE] [ebox.handler.SqueezeBoxPlayerHandler] - Updating channel currentPlayingTime for thing xxx:yyy:zzz with mac mymac to state 16152
2017-05-26 23:37:16.902 [TRACE] [ebox.handler.SqueezeBoxPlayerHandler] - Updating channel currentPlayingTime for thing xxx:yyy:zzz with mac mymac to state 16153
2017-05-26 23:37:17.902 [TRACE] [ebox.handler.SqueezeBoxPlayerHandler] - Updating channel currentPlayingTime for thing xxx:yyy:zzz with mac mymac to state 16154
2017-05-26 23:37:18.902 [TRACE] [ebox.handler.SqueezeBoxPlayerHandler] - Updating channel currentPlayingTime for thing xxx:yyy:zzz with mac mymac to state 16155

I hope this is a)related and b) usefull info :slight_smile:
Now quickly back to INFO logging or my harddrive will explode…
@roher could you do the same check and report the outcome?

This is strange. The Squeezebox TTS doesn’t change/set any of the Squeezebox player or server settings that could affect audio playback quality. It simply streams the voicerss content just like any other streaming content. I’d like to help, but I’m not even sure what to have you look into.

Nothing has changed in the binding in many weeks, so I’m not sure what to make of this.

Really strange. I notice that there’s a timecounter job that runs every second to update the playing time. I presume that if there are issues getting a free thread, the job might not update the playing time in a timely fashion. I’m not sure if it could cause the behavior you’re seeing in the logs.

Yes, of course I’ll try, either today evening or tomorrow.

But the fact that music stream behaves itself the same after TTS playback leads to some thoughts that it influences somehow…

I’ve switched to Openhab2 and started using the new Squeezebox binding about 3-2 weeks ago, and this problem is from the very beginning.

First, many thanks for taking the time to look into this!
Fun fact: i have a second squeezeplayer - both play the same stream and only the one that does the TTS is affected. The trace log of course is much more detailed - let me know if you want the whole thing. since it’s rather large, maybe i could rename it to .xml or .json and upload it here…
EDIT: i watched the log some more. Now i think there is no correlation between the sequence numbers and the skips. Watched several minutes with skips happening and the sequence numbers stayed in sync.
On the squeezeplayer app i see it going to “buffering” whenever skips happen.

That sounds right to me. I was having a hard time seeing how those two behaviors could be related.

Hmm. That’s really odd.

@Oli Did this work correctly for you at any time, or has it always been skipping since you started using TTS.

OH2 downloads the TTS content from VoiceRSS and caches it in the local directory userdata/voicerss/cache. When the Squeezeplayer requests the TTS content from OH2, OH2 streams the locally cached file to the player through the built in web server. I can’t imagine why the player would report buffering when the file is being streamed from the local network.

Let’s see if we can start ruling some things in or out.

If you look in the cache directory, you will see the mp3 files that have been cached, along with a txt file containing the text that was used to generate the mp3. Could you try putting one of those mp3 files in the conf/sounds directory, then playing it using the karaf console. You need to have your player set as the default audio sink. Like this:

openhab> smarthome:audio play name-of-file.mp3

Also, do a file name-of-file.mp3 from the Linux shell. It should look like this:

mark@ubuntu:/opt/openhab2/userdata/voicerss/cache$ file en-US_8bc88284b17081c54df4daa4576251f7.mp3
en-US_8bc88284b17081c54df4daa4576251f7.mp3: Audio file with ID3 version 2.4.0, contains: MPEG ADTS, layer III, v1,  56 kbps, 44.1 kHz, Monaural

Also would like to know what build of OH2 you are on.

Please report back the results.

It was working correctly for ages :slight_smile: can’t pin it down exactly, but I’d say the odd behavour started max. a month ago.

That don’t apply to my setup. I set up my own, local TTS. Which is not showing any skips while speaking.
I’m on openHAB 2.1.0 Build #925

Hi,

Took a file generated on May 26-th, the last time I used TTS and had problems with playback.

  1. When playing the file via karaf console there’ve been no problems, it was played ideally.
  2. Output of the file command is exactly like yours (except the filename of course).

But there is one interesting thing: yesterday I completely switched off both my home server and Squeezebox player for maintenance. After that, today morning, I tried to use my TTS rule again, and … wow! The text was spoken without any skips, and the radio-stream switched on by the rule after TTS playback, is also ideal, and is still playing at the time I’m writing this post. Don’t know how a reboot of the server and/or player could help, but looks like it helped somehow.

Thanks for the update. I’m actually relieved to hear that. I couldn’t find any reason why it would skip.

Hello,

jumping on this older thread, but since the latest updates I’ve run my TTS stopped working with error:

2017-07-29 13:30:48.038 [WARN ] [ebox.handler.SqueezeBoxPlayerHandler] - TIMEOUT after 30000 waiting for stop!

TTS works OK in general (invoking TTS from browser is working). General control like Pause,start, change Radio station is working as well.
I am on: openHAB 2.2.0 Build #996
Squeezebox is on:
2.2.0.201707272205 | SqueezeBox Binding | org.openhab.binding.squeezebox
Here is output of DEBUG log:

==> /var/log/openhab2/events.log <==
2017-07-29 13:46:26.059 [ItemCommandEvent          ] - Item 'JarvisInfo' received command 1

==> /var/log/openhab2/openhab.log <==
2017-07-29 13:46:26.626 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Set notification volume to: 80
2017-07-29 13:46:26.629 [DEBUG] [eezebox.internal.SqueezeBoxAudioSink] - Processing audioStream http://192.168.0.68:8080/audio/21930b5c-10ca-4bf8-bd4a-501bd261b010mp3 of format AudioFormat [codec=MP3, container=NONE, ]

==> /var/log/openhab2/events.log <==
2017-07-29 13:46:26.629 [ItemCommandEvent          ] - Item 'squeezeKuecheInfoVol' received command 80

==> /var/log/openhab2/openhab.log <==
2017-07-29 13:46:26.630 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Play notification sound on player 8f:da:44:dc:f4:10 at URI http://192.168.0.68:8080/audio/21930b5c-10ca-4bf8-bd4a-501bd261b010mp3
2017-07-29 13:46:26.630 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Cur State: vol=20, mut=NOT MUTED, pwr=ON, stp=NOT STOPPED, ctl=PLAYING, shf=OFF, rpt=OFF, tix=0, tnm=1, tim=457
2017-07-29 13:46:26.630 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Setting up player for notification
2017-07-29 13:46:26.631 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 8f:da:44:dc:f4:10 stop
2017-07-29 13:46:26.632 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 8f:da:44:dc:f4:10 mixer volume 80
2017-07-29 13:46:26.732 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 100 ms for volume to update
2017-07-29 13:46:26.733 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Playing notification
2017-07-29 13:46:26.733 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 8f:da:44:dc:f4:10 playlist add http://192.168.0.68:8080/audio/21930b5c-10ca-4bf8-bd4a-501bd261b010mp3
2017-07-29 13:46:27.234 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 500 ms for playlist to update
2017-07-29 13:46:27.235 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 8f:da:44:dc:f4:10 playlist index 1
2017-07-29 13:46:51.479 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: players 0
2017-07-29 13:46:57.264 [WARN ] [ebox.handler.SqueezeBoxPlayerHandler] - TIMEOUT after 30000 waiting for stop!
2017-07-29 13:46:57.264 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Restoring player state
2017-07-29 13:46:57.264 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 8f:da:44:dc:f4:10 mixer volume 0
2017-07-29 13:46:57.365 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 100 ms for volume to update
2017-07-29 13:46:57.365 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 8f:da:44:dc:f4:10 playlist delete 1
2017-07-29 13:46:59.068 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 1700 ms for playlist to update
2017-07-29 13:46:59.068 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Resuming last item playing
2017-07-29 13:46:59.069 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 8f:da:44:dc:f4:10 playlist index 0
2017-07-29 13:46:59.789 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Channel 'duration' does not exist.  Delete and readd player thing to pick up channel.
2017-07-29 13:46:59.789 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Channel 'duration' does not exist.  Delete and readd player thing to pick up channel.
2017-07-29 13:46:59.789 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Channel 'duration' does not exist.  Delete and readd player thing to pick up channel.
2017-07-29 13:47:00.171 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 1100 ms for playlist to update
2017-07-29 13:47:00.172 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 8f:da:44:dc:f4:10 time 457
2017-07-29 13:47:00.172 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Playing the playlist item
2017-07-29 13:47:00.172 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 8f:da:44:dc:f4:10 mixer volume 20
2017-07-29 13:47:00.273 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 100 ms for volume to update
2017-07-29 13:47:01.945 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Channel 'duration' does not exist.  Delete and readd player thing to pick up channel.
2017-07-29 13:47:01.946 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Channel 'duration' does not exist.  Delete and readd player thing to pick up channel.
2017-07-29 13:47:01.946 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Channel 'duration' does not exist.  Delete and readd player thing to pick up channel.

If you could take a look - is there any further info I should provide?
Many thanks in advance,
Best Regards,
-OLI

2017-07-29 13:46:26.733 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 8f:da:44:dc:f4:10 playlist add http://192.168.0.68:8080/audio/21930b5c-10ca-4bf8-bd4a-501bd261b010mp3

This looks suspicious as the . is missing before the mp3. I suspect this is related to a recent ESH change.

Bummer. First, of course thanks for the quick reply. Indeed this makes sense. What can we do here?
Also I removed/readded the Player thing because of this:
Channel ‘duration’ does not exist. Delete and readd player

But the message stays. I suppose this is not critical?