Differences between revisions 20 and 21
Revision 20 as of 2007-08-10 18:43:12
Size: 8919
Editor: FranklinPiat
Comment: update links.
Revision 21 as of 2008-01-20 21:10:08
Size: 9111
Editor: FranklinPiat
Comment: Merge "ErrNoDsp" here.
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## Auto-converted by kwiki2moinmoin v2005-10-07
["Sound"] >
----
#language en
Line 88: Line 86:
 * Q: can't open /dev/dsp: No such device
   * A: This means that the driver was not loaded successfully or that it didn't find any devices. Try 'lsmod' to see what modules are loaded and 'dmesg' to see what they said when they where loaded.

General guidelines on getting sound to work

  • Ok! So your audio is not working when you login as normal user.
    • Are you sure it doesn't work? Try turning up the volume first. Something like aumix can do this, and save the settings for later.

    • Login as root and see if the sound works for the root account.
  • If sound works for root account but not for a normal user, then you need to add the user to the audio group. This can be done by running the command
    • $adduser your_user_name audio

    • You need to log out of the user account and log back in to see the affect of the above command. To check whether a given user is in audio group or not use the id command. For example on my system, this is the output of the id command. {{{$id uid=1000(rajulocal) gid=1000(rajulocal) groups=4(adm),20(dialout),24(cdrom), 25(floppy),29(audio),40(src),44(video),114(plugdev),1000(rajulocal)}}}
  • If sound does not work for root account as well, then that means that either your sound card is not supported by Debian or it was not configured properly. But in order to know which one is the case, you first need to know 'what your sound card actually is'!
  • One common case is when you find that your card starts working after you do a manual alsaconf. This usually happens because you have several sound cards and the audio is being output on the card you don't want. The solution consists of manually defining the default card. To solve this you could see this alsa [http://alsa.opensrc.org/FAQ026 FAQ]

  • The make and model of sound card can be obtained by doing
    • $lspci -v This generates lot of output. Browse through the output to find your sound card details. For example on my system, when I run the above command, I get {{{0000:00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)

      • Subsystem: Toshiba America Info Systems: Unknown device ff00 Flags: bus master, medium devsel, latency 0, IRQ 185 I/O ports at 1c00 [size=256] I/O ports at 18c0 [size=64] Memory at c0000c00 (32-bit, non-prefetchable) [size=512] Memory at c0000800 (32-bit, non-prefetchable) [size=256]

        Capabilities: <available only to root>}}}

      Be sure to post this piece of information if you are asking a question about sound problems on a mailing list such as debian-user.
  • If a program gives vague error messages, installing an app which gives more detailed error messages may help. For example, xmms gives very good error messages. When you get it all working, please update this page with the specific error messages & symptoms to help other people who search for these details.

  • Note to developers: it's helpful to remember that the easier it is to get an app running, particularly the first time after installation, the more likely the user is to start & keep on using your app. There are plenty of alternative apps! Having more detailed error messages (see xmms below) is extremely helpful to newer, as well as more experienced, users. Even experienced users won't be knowledgable in every speciality. OK, if you're developing an audio app, your audio infrastructure will already be set up, so looking here and in SoundConfiguration will give a good indication of alternative things which may need setting up before the app will work fully. It helps to have both detailed error messages in the code and guidance in the FAQ, etc. Some useful example messages to distinguish: device /dev/x does not exist; device /dev/dsp does not have write permissions for this user; device /dev/dsp is in use by another program ...

  • Q: Which audio/sound apps can I use?
  • Q: Should I choose OSS or ALSA soundcard drivers?
    • A: ["ALSA"] is free. It is the standard in Linux >= 2.6. It has features such as full duplex, digital I/O etc.

    • A: ["OSS"] is free, It was the standard in Linux <= 2.4, but it has the poorest support for soundcards and features.

    • A: FYI, OSS/Linux is a commercial binary, closed-source implementation by 4Front Technologies. It is non-gratis. Cards can be auto-detected and there is a nice user interface.
  • Q: Is there an introductory article anywhere that can explain what all the various pieces of the Linux sound "architecture" are; that is, what drivers are needed, what is a mixer and how many of those do I need installed, what is ["OSS"] (Open Sound System), what is ["ALSA"], etc?
    • A: I'll introduce "The Book of Linux Sound and Music" to you, which is by No Starch Press and Linux Journal Press. It contains much useful information about Linux sound and music. --?CyberWorker

      • ["OSS"] is the Open Sound System, which has been in the Kernel for ages already. It works with sound modules, and there was a non-free extension to support soundcards whose support in the kernel was weak.
      • ["ALSA"] supports more hardware. How difficult it is to set up depends if your card supports plug and play or if you have to find the irqs by hand. I had the kernel-source installed and then alsa-source, compiling it with the kernel-package. That worked brillantly for my ["SBLive"].
  • Q: How do I check which of OSS (Open Sound System), ALSA, & etc. I have installed?

    • A1: At least on Sarge lsmod shows "oss" in the module names when using OSS.

    • An: ???
  • Q: How to enable ALSA OSS emulation?
    • A1: kernel mode emulation:

       apt-get install alsa-oss
       modprobe snd_pcm_oss
       modprobe snd_mixer_oss
      and you can add snd_pcm_oss and snd_mixer_oss to /etc/modules to load them at boottime
    • A2: userspace mode emulation:

       apt-get install alsa-oss
       aoss program_to_use_oss 
  • Q: How do I tell which other program is using /dev/dsp?
    • A: One of these:

       /bin/fuser -v /dev/dsp
       /usr/sbin/lsof||grep dsp
  • Q: How do I do a basic low-level test of my soundcard?
    • A: set the volume fairly low (!) and as root and as another user (if the quality is poor, the .wav file could be in the wrong endian):

        cat example.wav >/dev/dsp
        cat example.wav >/dev/dsp1
  • Q: can't open /dev/dsp: No such device
    • A: This means that the driver was not loaded successfully or that it didn't find any devices. Try 'lsmod' to see what modules are loaded and 'dmesg' to see what they said when they where loaded.

