How to: Tips and Tricks

Ubuntu server: install Alsa sound and MOC (Music On Console)

1. To install Alsa sound (alsa-base, alsa-utils, alsa-tools and libasound2) enter this command:

sudo apt-get install alsa alsa-tools

2. Add yourself to the group audio:

sudo adduser yourusername audio

3. Reboot to take effect

sudo init 6

4. Alsamixer is sometimes muted by default, so you might need to unmute it. Run alsamixer:

alsamixer

Use arrows up and down to change volume, left and right to change source. To mute/unmute press M.

Note: Alsamixer might look different in any machine. It depends on your sound device (sound card). Please, read audio source labels. For example: PCM in Virtualbox is on fifth place instead of the second in VMWare.

Alsamixer in VMWare

alsamixer

Alsamixer in Virtualbox

alsamixer virtualbox

To quit press Q.

If any error occurs, look here.

Play some music

1. Install MOC (Music On Console) player:

sudo apt-get install moc

2. Run MOC:

mocp

mocp

Press H for HELP.

You can also try MPlayer, mp3blaster, CMus.

  • Well done … I was trying to do exactly same thing. One step where I seems to fail is un-mute master and PCM in alsa mixer. Looking forward to try it again. Thank You!

  • Unfortunately, it didn’t work for me. I assume, that Virtualbox might be a problem. I need to test it on real hardware. Shame it might take me another 32 years. But thanks anyway.

  • I’ll try it in Virtualbox, and I will let you know about it.

  • Yes, yes, yes! Note has fixed it. Mechanicly I was pulling up first two thingis in alsamixer, instead to read which one is PCM. Thank You!

  • You’re welcome :)

  • […] Ubuntu server: install Alsa sound and MOC (Music On Console) « How to […]

  • Yes, yes, yes! Note has fixed it. Mechanicly I was pulling up first two thingis in alsamixer, instead to read which one is PCM. Thank You!

  • Thanks that was useful! I had totally forgotten the part about having to be in the audio group…

    Btw, I didn’t need any rebooting, it was sufficient to just logout to effect the group addition. (Well actually I’d also fiddled around sending an “alsactl init” before, when I didn’t get the problem that my user wasn’t in the right group, so maybe that’s also needed if you don’t want to reboot).

  • Thank you!