Volume level drops back to default level when logging out of desktop  [Solved]

Message
Author
BitterTruth
Posts: 620
Joined: Tue Sep 22, 2020 7:36 pm

Re: Volume level drops back to default level when logging out of desktop

#31 Post by BitterTruth »

dolphin_oracle wrote: Tue Aug 08, 2023 2:12 pm I do believe something is happening at logout when running systemd that is setting the alsa sound level to 40%, removing the user from the audio group prevents that, but we've had it that way for a long time without an ill effect.
Could it be the login manager doing something or the way you are logging in?

console =====> startx,
xinitrc
login manager

@siamhe how are you logging in btw?
I didn't see this minor issue when using pulseaudio with MX-21 and multiple desktops with systemd.
Points more and more to pipewire and wireplumber then?

The configuration files for wireplumber are in ~/.config/wireplumber/ (user configuration), /etc/wireplumber/ (global configuration), and then /usr/share/wireplumber/ (stock configuration).

If you guys are feeling brave enough you can have a look in there. Some people have had good results deleting their user configuration or replacing it with the stock one. If you don't want to do that, you could create a temporary user and see if the same problem occurs. That'll give you a clue that maybe it's your wireplumber config.

User avatar
richb
Administrator
Posts: 10901
Joined: Wed Jul 12, 2006 2:17 pm

Re: Volume level drops back to default level when logging out of desktop

#32 Post by richb »

The same set back to 40% happens as well in my KDE install. I have considered it a minor issue.
Forum Rules
Guide - How to Ask for Help

richb Administrator
System: MX 23 KDE
AMD A8 7600 FM2+ CPU R7 Graphics, 16 GIG Mem. Three Samsung EVO SSD's 250 GB

User avatar
siamhie
Global Moderator
Posts: 3381
Joined: Fri Aug 20, 2021 5:45 pm

Re: Volume level drops back to default level when logging out of desktop

#33 Post by siamhie »

BitterTruth wrote: Tue Aug 08, 2023 2:38 pm
dolphin_oracle wrote: Tue Aug 08, 2023 2:12 pm I do believe something is happening at logout when running systemd that is setting the alsa sound level to 40%, removing the user from the audio group prevents that, but we've had it that way for a long time without an ill effect.
Could it be the login manager doing something or the way you are logging in?

console =====> startx,
xinitrc
login manager

@siamhe how are you logging in btw?

I've already mentioned this happens with LightDM (fluxbox, XFCE) and SDDM (KDE).
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

User avatar
siamhie
Global Moderator
Posts: 3381
Joined: Fri Aug 20, 2021 5:45 pm

Re: Volume level drops back to default level when logging out of desktop

#34 Post by siamhie »

richb wrote: Tue Aug 08, 2023 2:51 pm The same set back to 40% happens as well in my KDE install. I have considered it a minor issue.

@richb I'm going to go ahead and call it a nuance but livable as I'll explain below.


@dolphin_oracle
I don't think there is anything we can do about the volume dropping when logging out and in to the desktop while booted to systemd.

I downloaded the Debian 12.1 Gnome live ISO and it also uses Pipewire for the audio server. XFCE and KDE versions use PulseAudio.
When logging out of the desktop and back in the volume level dropped back to their default value.


I set the master volume to 100
volume-level-100.png

After I log back in it resets to default of 36
volume-level-36.png
You do not have the required permissions to view the files attached to this post.
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

User avatar
dolphin_oracle
Developer
Posts: 22281
Joined: Sun Dec 16, 2007 12:17 pm

Re: Volume level drops back to default level when logging out of desktop

#35 Post by dolphin_oracle »

Give that a user group has some interaction I’m actually blaming systemd’s user session management.

so a one-liner to remove a user from the audio group:

Code: Select all

gpasswd -d USER audio

and for any future users, you could edit /etc/adduser.conf and look for the line with the EXTRA_GROUPS and remove audio from it.
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.

User avatar
siamhie
Global Moderator
Posts: 3381
Joined: Fri Aug 20, 2021 5:45 pm

Re: Volume level drops back to default level when logging out of desktop

#36 Post by siamhie »

