mopidy/mopidy-alsamixer

Alsamixer Raspberry Pi OS volume control not working

Closed this issue · 5 comments

Since the Raspbery Pi OS update 28 May the Alsamixer is no longer working for volume control.

Before May 28 the audio device was "one" card with multiple devides:

pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 7/7
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: ALSA [bcm2835 ALSA], device 2: bcm2835 IEC958/HDMI1 [bcm2835 IEC958/HDMI1]
Subdevices: 1/1
Subdevice #0: subdevice #0

But now it is multiple cards with one device:

pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
Subdevices: 4/4
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 4/4
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3

My current config as before the OS update:

/etc/mopidy/mopidy.conf

[logging]
config_file = /etc/mopidy/logging.conf
debug_file = /var/log/mopidy/mopidy-debug.log

[audio]
mixer = alsamixer
#mixer = software
output = alsasink
mixer_volume = 100

[alsamixer]
card = 0
control = PCM
min_volume = 30
max_volume = 100
volume_scale = cubic

[http]
enabled = true
hostname = 0.0.0.0
port = 6680
static_dir =
zeroconf = Mopidy HTTP server on $hostname
allowed_origins =
csrf_protection = false

[mpd]
enabled = true
hostname = 0.0.0.0
port = 6600
password =
max_connections = 20
connection_timeout = 60
zeroconf = Mopidy MPD server on $hostname
command_blacklist = listall,listallinfo
default_playlist_scheme = m3u

[file]
enabled = true
media_dirs = /home/pi/Music
follow_symlinks = false
metadata_timeout = 1000

Testing using CLI and mpc with the mixer set to alsamixer, the volume is n/a
pi@raspberrypi:~ $ mpc
volume: n/a repeat: off random: off single: off consume: off

And trying to set volume
pi@raspberrypi:~ $ mpc volume 10
mpd error: problems setting volume

But using mixer = software it works. So it seems mopidy-alsamixer is either no allowed to interface with alsa or something is different. I did try giving Mopidy user access to video and audio groups

sudo adduser mopidy video
sudo adduser mopidy audio

Have the control names also changed?

alsamixer/control: Which ALSA control to use. Defaults to Master. Other typical values includes PCM. Run the command amixer scontrols to list available controls on your system

Old:
pi@raspberrypi:~ $ amixer
Simple mixer control 'PCM',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback -10239 - 400
Mono: Playback 400 [100%] [4.00dB] [on]

New:
pi@raspberrypi:~ $ amixer
Simple mixer control 'Headphone',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback -10239 - 400
Mono: Playback 400 [100%] [4.00dB] [on]

Do I just need to change it to "Headphone" ?

Ok, that was obvious then, clearly I'm too tired.

Thanks very much, it now works as expects.

pi@raspberrypi:~ $ mpc
volume:100% repeat: off random: off single: off consume: off
pi@raspberrypi:~ $ mpc volume 10
volume: 8% repeat: off random: off single: off consume: off

Not at all, I'm sure this will be helpful to others.

Just helped me! Wiped my device and started again to get same issue! I had changed from pi 2 to pi4 and thought that was problem. Guess it was is upgrade!