FAQ025

From the ALSA wiki

Jump to: navigation, search
The FAQs have been reorganized. The new location of this question is FAQ#ALSA utilities don't work unless I'm root on my Linux system. What's up with that?

ALSA utilities don't work unless I'm root on my Linux system. Why is that?

Your files probably have incorrect permissions. The device files in /dev/snd need to be user-readable and user-writable (the tool alsactl is only meant to be run by root though).

Here's the output of ls /dev/snd -l on my system:

  tapas@mango:~$ ls /dev/snd/ -l
  total 0
  crw-rw---    1 root     audio    116,   0 Nov 17 04:32 controlC0
  crw-rw---    1 root     audio    116,  32 Nov 17 04:32 controlC1
  crw-rw---    1 root     audio    116,  64 Nov 17 04:32 controlC2
  crw-rw---    1 root     audio    116,  96 Nov 17 04:32 controlC3
  crw-rw---    1 root     audio    116,   4 Nov 17 04:32 hwC0D0
  crw-rw---    1 root     audio    116,   5 Nov 17 04:32 hwC0D1
  crw-rw---    1 root     audio    116,   6 Nov 17 04:32 hwC0D2
  ... etc ...

In this setup, I, as the user belong to the group audio and therefore have read-write access (shown by rw above) to the ALSA device files. You can use the command groups to see which groups you belong to:

  tapas@mango:~$ groups 
  tapas cdrom audio wheel priv

Read this page for general linux/unix help:

http://www.tldp.org/

and especially: http://www.tldp.org/LDP/intro-linux/html/chap_03.html

Look for unix/linux introductory guides to know more about filesystems and how to set change permissions. If this is too much for you and you just want a quick hack which disregards all security concerns, you can just do [as root]:

  chmod a+rw /dev/snd/*

Personal tools