ALSA mixer can find control due to trailing space

This is the scontrol I would like to use in the alsamixer extension:

$amixer -c 2 scontrols
Simple mixer control 'USB Audio ',0
Simple mixer control 'USB Audio ',1

Note the scontrol name 'USB Audio ’ has a trailing space. It seems the Mopidy config file removes the trailing space, with the result that it can’t find the control.

The log file confirms this issue (again you’ll notice the trailing space between the scontrol name en the comma behind it):

2020-07-25 01:28:55,842 ERROR [22677:MainThread] mopidy.commands: Mixer (AlsaMixer) initialization error: Could not find ALSA mixer control USB Audio on card 2. Known mixers on card 2 include: ATOLL Internal Clock Validity, USB Audio , USB Audio

Any trick to let Mopidy use a trailing space? Enclosing the scontrol name in single or double quotes doesn’t help, and I would like to avoid creating a custom ALSA config file to rename the scontrol.

Update: specifying the control name via a Mopidy command argument gives the same result (also when using double quotes).

I also found out that different sound cards and DAC’s have this issue with the trailing space in the volume control name (e.g. Topping and Realtek).

I hacked my way around it by hard coding the control name in the ALSA Mixer Python script. Quick and dirty but it works for now.

1 Like

Got the same issue, will try your fix
Can you share modified part of mixer.py ?
Thx