[SOLVED] Using squeezebox as audio sink for TTS

Hello,

I’m running squeezebox (server & player) with max2play on a RPI. I want to use this as a default audio sink for notifications and TTS. For TTS I’ve tried PicoTTS and now I’m using googles cloud service.

Playing a notification with playSound("doorbell.mp3", new PercentType(100)) works pretty well. Unfortunately I’ve some problems using say("The garage door is open!", new PercentType(100)). If I have a look at the Squeezebox server it shows a playing notification but I can’t hear anything. I managed to copy an URL (often I only get a 404 error) which is shown in Squeezebox and I was able to play the audio file in the browser. Therefore I assume the TTS is working in general.

I can’t see any hints in the logs. Does someone have any idea how I can investigate this issue deeper?

Thanks!

What type of audio format are you getting from the TTS service? The LMS (Squeezebox Server) has trouble playing some WAV files.

The other thing you can try… Take one of the files you get from the TTS service and load it into the LMS library. Then play it directly from the LMS. This will remove anything to do with openHAB from the mix. If the file still doesn’t play, then it’s likely that the LMS has an issue with the audio file format.

PicoTTS returned WAV and Google sems to return mp3.

Thank you for the hint. How can I get the file from the TTS service? The only way I know is looking at the LMS, trying to copy the URL and hoping that I’m fast enought to not get an 404 error.

I’m not sure about those two services. With VoiceRSS, which is what I use, the files are cached in the userdata/voicerss directory. Perhaps there’s a similar cache for the other services.

I found the cached files. For google they’re located at /var/lib/openhab2/cache/org.openhab.voice.googletts$. Uploading the files to the LMS and playing them worked for me.

I also tried to use voicerss, with the same effect.

What version of openHAB are you running, and what version of the LMS are you running?

Also, can you put the squeezebox binding in debug mode, then try to issue the say command? Post the debug messages here, and I’ll take a look.

log:set DEBUG org.openhab.binding.squeezebox

I’m running openHAB 2.4.0 and LSM Logitech Media Server Version: 7.9.1 - 1522157629

2019-02-13 20:53:22.673 [DEBUG] [eezebox.internal.SqueezeBoxAudioSink] - Processing audioStream http://192.168.0.156:8080/audio/bbec7973-87fe-4bc8-8c8a-f01421e413c6.mp3 of format AudioFormat [codec=MP3, container=NONE, bitDepth=16, bitRate=64000, frequency=44100]
2019-02-13 20:53:22.676 [DEBUG] [rnal.handler.SqueezeBoxPlayerHandler] - Play notification sound on player 74:da:38:3e:d0:4d at URI http://192.168.0.156:8080/audio/bbec7973-87fe-4bc8-8c8a-f01421e413c6.mp3
2019-02-13 20:53:22.678 [DEBUG] [ternal.handler.SqueezeBoxPlayerState] - Cur State: vol=100, mut=NOT MUTED, pwr=ON, stp=STOPPED, ctl=PAUSED, shf=OFF, rpt=OFF, tix=0, tnm=1, tim=0
2019-02-13 20:53:22.681 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Setting up player for notification
2019-02-13 20:53:22.683 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Adding notification message to playlist
2019-02-13 20:53:22.686 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: 74:da:38:3e:d0:4d playlist add http://192.168.0.156:8080/audio/bbec7973-87fe-4bc8-8c8a-f01421e413c6.mp3 Notification
2019-02-13 20:53:23.188 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Playlist updated
2019-02-13 20:53:23.192 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Playing notification
2019-02-13 20:53:23.196 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: 74:da:38:3e:d0:4d playlist index 1
==> /var/log/openhab2/events.log <==
2019-02-13 20:53:23.710 [vent.ItemStateChangedEvent] - squeezboxWohnzimmer_control changed from PAUSE to PLAY
2019-02-13 20:53:23.714 [vent.ItemStateChangedEvent] - squeezboxWohnzimmer_stop changed from ON to OFF
==> /var/log/openhab2/openhab.log <==
2019-02-13 20:53:24.096 [DEBUG] [rnal.handler.SqueezeBoxPlayerHandler] - Trying to download the content of URL http://192.168.0.108:9000/html/images/radio.png
==> /var/log/openhab2/openhab.log <==
2019-02-13 20:53:43.429 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Notification message timed out after 20 seconds
2019-02-13 20:53:43.435 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Restoring player state
2019-02-13 20:53:43.439 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: 74:da:38:3e:d0:4d mixer volume 0
2019-02-13 20:53:43.445 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Removing notification message from playlist
2019-02-13 20:53:43.450 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: 74:da:38:3e:d0:4d playlist delete 1
==> /var/log/openhab2/events.log <==
2019-02-13 20:53:43.796 [vent.ItemStateChangedEvent] - squeezboxWohnzimmer_volume changed from 100 to 0
2019-02-13 20:53:43.917 [vent.ItemStateChangedEvent] - squeezboxWohnzimmer_control changed from PLAY to PAUSE
2019-02-13 20:53:43.925 [vent.ItemStateChangedEvent] - squeezboxWohnzimmer_stop changed from OFF to ON
2019-02-13 20:53:44.084 [vent.ItemStateChangedEvent] - squeezboxWohnzimmer_control changed from PAUSE to PLAY
2019-02-13 20:53:44.090 [vent.ItemStateChangedEvent] - squeezboxWohnzimmer_stop changed from ON to OFF
==> /var/log/openhab2/openhab.log <==
2019-02-13 20:53:44.457 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Playlist updated
2019-02-13 20:53:44.461 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: 74:da:38:3e:d0:4d playlist index 0
2019-02-13 20:53:44.465 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: 74:da:38:3e:d0:4d time 0
2019-02-13 20:53:44.469 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Stopping the player
2019-02-13 20:53:44.472 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: 74:da:38:3e:d0:4d stop
2019-02-13 20:53:44.476 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: 74:da:38:3e:d0:4d mixer volume 100
2019-02-13 20:53:44.481 [DEBUG] [rnal.handler.SqueezeBoxPlayerHandler] - SqueezeBoxTimeoutException during notification: Notification message timed out
==> /var/log/openhab2/events.log <==
2019-02-13 20:53:45.144 [vent.ItemStateChangedEvent] - squeezboxWohnzimmer_volume changed from 0 to 100
2019-02-13 20:53:45.159 [vent.ItemStateChangedEvent] - squeezboxWohnzimmer_control changed from PLAY to PAUSE
2019-02-13 20:53:45.169 [vent.ItemStateChangedEvent] - squeezboxWohnzimmer_stop changed from OFF to ON

