Set your computer free

Menu

How to set up sound in Slackware

I was looking around for ideas for something to write up today, so I asked a friend of mine about his most recent Slackware setup experience. He told me, “my sound isn’t working at the moment, but I really haven’t delved into that at all”.

Which got me thinking. This is a common question among people who are using Slackware and aren’t that intimately familiar with it. I know, this has been written up about a billion times, but not here, and it’s a nice basic HOWTO that I think really belongs on Linux Critic.

Step one: Configure ALSA

So our first step is to open up a terminal and type su, enter your root password, and then type the following arcane command:

alsaconf

This will bring up a pretty easy to use, menu-driven configuration program that looks like this:

Follow the bouncing ball in the alsaconf program, let it figure things out, select your sound card, and you should be good. I’ve run this on a wide variety of hardware, and I’ve never had problems with this part, assuming there’s actually a sound device on the actual machine, of course.

Step two: Unmute your sound channels and set volumes

The next step is to undo the defaults of things in the sound world. For some reason, the default position for the master volume and the PCM volume is 0%, and by default both of those channels are muted in my experience.

This has led to numerous people banging their heads on their desks while screaming, “I got everything configured, it sees my sound card BUT I STILL HAVE NO SOUND!”. This is understandable, I was burned by this when I first started using Slackware too.

To remedy this, in that terminal again, type exit so that you’re no longer typing commands as root, and then type the following command (as your regular user):

alsamixer

This should bring up a screen that lets you use the arrow keys to set the volume levels on the various channels your sound device has built into it.

If you hit the “up” arrow, you’ll find that you can raise your master volume channel (which should be the first one) to the desired level, and by hitting the “right” arrow, you can switch to the next channels and do the same for each of them.

Now, one thing you’ll notice is that you may have “MM” at the bottom of some channels, like this:

Any channel that has this “MM” designation is muted. To unmute a channel, arrow over to it and simply hit the “m” key, and the “MM” should go away and you’ll have sound on that channel.

Once you’re done unmuting things and setting volume levels, simply escape out of this screen and you’re back to the command line, ready for the next step.

Step three: Save what you’ve done

In our final step, we need to tell ALSA that you’re not kidding about the volume settings, and that you want it to remember this.

To accomplish this task, still in your terminal, type su and then your root password again. Then type the following command:

alsactrl store

And that’s it. This tells ALSA to save the current state, and the system should remember this state every time you reboot. If you’re running KDE, you can adjust volume levels with Kmix, which is a standard KDE applet that can live in your tray in KDE. I say this just so you don’t think that you have to open a terminal and run alsamixer every time you want to adjust your volume (though you can if you really want to, or if you’re not running X, for some reason).

An additional step is sometimes necessary if you’re running Fluxbox; if you want your settings restored every time you boot, you may have to edit your /~/.fluxbox/startup file and add the following line to it:

alsactl restore

This isn’t always necessary, but I’ve found that sometimes it is, so your mileage may vary as well. As a rule of thumb, if you don’t like what is happening with your sound levels when you get into Fluxbox every time, adding that line to startup at least puts it in a state that you want right off the bat.

Do let me know if you have any questions regarding this simple procedure. As always, there is of course lots of variation from machine to machine out there, but I’ve never had sound problems (on working hardware) that this couldn’t cure on a fresh setup. In some cases, when sound has mysteriously stopped working, going through this three step process can get it working again, so don’t be afraid to run through this on a machine that has already been working for a while.

Unfortunately, as root in slack 14.1 the commands ‘alsaconf’ or ‘alsa’ give ‘command not found’. This, even tho apropos ‘alsa’ gives info about it. I have logged as root with login shell (‘su -l’) and it makes no difference. Don’t know what happened to alsa in 14.1 but it seems to have only a ghostly appearance.

now as an addition to this post……’we’ need to know how to configure a mixer e.g. Dmix, to work with ALSA to allow multiple sound stream control e.g. different volume for video player and one for music player

About the Linux Critic

I'm a professional troubleshooter (a.k.a. IT Guy) who has been using Linux as his main desktop OS for over a decade.

I'm more technical than the "average user" by quite a ways, but I like to think that there's no reason why Linux and Free/Open Source Software can't find a home on the average user's desktop as a part of their everyday computing life.

I love to play around with technology, and I love to talk about it, so stick around and let me know what you're thinking.

DISCLAIMER: The posts I write and publish on this blog are my own opinions and the opinions of those who contribute to The Linux Critic, and in no way reflect the opinions or official positions of my employer or any of the employers of my contributors.

All content on this blog is copyright (C) Trent Isaacson unless otherwise indicated.