DebuggingSoundProblems

Differences between revisions 10 and 11
Revision 10 as of 2006-04-21 23:02:55
Size: 7468
Editor: kotnet-144
Comment:
Revision 11 as of 2006-04-21 23:53:22
Size: 6076
Editor: kotnet-144
Comment: more cleanup
Deletions are marked like this. Additions are marked like this.
Line 19: Line 19:
carl@ubuntu:~$ aplay -l $ aplay -l
Line 25: Line 25:
$lspci -v
$lspnp -v
$ lspci -v
$ lspnp -v
Line 29: Line 29:
Script to gather specs about sound things:
http://alsa.opensrc.org/index.php?page=aadebug
Another usefull script to gather specs about sound-cards and drivers is [http://alsa.opensrc.org/index.php?page=aadebug aadebug].
Line 32: Line 31:
“A word about compatibility: even though most sound cards are claimed to be SoundBlaster compatible, very few currently sold cards are compatible enough to work with the Linux SoundBlaster driver. “ - http://www.tldp.org/HOWTO/Sound-HOWTO/x96.html#AEN120 “A word about compatibility: even though most sound cards are claimed to be SoundBlaster compatible, very few currently sold cards are compatible enough to work with the Linux SoundBlaster driver. “
- http://www.tldp.org/HOWTO/Sound-HOWTO/x96.html#AEN120
Line 34: Line 34:
If you have an ISA card, you MUST pass isapnp=0 to modprobe. Now figure out which module you need:
Line 36: Line 36:
If you have an ISA card, you may need to get the IRQ and IO ranges.
IRQ 5, DMA channel 1 and 0, IO 0x0220-0x022f, 0x0388-0x0388, 0x0330-0x0331
 * Go to http://www.alsa-project.org/alsa-doc/
 * Pick the manufacturer, Go
 * With the information provided by previous commands it should be easy to find the right module.
Line 39: Line 40:
Now figure out which module you need. To see if this module is available on your system (it usually is) try the following command:
{{{
$ modinfo [modulename]
}}}
This will also list the possible parameters for the module. For example some ISA cards require you to pass isapnp=0 to modprobe.
It may also require the IRQ and IO of the card if that's the case, these can be found in the output of the aadebug script.
Line 41: Line 47:
http://www.alsa-project.org/alsa-doc/ Now that you've figured out all this information, lets try loading the module
{{{
#modprobe example
$ sudo modprobe snd_es18xx isapnp=0 port=0x220 mpu_port=0x330 dma1=1 dma2=5 irq=5 fm_port=0x388
}}}
Line 43: Line 53:
Pick the manufacturer, Go – This should make it clear what module you need. If this doesn't return any errors, we can save the parameters.
{{{
$ echo options [module-name] [module-options] >> /etc/modprobe.d/[module-name]
}}}
Line 45: Line 58:
http://www.alsa-project.org/alsa-doc/doc-php/template.php?company=ESS+Technology&card=.&chip=ES18xx&module=es18xx

snd-es18xx

Between that, modinfo <module>, and linux/Documentation/sound/alsa/ALSA-Configuration.txt:

  Module snd-es18xx

    Module for ESS AudioDrive ES-18xx soundcards.

    port - port # for ES-18xx chip (0x220,0x240,0x260)
    mpu_port - port # for MPU-401 port (0x300,0x310,0x320,0x330), -1 = disable (default)
    fm_port - port # for FM (optional, not used)
    irq - IRQ # for ES-18xx chip (5,7,9,10)
    dma1 - first DMA # for ES-18xx chip (0,1,3)
    dma2 - first DMA # for ES-18xx chip (0,1,3)
    isapnp - ISA PnP detection - 0 = disable, 1 = enable (default)

    Module supports up to 8 cards ISA PnP and autoprobe (without MPU-401 port
    if native ISA PnP routines are not used).
    When dma2 is equal with dma1, the driver works as half-duplex.

    The power-management is supported.

You should be able to figure out a line like this:

 sudo modprobe snd_es18xx isapnp=0 port=0x220 mpu_port=0x330 dma1=1 dma2=5 irq=5 fm_port=0x388

Hopefully no errors. If so, save the parameters

root@ubuntu:/etc # cat /etc/modprobe.conf
alias sound-card-0 snd-es18xx
options snd-es18xx isapnp=0 port=0x220 mpu_port=0x330 dma1=1 dma2=5 irq=5 fm_port=0x388

This works, but has an alarming side effect: on boot I saw "warning! /etc/modprobe.conf exists but does not include /etc/rc.modules" (or something... it scrolled off and I can't find it in dmesg or messages... where should I look?) So I am guessing there is a better pace to put module parameters.

Suggested by DanielTChen:

Use /etc/modprobe.d/<module name> instead, e.g.,

$ echo "options snd-es18xx isapnp=0 port=0x220 mpu_port=0x330 dma1=1 dma2=5 irq=5 fm_port=0x388" | sudo tee -a /etc/modprobe.d/snd-es18xx
==
Now we can test our setup
{{{
#aplay should now list your sound card
Line 93: Line 66:

/usr/bin/speaker-test (beep...)

Hoary - I have sound with aplay, speaker-test and xmms, but not flash-mozilla firefox plugin

crimsun: carl: you can create an .asoundrc and overload pcm.dsp0

(never got any more on this tip)
#the speaker should beep
$ /usr/bin/speaker-test
}}}
Line 179: Line 147:
 

Do not report problems on this page; use the normal support channels.

  • Check that sound is unmuted and that the volume is turned up
    • I found it hard to find these controls: its not the "sound" in preferences; click on panel; add to panel; volume controls; speaker icon appears on panel; left click on icon; preferences; played around here and it worked
    • Unmute everything. I had to unmute "Master Surround" even though I only have two speakers, for example.
  • Most sound problems are the result of failed hardware detection, so see DebuggingHardwareDetection

  • When reporting a problem, include (in addition to the information requested in DebuggingHardwareDetection):

    • Output of aplay -l

  • Here is a good sound troubleshooting page: http://linux.iuplog.com/default.asp?item=94639

  • See also SoundProblemsHoary

  • Test different "Sound Servers": Go to System > Preferences > Multimedia Systems Selector. From there, you can test the different options. For me, there are four different sound servers installed, and only one works. This is probably your problem if you cannot play audio with xine or rhythmbox, but you can with xmms or helix/realplayer.

  • [http://ubuntuforums.org/showthread.php?t=44753 Howto: Happy ALSA, OSS, ESD, with Duplex - Sound Settings]

Useful Tips & Tricks

You can use aplay to get a list of soundcards configured by alsa

$ aplay -l
aplay: device_list:200: no soundcards found...

The following commands can help to figure out what sound card (chip set) you have (Look for lines that contain 'Multimedia audio controller')

$ lspci -v 
$ lspnp -v

Another usefull script to gather specs about sound-cards and drivers is [http://alsa.opensrc.org/index.php?page=aadebug aadebug].

“A word about compatibility: even though most sound cards are claimed to be SoundBlaster compatible, very few currently sold cards are compatible enough to work with the Linux SoundBlaster driver. “ - http://www.tldp.org/HOWTO/Sound-HOWTO/x96.html#AEN120

Now figure out which module you need:

To see if this module is available on your system (it usually is) try the following command:

$ modinfo [modulename]

This will also list the possible parameters for the module. For example some ISA cards require you to pass isapnp=0 to modprobe. It may also require the IRQ and IO of the card if that's the case, these can be found in the output of the aadebug script.

Now that you've figured out all this information, lets try loading the module

#modprobe example
$ sudo modprobe snd_es18xx isapnp=0 port=0x220 mpu_port=0x330 dma1=1 dma2=5 irq=5 fm_port=0x388

If this doesn't return any errors, we can save the parameters.

$ echo options [module-name] [module-options] >> /etc/modprobe.d/[module-name]

Now we can test our setup

#aplay should now list your sound card
root@ubuntu:/etc # aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ES1878 [ESS AudioDrive ES1878], device 0: ES1878 [ESS AudioDrive ES1878]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
#the speaker should beep
$ /usr/bin/speaker-test  

PolypAudio

Suggested by DanielTChen

The recommended method is to use the polypaudio daemon (esd replacement) and to leave/set applications to use ESounD output. See the Sound section in /usr/share/doc/mozilla-firefox/README.Debian

Software Mixing

A much better way of getting esd to work with non-esd-aware apps is to make alsa use its software mixer.

$ sudo /etc/init.d/alsa-utils stop $ sudo gedit /var/lib/alsa/asound.state

  • (add the following text verbatim to the start of this file)

$ sudo /etc/init.d/alsa-utils start

  # This text should be added to the beginning of
  # /var/lib/alsa/asound.state.  You only need to add
  # it once -- it is saved across reboots.

  pcm.asymed {
        type asym
        playback.pcm dmix
        capture.pcm dsnoop
  }
  pcm.default {
        type plug
        slave.pcm asymed
  }
  pcm.dmix {
        type dmix
        ipc_key 5678293
        ipc_key_add_uid yes
        slave {
                pcm 'hw:0,0'
                period_time 0
                period_size 128
                buffer_size 2048
                format S16_LE
                rate 48000
        }
  }
  pcm.dsnoop {
        type dsnoop
        ipc_key 5778293
        ipc_key_add_uid yes
        slave {
                pcm 'hw:0,0'
                period_time 0
                period_size 128
                buffer_size 2048
                format S16_LE
                rate 48000
        }
  }

Now as many programs as you want can all use the sound card simultaneously, both the output and the microphone! ESD-aware apps can use ESD, other apps will still work fine.

One notable misfeature of ESD is that it often ruins the A/V sync when playing videos. After setting up the software mixer, you might find it useful to turn esd off altogether (in tthe Sound control panel uncheck "Enable Software Mixing"). Now, especially with GStreamer 0.10, your movies should have perfect A/V sync.

It's a shame that software mixing isn't enabled on Ubuntu by default.

More on Software Mixing

A problem is the default config is OSS doesn't let 2 apps make sound at the same time. Here is a report of how it was dealt with: Basically get esd to relinquish control of the sound when its not in use. Then add mixing for oss so you can use multiple oss programs at once, like Quake3 and Teamspeak, or in my case, Wolfenstein and Teamspeak

First use section 3 here: http://www.ubuntulinux.org/wiki/RestrictedFormats, then do this: http://alsa.opensrc.org/index.php?page=DmixPlugin


Handy links:

http://alsa.opensrc.org/index.php?page=OssEmulation

CategoryDocumentation CategoryCleanup

DebuggingSoundProblems (last edited 2014-07-26 11:08:14 by penalvch)