Behringer USB sound interface looses volume setting

Need help with peripherals or devices?
Message
Author
gusnan
Posts: 47
Joined: 2009-01-15 06:26
Has thanked: 3 times
Been thanked: 1 time

Behringer USB sound interface looses volume setting

#1 Post by gusnan »

I have a USB Sound interface Behringer UMC204HD, and on every morning system startup I need to go to alsamixer, select the UMC204HD sound card and increase the volume. This sticks until reboot or user switch (logging in as another user on X), when it is down again (to 41 of 100, alsamixer also says -23dB gain) on Line A, Line B, "UMC204HD 192k Output Front" and "UMC204 192k Output Rear".

Does anybody else see this? And does anyone have a solution?

This is on Debian 12, standard kernel, standard Xfce install.:

Code: Select all

Linux debian-i7 6.1.0-12-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.52-1 (2023-09-07) x86_64 GNU/Linux
alsamixer.png

peter_irich
Posts: 1414
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 12 times

Re: Behringer USB sound interface looses volume setting

#2 Post by peter_irich »

In any case, save desired configuration with "alsactl -store N -f my_asound.state" and restore it when login, man aslactl.

gusnan
Posts: 47
Joined: 2009-01-15 06:26
Has thanked: 3 times
Been thanked: 1 time

Re: Behringer USB sound interface looses volume setting

#3 Post by gusnan »

Thanks! - that is indeed a good workaround. Now I just need to find out a good way to do this automatically on login :)

gusnan
Posts: 47
Joined: 2009-01-15 06:26
Has thanked: 3 times
Been thanked: 1 time

Re: Behringer USB sound interface looses volume setting

#4 Post by gusnan »

And the diff on the configs for anybody interested:

Code: Select all

--- my_asound_low.state	2023-10-05 20:51:59.394607647 +0200
+++ my_asound.state	2023-10-05 20:34:23.012178920 +0200
@@ -52,10 +52,10 @@
 	control.5 {
 		iface MIXER
 		name 'UMC204HD 192k Output Playback Volume'
-		value.0 104
-		value.1 104
-		value.2 104
-		value.3 104
+		value.0 127
+		value.1 127
+		value.2 127
+		value.3 127
 		comment {
 			access 'read write'
 			type INTEGER
@@ -63,10 +63,10 @@
 			range '0 - 127'
 			dbmin -12700
 			dbmax 0
-			dbvalue.0 -2300
-			dbvalue.1 -2300
-			dbvalue.2 -2300
-			dbvalue.3 -2300
+			dbvalue.0 0
+			dbvalue.1 0
+			dbvalue.2 0
+			dbvalue.3 0
 		}
 	}
 	control.6 {

User avatar
None1975
df -h | participant
df -h | participant
Posts: 1568
Joined: 2015-11-29 18:23
Location: Russia, Kaliningrad
Has thanked: 63 times
Been thanked: 93 times

Re: Behringer USB sound interface looses volume setting

#5 Post by None1975 »

gusnan wrote: 2023-10-05 18:41 Thanks! - that is indeed a good workaround. Now I just need to find out a good way to do this automatically on login :)
Hello. Try using xfce auto starting mechanism.
OS: Debian 12.4 Bookworm / DE: XFCE
Debian Wiki | DontBreakDebian, My config files on github

gusnan
Posts: 47
Joined: 2009-01-15 06:26
Has thanked: 3 times
Been thanked: 1 time

Re: Behringer USB sound interface looses volume setting

#6 Post by gusnan »

None1975 wrote: 2023-10-06 11:41
gusnan wrote: 2023-10-05 18:41 Thanks! - that is indeed a good workaround. Now I just need to find out a good way to do this automatically on login :)
Hello. Try using xfce auto starting mechanism.
Thanks - will that be able to handle running as root/using sudo? alsactl is unfortunately not runnable as a normal user.

peter_irich
Posts: 1414
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 12 times

Re: Behringer USB sound interface looses volume setting

#7 Post by peter_irich »

No, call it with full path: /usr/sbin/alsactl. And it is possible to create desktop-file in ~/.config/autostart by hands.

gusnan
Posts: 47
Joined: 2009-01-15 06:26
Has thanked: 3 times
Been thanked: 1 time

Re: Behringer USB sound interface looses volume setting

#8 Post by gusnan »

peter_irich wrote: 2023-10-06 18:11 No, call it with full path: /usr/sbin/alsactl. And it is possible to create desktop-file in ~/.config/autostart by hands.
That won't work running without root/sudo:

Code: Select all

alsa-lib main.c:844:(execute_sequence) exec '/bin/rm -rf /var/lib/alsa/card0.conf.d' failed (exit code 1)
Also - this (if working) would solve the problem on login, but not when switching between users already logged in (using the Ctrl+Alt+F7/F8 maneuver). I do loose the volume when switching between users too, but it is a bit harder to pinpoint it in that case.

My workflow is switching the UMC204HD 192k to off in the pulseaudio Xfce panel plugin (in the configuration tab) before switching user, then actually switch user, and then switch it on in the Xfce plugin on the other user. (To actually have sound at all).

gusnan
Posts: 47
Joined: 2009-01-15 06:26
Has thanked: 3 times
Been thanked: 1 time

Re: Behringer USB sound interface looses volume setting

#9 Post by gusnan »

Also - this wasn't necessary before the Bookworm upgrade (The part turning off the soundcard for the user switching from, and then turning it on for the user switching to was, but not setting the sound volume, this is new for Debian 12).

peter_irich
Posts: 1414
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 12 times

