Alsa utils only run as root on Raspbian

27 views Asked by At

I have a RPi Zero running Raspbian Bullseye. The alsa utils (aplay, arecord, speaker-test, etc) only run without error as root.

I tried as user pi:


pi@bear:~ $ speaker-test

speaker-test 1.2.4

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
ALSA lib conf.c:1446:(parse_def) default is not a compound
ALSA lib conf.c:1970:(_snd_config_load_with_include) _toplevel_:1:13:Invalid argument
ALSA lib conf.c:3817:(config_file_open) /home/pi/.asoundrc may be old or corrupted: consider to remove or fix it
ALSA lib conf.c:3739:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument
ALSA lib conf.c:4203:(snd_config_update_r) hooks failed, removing configuration
Playback open error: -22,Invalid argument

but was expecting the output below (run as root):

pi@bear:~ $ sudo speaker-test

speaker-test 1.2.4

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 2048 to 16384
Period size range from 1024 to 1024
Using max buffer size 16384
Periods = 4
was set period_size = 1024
was set buffer_size = 16384
 0 - Front Left

Sounds like a permissions issue but after some research, everything seems ok.

pi@bear:~ $ groups pi
pi : pi audio
pi@bear:~ $ ls -al /dev/snd/
total 0
drwxrwxrwx  4 root root      240 Nov  5 17:11 .
drwxr-xr-x 16 root root     3720 Nov  5 17:11 ..
drwxr-xr-x  2 root root       80 Nov  5 17:11 by-id
drwxr-xr-x  2 root root      100 Nov  5 17:11 by-path
crw-rw----  1 root audio       0 Nov  5 17:11 controlC0
crw-rw----  1 root audio      32 Nov  5 17:11 controlC1
crw-rw----  1 root audio      64 Nov  5 17:11 controlC2
crw-rw----  1 root audio      16 Nov  5 17:11 pcmC0D0p
crw-rw----  1 root audio      56 Nov  5 17:11 pcmC1D0c
crw-rw----  1 root audio      80 Nov  5 17:11 pcmC2D0p
crw-rw----  1 root audio       1 Nov  5 17:11 seq
crw-rw----  1 root audio      33 Nov  5 17:11 timer
0

There are 0 answers