Limit sound output

I have a question about limiting sound output. Locking it down so that it cannot be adjusted by a non-sudo user.

Use Case:
I have an autistic step-son how likes to use youtube and does not always do a good job at controlling the volume. I'd like to set a max limit that he cannot adjust beyond, but I'm not sure where to start.

I could hide the sound icon in the system tray, but he would probably figure that out.

Any suggestions?

I appreciate a lot the clarity of your use case!

Hiding the icon in the tray is one thing, what bout disabling it completely?
Would he figure out how to re-enable it from the tray's configuration window? (which is not the tray overflow).

EDIT: There are ways to set default sound volumes but nothing says a user could not override it afterwards, so I doubt that would work.

1 Like

What is the desktop environment? KDE?

If the maximum volume were tucked away in a settings menu (not just in the tray), would that be sufficient obfuscation? Or will that likely be discovered?

You can use amixer to set master volume levels from the terminal, for example to take it down to 75% I believe you would use:

amixer set Master 25%-

You will have to experiment to find some settings that work for you of course. You can find the man pages here: amixer(1) — Arch manual pages and if you want to go deep here you go: Advanced Linux Sound Architecture - ArchWiki

4 Likes

No, he probably wouldn't figure that out.

How do I disable it?

@BluishHumility setting the volume from the cmd line is brilliant !!!

I'd like to implement both solutions. Disable the GUI control and then I can set the volume from the cmd line. This is something that I could add to his .bashrc

1 Like

I forgot to check last night on my machine whether KDE allows this or not (I assume you run KDE). But if KDE allows to disable it (and not just hide it), when you open up Systray Configuration panel you can select individual entries’ behavior. DISABLED would be one of them in the small drop-down menu, if KDE allows it.

In the old KDE it was possible, not sure yet on the recent one, still Whoogling around.
However you could try this, but it’s from older Plasma 5 version, I cannot confirm ATM if it still works:

Edit `~/.config/kmixrc` and add the line:

showOSD=false
2 Likes

Sorry, I did forget to mention that I am running kde.

I do see the kmixrc file in .config. I'll test to see if setting showOSD=false still works.

1 Like

Just tested it and it doesn't work.

However it is possible to disable from the GUI.

  • Right-click Systray down chevron/arrow - Configure System Tray
  • Go to ENTRIES
  • Go to HARDWARE CONTROL/AUDIO VOLUME
  • From drop-down select DISABLED
2 Likes

My options appear to be different. When I right-click the system tray I have the following:

Audio Volume
-Force mute all playback devices
-Configure audio devices
-Configure audio volume
-Latte
-Edit panel

You're probably not clicking on the down arrow. Or you configured your systray to unhide every icon so no arrow is showing.

There is still a spot on the systray where you can right-click and access Configure System Tray... There is always that spot but it could be tiny to find depending your particular configuration.

I wonder if I can find a video somewhere I know there are some I've seen them in past.

EDIT: There is another way, choose Edit Panel.
This will edit your latte-dock top bar panel. Then when you hover mouse over the systray, you will be presented with a small double-slider icon on the left of the OSD displaying System Tray inside.

You click that double-slider and you find yourself in the same Configuration panel for systray.

5 Likes

Ah, that was it. Thanks for being patient with me.

This is good enough a solution for me.

Thanks for everyone's help.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.