Re: Behringer USB sound interface looses volume setting

#10 Post by peter_irich »

In UbuntuI I not need sudo to run alsactl, for example,

Code: Select all

/usr/sbin/alsactl dump-cfg
works from user.

gusnan
Posts: 47
Joined: 2009-01-15 06:26
Has thanked: 3 times
Been thanked: 1 time

Re: Behringer USB sound interface looses volume setting

#11 Post by gusnan »

peter_irich wrote: 2023-10-07 19:25 In UbuntuI I not need sudo to run alsactl, for example,

Code: Select all

/usr/sbin/alsactl dump-cfg
works from user.
Well, you don't need root/sudo for that in Debian either (which is the topic for this forum), but writing/changing config is a different thing from reading the config.

peter_irich
Posts: 1414
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 12 times

Re: Behringer USB sound interface looses volume setting

#12 Post by peter_irich »

It is right use asound.state in own directory, for example,

Code: Select all

/usr/bin/alsactl store N -f ~/my_asound.state

gusnan
Posts: 47
Joined: 2009-01-15 06:26
Has thanked: 3 times
Been thanked: 1 time

Re: Behringer USB sound interface looses volume setting

#13 Post by gusnan »

peter_irich wrote: 2023-10-08 06:48 It is right use asound.state in own directory, for example,

Code: Select all

/usr/bin/alsactl store N -f ~/my_asound.state
Ah, alright, now I follow. Still, it needs to be writable by both users. (which of course is doable).

gusnan
Posts: 47
Joined: 2009-01-15 06:26
Has thanked: 3 times
Been thanked: 1 time

Re: Behringer USB sound interface looses volume setting

#14 Post by gusnan »

And it still doesn't work - it's not the permissions of my local "my_asound.state" that is the problem (that is fixable), but the alsa config. See the result:

Code: Select all

alsa-lib main.c:844:(execute_sequence) exec '/bin/rm -rf /var/lib/alsa/card0.conf.d' failed (exit code 1)

peter_irich
Posts: 1414
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 12 times

Re: Behringer USB sound interface looses volume setting

#15 Post by peter_irich »

You can directory accessed to both users and to save my_asound.conf in it. For example. /home/common.

Code: Select all

sudo mkdir /home/common
sudo chown nobody:nogroup /home/common
sudo chmod 775 /home/common
and to add both users in nogroup.

gusnan
Posts: 47
Joined: 2009-01-15 06:26
Has thanked: 3 times
Been thanked: 1 time

Re: Behringer USB sound interface looses volume setting

#16 Post by gusnan »

peter_irich wrote: 2023-10-08 18:32 You can directory accessed to both users and to save my_asound.conf in it. For example. /home/common.

Code: Select all

sudo mkdir /home/common
sudo chown nobody:nogroup /home/common
sudo chmod 775 /home/common
and to add both users in nogroup.
It isn't the permissions of the file (or the folder containing) my_asound.conf that is the problem, but files that alsa needs to access to change the config - look at the error message I posted:

Code: Select all

alsa-lib main.c:844:(execute_sequence) exec '/bin/rm -rf /var/lib/alsa/card0.conf.d' failed (exit code 1)

CwF
Global Moderator
Global Moderator
Posts: 3268
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 69 times
Been thanked: 290 times

Re: Behringer USB sound interface looses volume setting

#17 Post by CwF »

/var/lib/alsa/asound.state (or whatever file you specify with the -f flag)
is used to store current settings for your soundcards. The settings include
all the usual soundcard mixer settings. More importantly, alsactl is capa‐
ble of controlling other card-specific features that mixer apps usually
don't know about.

The configuration file is generated automatically by running alsactl store.
Editing the configuration file by hand may be necessary for some soundcard
features (e.g. enabling/disabling automatic mic gain, digital output, joy‐
stick/game ports, some future MIDI routing options, etc).
Am I to understand running alsactl once as root does not store the config and automagically restore it on next boot?
Mottainai

peter_irich
Posts: 1414
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 12 times

Re: Behringer USB sound interface looses volume setting

#18 Post by peter_irich »

If both users must have rights to changing my_asound.conf, it must belong nobody:nogroup too and have rights 775.

gusnan
Posts: 47
Joined: 2009-01-15 06:26
Has thanked: 3 times
Been thanked: 1 time

Re: Behringer USB sound interface looses volume setting

#19 Post by gusnan »

CwF wrote: 2023-10-08 19:28
/var/lib/alsa/asound.state (or whatever file you specify with the -f flag)
is used to store current settings for your soundcards. The settings include
all the usual soundcard mixer settings. More importantly, alsactl is capa‐
ble of controlling other card-specific features that mixer apps usually
don't know about.

The configuration file is generated automatically by running alsactl store.
Editing the configuration file by hand may be necessary for some soundcard
features (e.g. enabling/disabling automatic mic gain, digital output, joy‐
stick/game ports, some future MIDI routing options, etc).
Am I to understand running alsactl once as root does not store the config and automagically restore it on next boot?
In my case? Yes. I just did that - alsactl store (with the volume increased) using sudo, reboot - volumes down again.

CwF
Global Moderator
Global Moderator
Posts: 3268
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 69 times
Been thanked: 290 times

Re: Behringer USB sound interface looses volume setting

#20 Post by CwF »

I haven't paid much attention to settings! and should have read you did that, sorry, I just remembered I may have some of those usb interfaces for some reason, I may find it and test at some point.

I quickly scanned the man pages and have not dug in. I was looking for mention of a user directory for settings and didn't see one.
Mottainai

Post Reply