Only root can play sounds

15,474

Solution 1

Use a text editor as root and manually edit the /etc/group file. Look for the line that says audio and add your username to the end.

This is how the line looked before I edited it:

audio:x:29:

This is how the line looked after I edited it:

audio:x:29:username

Save the file and logout, then log back in and test sound. If it doesn't work try rebooting just to make sure changes are applied and test audio again.

Don't forget to celebrate!

If you still can't hear audio, make sure your Master Volume is not muted. Install alsa-utils which will install alsamixer so you can control your soundcard (volume, mute, boost, choose card, etc.) Run alsamixer in a terminal by typing alsamixer and use your arrow keys to raise the volumes.

You can't run alsamixer as a normal user until you add yourself to the audio group. Even if you run alsamixer as root and your system was on mute and you raise the volume to the max, you still will not hear any audio until you've successfully added yourself to the audio group. The key to getting sound in a minimal install is adding yourself to the audio group.

Note: I never installed pulseaudio to my system. Don't know if that changes things. If it does: try purging pulseaudio from your system first, then install alsa-utils and follow the instructions I gave at the top to add yourself to the audio group.

Going off on a tangent: This is the first minimal install I do so I'm learning a hell of a lot about how ubuntu works. I'll tell you this: I have a deeper appreciation for distros with gui's & desktop environments and the people who make them. It's a hell of a lot work to build a friendly system with all the essential tools and programs. Just wrapping your mind around some of these concepts will keep you up for days. That being said I have a sneaking suspicion there's a lot of other groups you may have to add yourself to to get things to work in a minimal install.

For example, I haven't tested out google voice yet but I may have to add myself to the voice group. We'll see. By default a user is not automatically added to a lot of groups in the minimal install. Hey we wanted to start from scratch and make all the decisions right. Well... here we go.

Happy building!

Solution 2

Add your user to the audio and pulse-access groups

Command-line

sudo adduser <username> <groupname>

Then log out and back in or reboot.

Source.

Share:
15,474

Related videos on Youtube

Rafael S. Calsaverini
Author by

Rafael S. Calsaverini

Physicist, interested in agent-based simulation and statistical physics of models inspired by economic and biological reasoning. Programming in C and Python.

Updated on September 18, 2022

Comments

  • Rafael S. Calsaverini
    Rafael S. Calsaverini almost 2 years

    I did a minimal installation of ubuntu server on my computer cause I wanted to have a clean environment to run a very lightweight window manager (xmonad).

    I don't know much about the sound system in ubuntu so I blindly installed alsa and pulseaudio and thought it would work out-of-the-box. It turns out my user can't play sounds, though I can play any sound if I'm logged as root (via sudo su).

    How do I add sound playing priviledges to my user?

  • Rafael S. Calsaverini
    Rafael S. Calsaverini almost 13 years
    did... still no good. But apparently I don't have those groups: $groups calsaverini adm dialout cdrom plugdev netdev lpadmin sambashare admin
  • Rafael S. Calsaverini
    Rafael S. Calsaverini almost 13 years
    funny... when I do sudo alsamixer I open it as root normally. When I try to open alsamixer without sudo my user I got a cannot open mixer: No such file or directory error. I can open alsamixergui though and nothing is muted. But it don't have as many options as when I open it with root priviledges.
  • Golar Ramblar
    Golar Ramblar almost 5 years
    @RafaelS.Calsaverini: Same here. Only as root I get audio. My user is in the audio-group. Arch Linux on GPD Pocket.