Unable to change the volume from Systemspeaker after upgrade to OH 4.0.2 - Solved

(I found the sollution while writing this, so I though, maybe helpfull for anyone facing this problem)

I upgraded from OH 3.4.2 to 4.0.2 and i’m unable to change the volume from my Say commands.

My speech (Google TTS) is being output to the systemspeaker (3.5mm jack plug). I use a function which sets the volume via a commandline, after that the say command is started. Here is a small piece from my rule code:

executeCommandLine("amixer", "sset", "Headphone", volume+"%") tmrWait = createTimer(now.plusSeconds(1), [| say(strToBeSaid, strVoiceType, "enhancedjavasound", new PercentType(volume)) ])

This doesn’t work anymore in my OH4 (openhabian) installation on a Raspberry Pi4. I’m not sure why but the sollution was changing the executecommandline to set PCM instead of Headphone. By executing [amixer scontrols], i got [Simple mixer control ‘PCM’,0]. Not sure if this is related to the new Linux version, but I can imagine it is.

So for everyone having such a problem, check the output via amixer scontrols, and use that output device.

1 Like