Specific apps

  • Q: xmms gives a dialog box with:

      Please check that:
      1. You have the correct output plugin selected.
      2. No other programs is/are blocking the soundcards.
      3. Your soundcard is configured properly.
    • A: run it from a terminal, where it gives more helpful detailed messages eg:

       WARNING: oss_open(): Failed to open audio device (/dev/dsp): Device or resource busy
       WARNING: oss_open(): Failed to open audio device (/dev/dsp): Permission denied
    • See SoundConfiguration for details on fixing these.

  • Q: mpg321 gives:

      libao - OSS cannot set rate to 44100
      Can't find a suitable libao driver. (Is device in use?)
    • A: Try apt-get install libsamplerate0
    • A: Alternatively, you may have a sound system that only supports 48khz. libao doesn't support resampling, so use libmad/madplay as an alternative.
    • A: Is alsa's OSS emulation loaded? Try: "modprobe snd-pcm-oss" as root.
  • Q: mpg321 gives:

      Can't find a suitable libao driver. (Is device in use?), or
      Can't open libao driver with device /dev/dsp (is device in use?)
  • Q: I have installed a new linux kernel and suddenly my alsa sound does not work.
    • A: If you install a new kernel version you also need to install the corresponding alsa-modules version.
    • A: If you installed a 2.6 kernel for the first time, consider what smokybobo wrote at [http://www.linuxquestions.org/questions/archive/2/2003/10/2/102295 Linuxquestions.org]. In addition, consider running 'alsamixer' and unmute the channels you need and set them to an appropriate volume. Make sure you set the option to saving the mixer settings across reboots in the alsa-base configuration. At that point, e.g. XMMS should work with the output plugin ALSA. If you are running KDE and you want it's sound effects as well, you may have to tell it's aRts server explicitely to use ALSA. In that case, you'll have to set the output plugin for XMMS to aRts. --DavidAndel

    • A: I had installed a kernel image of 2.6.5-4 and found that coupled with the direction in the link above and an upgrade to 2.6.6-1, I had ALSA support in all of my applications. Also, if you have multiple capture cards (bttv, other tuner, radio card), try "cat /proc/asound/cards" to verify that your capture card is where you expect it. For my system, the tv card registered as card 0 and a SB Live! came up as card 1. --?EricZavesky


Related Links: SoundConfiguration