Linux

  1. Home
  2. Computing & Technology
  3. Linux

The Linux Gamers' How-To

From The Linux Documentation Project, for About.com

8.2. Why isn't my sound working?

First of all, it's probably not the game, it's probably your setup. AFAIK, there are 3 options to getting a sound card configured under Linux: the free OSS sound drivers that come with the Linux kernel, the Alsa drivers and the commercial OSS sound drivers. Personally, I prefer the free OSS drivers, but many people swear by Alsa. The commercial OSS drivers are good when you're having trouble getting your sound card to work by free methods. Don't discount them; they're very cheap (like 10 or 20 bucks), support bleeding edge sound cards and take a lot of guesswork out of the configuring process.

There are 5 things that can go wrong with your sound system:

  • Shared interrupt

  • Misconfigured driver

  • Something's already accessing the sound card

  • You're using the wrong driver

  • A permissions problem

8.2.1. Shared interrupt

The first thing to do is to figure out if you have an IRQ conflict. ISA cards can't share interrupts. PCI cards can share interrupts, but certain types of high bandwidth cards simply don't like to share, including network and sound cards. To find out whether you have a conflict, do a cat /proc/interrupts . Output on my system is:


   

$ cat /proc/interrupts
CPU0 CPU1
0: 24185341 0 XT-PIC timer
1: 224714 0 XT-PIC keyboard
2: 0 0 XT-PIC cascade
5: 2478476 0 XT-PIC soundblaster
5: 325924 0 XT-PIC eth0
11: 131326 0 XT-PIC aic7xxx
12: 2457456 0 XT-PIC PS/2 Mouse
14: 556955 0 XT-PIC ide0
NMI: 0 0
LOC: 24186046 24186026
ERR: 1353

The second column is there because I have 2 CPU's in this machine; if you have one CPU (called UP, or uniprocessor), you'll have only 1 CPU column. The numbers on the left are the assigned IRQ's and the strings to the right indicate what device was assigned that IRQ. You can see I have an IRQ conflict between the soundcard (soundblaster) and the network card (eth0). They both share IRQ 5. Actually, I cooked this example up because I wanted to show you what an IRQ conflict looks like. But if I did have this conflict, neither my network nor my sound would work well (or at all!).

If my sound card is PCI, the preferred way of fixing this would be to simply move one of the cards to a different slot and hope the BIOS sorts things out. A more advanced way of fixing this would be to go into BIOS and assign IRQ's to specific slots. Modern BIOS'es can do this.

8.2.2. Misconfigured driver

Sometimes, a card is hardwired to use a certain IRQ. You'll see this on ISA cards only. Alternatively, some ISA cards can be set to use a specific IRQ using jumpers on the card itself. With these types of cards, you need to pass the correct IRQ and memory access, "I/O port", to the driver.

This is a sound card specific issue, and beyond the scope of this HOWTO.

8.2.3. Something is already accessing your sound card

Perhaps an application is already accessing your soundcard. For example, maybe you have an MP3 player that's paused? If something is already accessing your card, other applications won't be able to. Even though it was written to share the card between applications, I've found that esd (the enlightenment sound daemon) sometimes doesn't work correctly. The best tool to use here is lsof, which shows which processes are accessing a file. Your sound card is represented by /dev/dsp . Right now, I'm listening to an MP3 (not a Metallica MP3, of course...) with mp3blaster.


   

# lsof /dev/dsp
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
mp3blaste 1108 p 6w CHR 14,3 662302

* License

* The Linux Gamers' How-To Index

Explore Linux

About.com Special Features

Linux

  1. Home
  2. Computing & Technology
  3. Linux
  4. Linux HowTos
  5. The Linux Gamers How-To
  6. The Linux Gamers' How-To - 8.2. Why isn't my sound working?

©2009 About.com, a part of The New York Times Company.

All rights reserved.