OH3: Volume control „Master“ is missing

Hmm tried that, didn’t have an error anymore. But also doens’t do anything strange enough. It looks like it executed without logging anything, and the volume didn’t change:

executeCommandLine(Duration.ofSeconds(1),"amixer", "sset" , "Master", "79%")
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 52429 [80%] [on]
  Front Right: Playback 52429 [80%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 65536
  Front Left: Capture 65536 [100%] [on]
  Front Right: Capture 65536 [100%] [on]

It stays at 100%, when playing an mp3 via playsound or say action. Including the error:

Cannot determine master volume level - assuming 100%

That’s even more interesting that you still have this error message because you already have a master volume control.
I did a fresh install of openHABian and “Master” is missing.
Seems that something is wrong with openHABian’s sound configuration

Could you please post the content of this file?

/var/lib/alsa/asound.state

I want to update my file with your settings

Yes, this is the file:

state.Headphones {
        control.1 {
                iface MIXER
                name 'Headphone Playback Volume'
                value 400
                comment {
                        access 'read write'
                        type INTEGER
                        count 1
                        range '-10239 - 400'
                        dbmin -9999999
                        dbmax 400
                        dbvalue.0 400
                }
        }
        control.2 {
                iface MIXER
                name 'Headphone Playback Switch'
                value true
                comment {
                        access 'read write'
                        type BOOLEAN
                        count 1
                }
        }
}

did you try? Headphone

executeCommandLine("amixer", "set" , "Headphone", "50%")

worked on me rpi3 b oh3

executeCommandLine("amixer", "set" , "Headphone", Volume.state.toString +"%")

Yeah, i did try it already but to be sure tested it again as this:

executeCommandLine(Duration.ofSeconds(1),"amixer", "sset" , "Headphones", "30%")
executeCommandLine(Duration.ofSeconds(1),"amixer", "set" , "Headphones", "30%")
executeCommandLine(Duration.ofSeconds(1),"amixer", "set" , "Headphone", "30%")

but the log doesn’t show anything and the volume doesnt change:

[14:16:24] openhabian@openHABianDevice:~$ amixer
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 52429 [80%] [on]
  Front Right: Playback 52429 [80%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 65536
  Front Left: Capture 65536 [100%] [on]
  Front Right: Capture 65536 [100%] [on]

that works but the problem remains that it does not work with this command:

playSound("enhancedjavasound", "doorbell.mp3", new PercentType(100))

as playSound seems to address “Master” volume control only.
that problem is a known problem which has already been fixed
https://community.openhab.org/t/warning-audio-sink-warning-master-volume-level/44789/5
for any reason it reapeared in openhabian

Not sure why, but i don’t hear anything now. I rebooted a couple of times. Lots of troubles in my rules in upgrading from OH2.5 to OH3. I use a lot of datetime items and there has been a lot of changes… In the meanwhile trying to get openhab to speak/make sound.

[15:11:46] openhabian@openHABianDevice:~$ amixer -c 0 cset numid=3 100%
amixer: Cannot find the given element from control hw:0

[15:12:18] openhabian@openHABianDevice:~$ amixer sset Master 100%
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 65536 [100%] [on]
  Front Right: Playback 65536 [100%] [on]

Seems like it’s getting worse for some reasons.

probably the ID is wrong. You can get it by amixer controls. please post the results.
Anyway, you do’t need that command as amixer sset Master 100% works for you

That’s the strange part, if I execute amixer controls, i get:

numid=4,iface=MIXER,name='Master Playback Switch'
numid=3,iface=MIXER,name='Master Playback Volume'
numid=2,iface=MIXER,name='Capture Switch'
numid=1,iface=MIXER,name='Capture Volume'

amixer sset Master 100% works indeed, but i don’t hear anything when i test it with: speaker-test

Something went wrong but can’t think of anything that has been changed in the meanwhile…

did you do an update or a clean install?
Before fresh install, everything was working fine.

I did a clean install. On a new raspberry pi4b. I’m not sure if I did a restore or not. Having a lot of problems upgrading. But I think the last (this) time i did complete clean install because of some problems with reverse proxy and sitemaps which were unreachable.

Everything is/was working without any problem on my pi3b with openhab 2.5.10 (it’s still my main openhab server, but i shut it down to migrate the new pi4 to openhab 3.0)

I just did a clean install and it just won’t work. The last time i tried a couple of things but the situation is now complete clean install and for some reason the 3.5mm device isn’t recognised on the Rpi4b.

I tried a couple of things:

[10:30:15] openhabian@openHABianDevice:~$ amixer controls
numid=2,iface=MIXER,name='Headphone Playback Switch'
numid=1,iface=MIXER,name='Headphone Playback Volume'
[10:30:39] openhabian@openHABianDevice:~$ amixer sset Master 100%
amixer: Unable to find simple control 'Master',0

[10:30:41] openhabian@openHABianDevice:~$ amixer sset Headphone 100%
Simple mixer control 'Headphone',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback -10239 - 400
  Mono: Playback 400 [100%] [4.00dB] [on]

And it says that the device is mono, and that’s not correct. it’s a stereo output. I connected a stereo speaker but i got no sound. Anyone has an idea what to do?

(I just saw i used the image: openhabian-pi-raspios32-v1.6.2.img.xz in stead of openhabian-pi-raspios32-v1.6.2b.img.xz, does that matter?)

Ok, really strange. Due to some problems with Telegram binding (My old 2.5 is still running and Telegram conflicts when you connect more then one instance to a botToken) A bug in the binding kept spitting errors in the log, know issue, and i had to stop openhab and clean cache.

Just out of curiosity I checked again if i had sound, and i got speech working. I can change volume with amixer sset Headphone 100%. I’m testing it via karaf at the moment, because of the migration. The log keeps getting this error:

Cannot determine master volume level - assuming 100%

Now you are exactly at the same point where I am :slight_smile:
At least this behaviour is reproducable.

I started a ticket on github:
https://github.com/openhab/openhab-distro/issues/1237

1 Like

bash scripts are also not working. same to you?
currently investigating in this problem…
seems that openhabian 1.6.2 is a little bit buggy…

To be honest, it isn’t verry stable in my opinion. but maybe i’m doing some things wrong.

Im struggling a lot since upgrade at least.

Bash is working for me by the way. I use it as : executeCommand(“bash”,“somefile.sh”) > and added it to the whitelist without bash.

But as now I experience:

  • Logtail is gone after restart openhab > have to reinstall it every time via openhabian-config
  • Google Cloud TTS doesn’t work after reboot (just hear noise or nothing), this was a part of the problem above, i thought it was the sound config, but it was both…
  • executeCommand doesn’t show anything in the log

are bash scripts working from command line?

Yup, i have a simple script to read a folders contents. Tried it just now and it works. doesn’t bash work at your installation?

not from command line. I need to run each script with bash scriptfile.sh instead of scriptfile.sh