Menu

EnablingGNOMESystemSounds

Eugene Wissner

System sounds in GNOME are still a bit of a bother, but enabling them is not particularly hard once you know what's needed. This page will hopefully get them working for you in under 5 minutes, give or take a reboot. Read carefully because some of you will only need to do part of what's shown here.

Verifying ALSA works on your hardware

Assuming that you've already done "the usual" of unmuting the mixer channels and saving the sound card state, first verify that sound is working at all with the following command:

speaker-test -c 2 -t wav

Provided your sound works at all, you'll hear a nice lady's voice announce your front left and right speakers. If this doesn't happen, don't bother even trying to get GNOME system sounds working until you fix your sound card problems in Slackware-space. Telling you how to configure ALSA correctly is well beyond the scope of this document.

Reconfiguring ESD

The next step is going to be to enable the auto-spawn option for the Enlightened Sound Daemon (esd) in /etc/esd.conf. Login as root (or simply su to root) and open /etc/esd.conf in an editor. Look for the following line:

auto_spawn=0

Change the zero to a one to enable the auto-spawning option, like:

auto_spawn=1

Save your changes to the file and exit the editor. Without enabling this feature of esd, when system sounds are activated you'll hear the login chime but nothing else after that (including no logout chime).

Hardware Muxing

One of the long-standing problems with playing sounds on a computer is how to handle when the system attempts to play more than one sound at a time. Some sound cards (primarily ones made by Creative Labs, but mainly only the higher-end audio cards) can handle being fed more than one sound stream at a time. However, for people without that hardware, this has typically required a sound daemon to handle muxing (in layman's terms, "merging") the sounds together before feeding them to the sound hardware. Somewhat more recently, ALSA has gained a facility called "dmix" that allows it to handle the muxing of multiple sound streams in software without you having to do anything special.

Testing for hardware muxing

The simplest way to test if hardware muxing is happening or not is to simply try to play two sound files at the same time. Cd into /usr/share/sounds and try running two copies of esdplay at the same time like this:

esdplay generic.wav & esdplay phone.wav

Any two sound files will do, so long as you can tell them apart. If they both play simultaneously, you do not need to enable dmix. If they play sequentially (first one, then the other--don't worry about which one was "supposed" to play first) then you'll need to enable dmix.

Enabling ALSA's dmix feature

If your card isn't one of the models made by Creative Labs (or one of a very few higher-end audio cards), then it probably didn't support hardware-level sound muxing and you will need dmix. Enabling dmix is very easy. Most of the guides to this on the internet use ~/.asoundrc for this, but I'm not going to waste your time with that. If hardware muxing isn't working for one user, then it's not working for all the users and you might as well go ahead and enable it system-wide by changing /etc/asound.conf instead.

That having been said, if the test above revealed your sound card's hardware handles muxing output on it's own, skip this. If you need to enable dmix so that ALSA will handle the muxing of sounds for you, simply copy this into your /etc/asound.conf.

pcm.card0 {

type hw card 0

}

pcm.!default {

type plug slave.pcm "dmixer"

}

pcm.dmixer {

type dmix ipc_key 1025 slave {

pcm "hw:0,0" period_time 0 period_size 2048 buffer_size 32768 rate 48000

} bindings {

0 0 1 1

}

}

You don't need to restart anything after doing this--the changes should take effect immediately. Playing two sounds at once should now work (even though it'll still sound awful).

Configuring GNOME to enable system sounds

(I'm going to need to create a number of screenshots to manage this section, and I'm nowhere near my devel box at the moment to do it)

Once the underlying operating system support is in place (sound works, muxing works) it's time to login to GNOME and tell it to enable system sounds.

Update: Some of the things that were blocking this are fixed now. I'll have to do another "100% clean install" test to see how many pieces might still be broken. The main issue before was making it impossible to use Ekiga due to an error in gstreamer which is now (apparently) fixed. Don't go adding dmix or anything to your system unless you are sure you're having problems. Mainly just enabling GNOME system sounds should work as expected now. If the tests for ALSA inputs still fail, then ask about it on the forums and we'll try to work the problem there.