dolphin_oracle wrote: Tue Aug 08, 2023 4:29 pm Give that a user group has some interaction I’m actually blaming systemd’s user session management.

so a one-liner to remove a user from the audio group:

Code: Select all

gpasswd -d USER audio

and for any future users, you could edit /etc/adduser.conf and look for the line with the EXTRA_GROUPS and remove audio from it.

I'm kinda of blaming both pipewire and systemd for this. PulseAudio never needed the user removed from the audio group when booted to systemd.


@dolphin_oracle Can editing the adduser.conf be done during the live ISO install? I'm thinking of removing the spare SSD and reinstall MX-23 fluxbox.
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

User avatar
dolphin_oracle
Developer
Posts: 22281
Joined: Sun Dec 16, 2007 12:17 pm

Re: Volume level drops back to default level when logging out of desktop

#37 Post by dolphin_oracle »

siamhie wrote: Tue Aug 08, 2023 5:12 pm
dolphin_oracle wrote: Tue Aug 08, 2023 4:29 pm Give that a user group has some interaction I’m actually blaming systemd’s user session management.

so a one-liner to remove a user from the audio group:

Code: Select all

gpasswd -d USER audio

and for any future users, you could edit /etc/adduser.conf and look for the line with the EXTRA_GROUPS and remove audio from it.

I'm kinda of blaming both pipewire and systemd for this. PulseAudio never needed the user removed from the audio group when booted to systemd.


@dolphin_oracle Can editing the adduser.conf be done during the live ISO install? I'm thinking of removing the spare SSD and reinstall MX-23 fluxbox.
yes, but you'll still need to remove the default user from the group.
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.

User avatar
siamhie
Global Moderator
Posts: 3381
Joined: Fri Aug 20, 2021 5:45 pm

Re: Volume level drops back to default level when logging out of desktop  [Solved]

#38 Post by siamhie »

I finally cracked the code.

To recap, when you boot up to systemd and log out of the desktop and then log back in, the volume level gets reset back to 40% regardless if you've set a predetermined level (say 50%) in pavucontrol.

If you have set a predetermined level (say 50%) and reboot the computer, the volume level will stay at 50% at login. Seems to only get reset when logging out of the desktop and back in.
This does not happen if you boot up in sys-v, only systemd.


The fix.
Edit the file policy-device-routes.lua in /usr/share/wireplumber/scripts

Code: Select all

-- the default volume to apply
default_volume = tonumber(config["default-volume"] or 0.4^3)
and change the value 0.4^3 to the volume level you want to set it to. I have tested all these values and they work.

10% volume

Code: Select all

0.1^3
20% volume

Code: Select all

0.2^3
30% volume

Code: Select all

0.3^3
40% volume

Code: Select all

0.4^3
50% volume

Code: Select all

0.5^3
60% volume

Code: Select all

0.6^3
70% volume

Code: Select all

0.7^3
80% volume

Code: Select all

0.8^3
90% volume

Code: Select all

0.9^3
100% volume

Code: Select all

1.0
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

BV206
Posts: 499
Joined: Sat Mar 09, 2019 10:55 am

Re: Volume level drops back to default level when logging out of desktop

#39 Post by BV206 »

siamhie wrote: Sat May 25, 2024 12:39 pm I finally cracked the code.
I don't have a /usr/share/wireplumber/scripts/policy-device-routes.lua. Is it supposed to exist already or do you have to create it?

Do you know of a similar way to set the input audio level?

User avatar
siamhie
Global Moderator
Posts: 3381
Joined: Fri Aug 20, 2021 5:45 pm

Re: Volume level drops back to default level when logging out of desktop

#40 Post by siamhie »

BV206 wrote: Sat May 25, 2024 12:57 pm
siamhie wrote: Sat May 25, 2024 12:39 pm I finally cracked the code.
I don't have a /usr/share/wireplumber/scripts/policy-device-routes.lua. Is it supposed to exist already or do you have to create it?

Do you know of a similar way to set the input audio level?

Are you using MX-23? MX-21 uses PulseAudio for it's sound server. (post your QSI)
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

Locked

Return to “Hardware /Configuration”