Play say command to raspberry headphone plug

Using openhab 2.2.0 on Raspberry 3

I have a problem playing any say command from rules to the default raspberry 3 headphone plug.

shell command “aplay test.wav” works.

openhab karaf console “voice voices” returned:
marytts:bits1hsmm bits1-hsmm - Deutsch
marytts:bits3hsmm bits3-hsmm - Deutsch
marytts:cmuslthsmm cmu-slt-hsmm - Englisch

bits3-hsmm - Deutsch is the default voice.

But karaf console command “voice say Hello” does not play any sound to the raspberry headphone plug. There are no errors or warnings in openhab.log.

If I set the audio default sink in PaperUI to any ChromeCast device, they voice say command works. I can hear thie voice.

But if I set the audio default sink to “System Speaker (with mp3 support)” I can hear nothing. I excpeted to hear anything from the raspberry headphone plug.

What’s wrong?

I did not test this yet, but maybe sound output is set to hdmi?

May be that out is set to HDMI. I have no HDMI device with speakers nearby to test this.

But how to change it to the earphone plug?

In openhab audio configuration I can choose

I would try alsamixer.

By the way: Is the openhab user member of group audio?

Using alsamixer I selected the soundcard “bcm2835 ALSA”, volume was set to 100.
user openhab wasn’t a member of group audio, I added him to the group. But no changes!

from openhab karaf console:
audio play enhancedjavasound doorbell.mp3 - does not work, I excpected to hear the sound from headphone plug
audio play chromecast:chromecast:d7ecxxx doorbell.mp3 - works, I can hear the sound from my ChromeCast device

from raspian command shell I can hear the sound from headphone plug using
omxplayer /etc/openhab2/sounds/doorbell.mp3

had the same problem on the raspberry3.

There was an error entry “error creating audio device” in log:tail
Thanks to Udo for the hint to group/member

adding openhab to the group audio solved the problem.

first I tested my hardware:

the test was ok , I edited /etc/group

in /etc/group :
entry audio
was: audio:x:29:openhabian
must be: audio:x:29:openhabian,openhab

if you know what you do :
edit the group file with nano
do a reboot, then it works

Or simply use

sudo adduser openhab audio

you don’t need to edit files manually… :wink:

yes , this is the better way

I know I’m too late for discussion but, be sure in ‘Configuration’ > ‘Audio’ you’ve selected ‘System Speaker’.