Hmm. Everything looks ok, but then the notification times out.

2019-02-13 20:53:43.429 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Notification message timed out after 20 seconds

What type of player are you using? Any chance it’s a piCorePlayer whose version is older than 3.20?

I’m running max2play (http://max2play.com/) on an RaspberryPi. As a player it includes Squeezelite Max2Play v1.0.2 based on v1.8.4-726, Copyright 2012-2015 Adrian Smith, 2015-2016 Ralph Irving.

Squeezelite Max2Play v1.0.2 based on v1.8.4-726

From the known issues

There are some versions of squeezelite that will not correctly play very short duration mp3 files. Versions of squeezelite after v1.7 and before v1.8.6 will not play very short duration mp3 files reliably. For example, if you’re using piCorePlayer (which uses squeezelite), please check your version of squeezelite if you’re having trouble playing notifications. This bug has been fixed in squeezelite version 1.8.6-985, which is included in piCorePlayer version 3.20.

Any possibility you can get a max2play with a newer version of squeezelite?

1 Like

Great! Thank you very much. There was a new version available Squeezelite Max2Play v1.0.3 based on v1.8.7-999, Copyright 2012-2015 Adrian Smith, 2015-2017 Ralph Irving.

Sorry for overlooking the hint in the binding docs :unamused:

Great! Let me know if that resolves the issue.

No worries.

Yes. It resolved the issues and now it’s working very well.

1 Like

Great work.:+1:

I edited the title the start with [Solved].

If you would, please add the solution post to the topic by clicking the square box (Lower right corner) on the post that provided the solution. This will help others with similar issues find a quick solution. You can also click the heart icon as well, next to the square box, and give a thanks to any post.:wink:

Thanks

Hi together,

Actually I have exactly the same problem. After playing a notification, the volume is set to 0 %. And some mp3 files aren´t played at all.

I updated my squeezelite version already to 1.9.0-1119 in a first step and now to the latest (?) version 1.9.6-1198.

Does anybody know if these new version have the issue again or can confirm that they don´t have it? Otherwise I believe the issue is in again. At least I don´t have it when playing notifications via my Windows tablets with Squeezelite-X.

I would also like to try the version 1.8.6, but I don´t know where to get the file from. I need it for running on a Raspberry.

I get following debug logging when successfully playing a file:

2020-01-05 19:59:06.881 [DEBUG] [eezebox.internal.SqueezeBoxAudioSink] - Processing audioStream http://192.168.178.25:8081/audio/2dc2904a-4971-45f6-a608-dd7bd7ae520c.mp3 of format AudioFormat [codec=MP3, container=NONE, ]

2020-01-05 19:59:06.882 [DEBUG] [rnal.handler.SqueezeBoxPlayerHandler] - Play notification sound on player ab:cd:ef:12:34:61 at URI http://192.168.178.25:8081/audio/2dc2904a-4971-45f6-a608-dd7bd7ae520c.mp3

2020-01-05 19:59:06.883 [DEBUG] [ternal.handler.SqueezeBoxPlayerState] - Cur State: vol=0, mut=NOT MUTED, pwr=ON, stp=STOPPED, ctl=PAUSED, shf=OFF, rpt=OFF, tix=0, tnm=1, tim=0

2020-01-05 19:59:06.884 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Setting up player for notification

2020-01-05 19:59:06.884 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 mixer volume 75

2020-01-05 19:59:06.985 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Adding notification message to playlist

2020-01-05 19:59:06.987 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 playlist add http://192.168.178.25:8081/audio/2dc2904a-4971-45f6-a608-dd7bd7ae520c.mp3 Notification

2020-01-05 19:59:07.389 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Playlist updated

2020-01-05 19:59:07.390 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Playing notification

2020-01-05 19:59:07.390 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 playlist index 1

2020-01-05 19:59:14.102 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Restoring player state

2020-01-05 19:59:14.103 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 mixer volume 0

2020-01-05 19:59:14.104 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Removing notification message from playlist

2020-01-05 19:59:14.105 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 playlist delete 1

2020-01-05 19:59:15.709 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Playlist updated

2020-01-05 19:59:15.709 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 playlist index 0

2020-01-05 19:59:15.714 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 time 0

2020-01-05 19:59:15.715 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Stopping the player

2020-01-05 19:59:15.716 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 stop

2020-01-05 19:59:15.717 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 mixer volume 0

2020-01-05 19:59:23.791 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: players 0

And the following when playing the file doens´t work at all:

2020-01-05 20:04:11.174 [DEBUG] [eezebox.internal.SqueezeBoxAudioSink] - Processing audioStream http://192.168.178.25:8081/audio/a2cbee63-2121-4065-8317-f13c4481ac61.mp3 of format AudioFormat [codec=MP3, container=NONE, ]`

2020-01-05 20:04:11.174 [DEBUG] [rnal.handler.SqueezeBoxPlayerHandler] - Play notification sound on player ab:cd:ef:12:34:61 at URI http://192.168.178.25:8081/audio/a2cbee63-2121-4065-8317-f13c4481ac61.mp3

2020-01-05 20:04:11.175 [DEBUG] [ternal.handler.SqueezeBoxPlayerState] - Cur State: vol=0, mut=NOT MUTED, pwr=ON, stp=STOPPED, ctl=PAUSED, shf=OFF, rpt=OFF, tix=0, tnm=1, tim=0

2020-01-05 20:04:11.175 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Setting up player for notification

2020-01-05 20:04:11.176 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 mixer volume 75

2020-01-05 20:04:11.277 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Adding notification message to playlist

2020-01-05 20:04:11.278 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 playlist add http://192.168.178.25:8081/audio/a2cbee63-2121-4065-8317-f13c4481ac61.mp3 Notification

2020-01-05 20:04:11.679 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Playlist updated

2020-01-05 20:04:11.680 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Playing notification

2020-01-05 20:04:11.681 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 playlist index 1

2020-01-05 20:04:23.800 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: players 0

2020-01-05 20:04:31.913 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Notification message timed out after 20 seconds

2020-01-05 20:04:31.914 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Restoring player state

2020-01-05 20:04:31.916 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 mixer volume 0

2020-01-05 20:04:31.917 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Removing notification message from playlist

2020-01-05 20:04:31.918 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 playlist delete 1

2020-01-05 20:04:33.822 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Playlist updated

2020-01-05 20:04:33.823 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 playlist index 0

2020-01-05 20:04:33.825 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 time 0

2020-01-05 20:04:33.826 [DEBUG] [handler.SqueezeBoxNotificationPlayer] - Stopping the player

2020-01-05 20:04:33.827 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 stop

2020-01-05 20:04:33.827 [DEBUG] [rnal.handler.SqueezeBoxServerHandler] - Sending command: ab:cd:ef:12:34:61 mixer volume 0

2020-01-05 20:04:33.828 [DEBUG] [rnal.handler.SqueezeBoxPlayerHandler] - SqueezeBoxTimeoutException during notification: Notification message timed out

Before I forget it, I run openHAB 2.5 and LMS 7.9.1.

Would be great when one could help.