0

I want to report a very weird thing I've noted on my laptop.

Basically, I set the volume to, let's say, max level because I'm watching a movie. Then I pause the movie, and get away from the pc for the time needed for the lock screen to activate. I unlock the session and the volume is at 20% or 30%.

How is that possible that the audio volume level changes during lock screen without touching anything?

1 Answer 1

1

similar issue here.

Before lockscreen the sound output is set to headset. After lockscreen it is changed to speakers. After each login I have to restore alsasound-settings:

alsactl --file xyz restore

I found some posts how to write a shell script to restore settings after login. But I couldn't test at the moment.


Update

Maybe this bash script could help:

gdbus monitor -y -d org.freedesktop.login1 | while read -r line; do
    if grep -q org.freedesktop.login1.Session.Unlock; then
        sleep 0.1
        sudo alsactl --file /Path/To/File/asound.state restore
    fi
done

On my system it needs the sleep time. Otherwise the script runs to early and "alsactl ... restore" does not work.

You can run it as a deamon, so you don't have to start manuelly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.