DebuggingSoundProblems

Differences between revisions 1 and 46 (spanning 45 versions)
Revision 1 as of 2005-05-28 20:38:13
Size: 4980
Editor: adsl-213-190-44-43
Comment: imported from the old wiki
Revision 46 as of 2009-11-06 12:16:06
Size: 9615
Editor: adsl357-139
Comment: 'grep' collection is not canonical.
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= DebuggingSoundProblems = #### do not move or rename as the Ubuntu Bug Control team uses this page extensively ####
#title Debugging Sound Problems
<<Include(Debugging/Header)>>
||<tablestyle="float:right; font-size: 0.9em; width:30%; background:#F1F1ED; background-repeat: no-repeat; background-position: 98% 0.5ex; margin: 0 0 1em 1em; padding: 0.5em;"><<TableOfContents>>||
Line 3: Line 6:
Do not report problems on this page; use the normal support channels. '''Notes for triagers:'''
 * General no-sound/low-sound/headphone-no-sound/etc. bugs should be marked against the "linux" source package.
 * Only assign bugs to the "alsa-driver" source package if the reporter is using the alsa-source binary package with module-assistant OR is requesting a blacklist or slots/index modification.
Line 5: Line 10:
 * 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

 * 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`
'''''In other words, if in doubt, the bug should be filed against linux and have the ubuntu-audio team subscribed to the bug report.'''''
Line 13: Line 13:
== Contributed by Carl Karsten == = Basic troubleshooting =
Line 15: Line 15:
Here are the commands and web sites I found helpful in getting sound working. == Identifying your hardware ==
If the output of {{{lspci}}} includes a line similar to {{{00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)}}} (a High Definition Audio device)
Line 17: Line 18:
carl@ubuntu:~$ aplay -l Please paste the output of the following command at the top of your bug description:
Line 19: Line 20:
aplay: device_list:200: no soundcards found... {{{
grep "^Codec\|^Vendor Id\|^Subsystem Id\|^Revision Id" /proc/asound/card*/*codec*{,/*} | grep -B2 -A1 $(lspci -nv | grep -A1 0403 | grep Subsystem | sed 's/://g' | awk '{ print $2 }')
}}}
Line 21: Line 24:
Script to gather specs about sound things:
http://alsa.opensrc.org/index.php?page=aadebug
''Note: This doesn't seem to be working (anymore?) on Karmic, when pasting this into a console I get the following error:''
Line 24: Line 26:
To try to figure out what sound card (chip set) you have: ''Answer: This type of collection with 'grep' is ad-hoc, and bound to fail within releases. The proper way to collect information is to use alsa-info.sh, described below. Then, provide a link to the collected information in the bug report. I would like to rewrite this section; if there are disagreements, please say so.''
Line 26: Line 28:
$ lspci -v and lspnp -v, look for lines like this: {{{
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
}}}
Line 28: Line 33:
0000:01:05.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 10) You may see output similar to:
{{{
/proc/asound/card0/codec#0:Codec: Realtek ALC883
/proc/asound/card0/codec#0:Vendor Id: 0x10ec0883
/proc/asound/card0/codec#0:Subsystem Id: 0x10438284
/proc/asound/card0/codec#0:Revision Id: 0x100002
}}}
Line 30: Line 41:
or If you are about to file a driver bug (e.g., absolutely no applications output sound, microphone does not work even after toggling nocap, speakers continue to emit sound after headphones have been inserted), and you think that you see a bug report that matches your symptoms, '''STOP''' and check the bug's attachments to see if these 4 bits of data match. If all four match '''and''' the symptom matches, subscribe to the existing bug. If '''any''' of the 4 data points disagree, you probably have found one of the myriad cases where many different bugs with different root causes that need different patches have the same symptom on the surface. In which case: '''file a new bug.'''
Line 32: Line 43:
06 ESS1878 multimedia controller: audio
Line 34: Line 44:
“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 == Preliminary checks ==
 1. Is your sound system plugged in and switched on. I spent an hour trying to diagnose a sound issue when the problem was that I had switched off the speakers to answer a phone call and forgot that I had done so. :-(
Line 36: Line 47:
If you have an ISA card, you MUST pass isapnp=0 to modprobe. == Checking volume levels ==
Before messing around with uninstalling and installing various sound programs to fix a problem, check your volume levels. It is often the case that a muted channel is the problem, even though the description may not sound immediately relevant. In this regard, muted Surround or Center channels are common culprits. So unmute and raise the volume of one channel at a time and check whether sound is then produced by a running sound application e.g. Rhythmbox.
Line 38: Line 50:
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
You can access the volume levels for the various channels from the command line or the GUI.
Line 41: Line 52:
Now figure out which module you need.  1. From command line: Open a terminal window and launch ''alsamixer''. Then unmute as described above.
  * Note: Often you need to specify the card you want to control, do that by launching ''alsamixer -c0'' or ''alsamixer -c1'' etc, where the number after ''-c'' corresponds to your soundcard's index. To know what indexes your soundcards have, see below (under "Checking sound device assignment").
Line 43: Line 55:
http://www.alsa-project.org/alsa-doc/  1. From GUI: This can be done by running something like ''gnome-alsamixer'' from a terminal window or navigating to your your Volume Control. Then unmute as described above. Also check that your switches are set correctly - for instance that if you use the analog output the analog switch is set ON or that the digital or S/PDIF switch is set OFF. You can select which tracks/switches are visible in Volume Control (see above) under Edit->Preferences.
  * Note: These controls have equivalent functionality to alsamixer but with a graphical interface. Checking or unchecking devices in the these accomplishes the exact same thing as unmuting or muting devices, respectively, in alsamixer.
  * Starting with Ubuntu 7.04, the sound volume control is also accessible from Menu->Sound&Video->Volume Control. It may be hidden in your menus but can be shown by going to System > Preferences > Main Menu and under Applications > Sound&Video ticking Volume Control.
Line 45: Line 59:
Pick the manufacturer, Go – This should make it clear what module you need. == Checking sound device assignment ==
 1. Most sound applications output to card0 by default. In some cases, other audio devices (like a USB MIDI Keyboard) might be recognized as a soundcard and take card0, bumping your real soundcard to card1. To see which devices are connected to which cards, do the following:
  * {{{
 cat /proc/asound/cards
}}}
 1. You can manipulate the device number assignment by adding modifying /etc/modprobe.d/sound.conf (create it if necessary). Next boot, the snd-usb-audio device will get index 1 (by default it will be 2).
  * {{{
 options snd slots=,snd-usb-audio
}}}
The index numbers (0, 1, ... 7) signify the priority of the device, with the highest priority device being 0, then 1, and so forth. In theory, applications should first attempt to use the highest priority device first, but if for some reason the application is unable to use the device, it will use the next highest priority device. For example, if you have a USB sound card that can get picked up with OSS, which browsers, flash, and skype may not output, if you set your USB card at first priority, it will play when using, say, Rhythmbox, but your other applications will play through your other soundcard. FIXME PLEASE: for more information go to the ALSA-Configuration kernel document.
Line 47: Line 70:
http://www.alsa-project.org/alsa-doc/doc-php/template.php?company=ESS+Technology&card=.&chip=ES18xx&module=es18xx == Checking permissions and resources ==
  1. Make sure that all users needing access to the Sound Device can "Use audio devices" in the "User Privileges" tab of users-admin (System->Administration->Users and Groups).
  1. Test different "Sound Servers": Go to System > Preferences > Sound ("Multimedia Systems Selector" in earlier editions of Ubuntu). From there, you can test the different options. In some scenarios several different sound servers may be installed, and only one may work. This is probably the origin of the problem if you cannot play audio with xine or rhythmbox, but you can with xmms or helix/realplayer.
  1. If you application sounds works, but your system sounds does not (login, logout, error sounds...) try removing the .asoundrc* files from your own directory (e.g. with 'rm .asoundrc*'). It should make the system sounds work without a reboot.
  1. If you can get absolutely no sound and you have an onboard sound chip you can try to disable it in the BIOS. This solves the problem is some cases.
  1. If you have no sound and you have a regular sound card type "lsmod | grep snd" in the terminal and see if there is more than one card listed. It's possible that you have a motherboard sound chip that is interfering. Add it to the bottom of the blacklist file. For example, sudo nano /etc/modprobe.d/blacklist then add "blacklist snd_via82xx" to the bottom.
Line 49: Line 77:
snd-es18xx
Line 51: Line 78:
Between that, modinfo <module>, and linux/Documentation/sound/alsa/ALSA-Configuration.txt: = Reporting Sound Bugs =
Line 53: Line 80:
  Module snd-es18xx Please do not report problems on this page; use the normal support channels instead. See http://www.ubuntu.com/support
Line 55: Line 82:
    Module for ESS AudioDrive ES-18xx soundcards. If you feel you have encountered a software bug, please report the bug using the following command in a terminal:
{{{
Line 57: Line 85:
    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)
ubuntu-bug -p alsa-base
Line 65: Line 87:
    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.
}}}
Line 69: Line 89:
    The power-management is supported. This will submit a detailed bug report regarding your current system and will work on any release later than and including 9.04 (Jaunty Jackalope).
Line 71: Line 91:
You should be able to figure out a line like this:
Line 73: Line 92:
 sudo modprobe snd_es18xx isapnp=0 port=0x220 mpu_port=0x330 dma1=1 dma2=5 irq=5 fm_port=0x388 == Automatic Sound Information Collection ==
Line 75: Line 94:
Hopefully no errors. If so, save the parameters In the event that you are not running Jaunty Jackalope (9.04) you can less automatically gather sound information using the following script [[http://alsa-project.org/alsa-info.sh]] . By default, the script uploads the information to alsa-project.org . This information can be used by ALSA developers to improve current support for some cards. If you do not wish your information to be uploaded, please use the --no-upload argument when running the script. The script was written to aid the alsa developers, and also to help the people in #alsa to sort out sound issues. Please download and run the script as follows:
 1. {{{
 bash alsa-info.sh
}}}
 1. The script will generate a URL. Please add this URL to your bug report.
 1. If for some reason the script does not generate a URL, please use the --pastebin option (our original upload method)
 1. The alsa-info.sh script can either be run as 'bash alsa-info.sh' _or_ made executable and run as './alsa-info.sh'.
Line 77: Line 102:
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
= Further sound troubleshooting =
Line 81: Line 104:
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.

== Revised 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

==

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

/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)

== Revised 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
After reporting a bug you might want to see the community documentation:
 * https://help.ubuntu.com/community/Sound
 * https://help.ubuntu.com/community/SoundTroubleshooting
 * https://help.ubuntu.com/community/DebuggingSoundProblemsMisc
Line 110: Line 110:
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 CategoryBugSquad CategoryDebugging

Debugging Central

This page is part of the debugging series — pages with debugging details for a variety of Ubuntu packages.

Notes for triagers:

  • General no-sound/low-sound/headphone-no-sound/etc. bugs should be marked against the "linux" source package.
  • Only assign bugs to the "alsa-driver" source package if the reporter is using the alsa-source binary package with module-assistant OR is requesting a blacklist or slots/index modification.

In other words, if in doubt, the bug should be filed against linux and have the ubuntu-audio team subscribed to the bug report.

Basic troubleshooting

Identifying your hardware

If the output of lspci includes a line similar to 00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03) (a High Definition Audio device)

Please paste the output of the following command at the top of your bug description:

grep "^Codec\|^Vendor Id\|^Subsystem Id\|^Revision Id" /proc/asound/card*/*codec*{,/*} | grep -B2 -A1 $(lspci -nv | grep -A1 0403 | grep Subsystem | sed 's/://g' | awk '{ print $2 }')

Note: This doesn't seem to be working (anymore?) on Karmic, when pasting this into a console I get the following error:

Answer: This type of collection with 'grep' is ad-hoc, and bound to fail within releases. The proper way to collect information is to use alsa-info.sh, described below. Then, provide a link to the collected information in the bug report. I would like to rewrite this section; if there are disagreements, please say so.

Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.

You may see output similar to:

/proc/asound/card0/codec#0:Codec: Realtek ALC883
/proc/asound/card0/codec#0:Vendor Id: 0x10ec0883
/proc/asound/card0/codec#0:Subsystem Id: 0x10438284
/proc/asound/card0/codec#0:Revision Id: 0x100002

If you are about to file a driver bug (e.g., absolutely no applications output sound, microphone does not work even after toggling nocap, speakers continue to emit sound after headphones have been inserted), and you think that you see a bug report that matches your symptoms, STOP and check the bug's attachments to see if these 4 bits of data match. If all four match and the symptom matches, subscribe to the existing bug. If any of the 4 data points disagree, you probably have found one of the myriad cases where many different bugs with different root causes that need different patches have the same symptom on the surface. In which case: file a new bug.

Preliminary checks

  1. Is your sound system plugged in and switched on. I spent an hour trying to diagnose a sound issue when the problem was that I had switched off the speakers to answer a phone call and forgot that I had done so. Sad :-(

Checking volume levels

Before messing around with uninstalling and installing various sound programs to fix a problem, check your volume levels. It is often the case that a muted channel is the problem, even though the description may not sound immediately relevant. In this regard, muted Surround or Center channels are common culprits. So unmute and raise the volume of one channel at a time and check whether sound is then produced by a running sound application e.g. Rhythmbox.

You can access the volume levels for the various channels from the command line or the GUI.

  1. From command line: Open a terminal window and launch alsamixer. Then unmute as described above.

    • Note: Often you need to specify the card you want to control, do that by launching alsamixer -c0 or alsamixer -c1 etc, where the number after -c corresponds to your soundcard's index. To know what indexes your soundcards have, see below (under "Checking sound device assignment").

  2. From GUI: This can be done by running something like gnome-alsamixer from a terminal window or navigating to your your Volume Control. Then unmute as described above. Also check that your switches are set correctly - for instance that if you use the analog output the analog switch is set ON or that the digital or S/PDIF switch is set OFF. You can select which tracks/switches are visible in Volume Control (see above) under Edit->Preferences.

    • Note: These controls have equivalent functionality to alsamixer but with a graphical interface. Checking or unchecking devices in the these accomplishes the exact same thing as unmuting or muting devices, respectively, in alsamixer.
    • Starting with Ubuntu 7.04, the sound volume control is also accessible from Menu->Sound&Video->Volume Control. It may be hidden in your menus but can be shown by going to System > Preferences > Main Menu and under Applications > Sound&Video ticking Volume Control.

Checking sound device assignment

  1. Most sound applications output to card0 by default. In some cases, other audio devices (like a USB MIDI Keyboard) might be recognized as a soundcard and take card0, bumping your real soundcard to card1. To see which devices are connected to which cards, do the following:
    •  cat /proc/asound/cards
  2. You can manipulate the device number assignment by adding modifying /etc/modprobe.d/sound.conf (create it if necessary). Next boot, the snd-usb-audio device will get index 1 (by default it will be 2).
    •  options snd slots=,snd-usb-audio

The index numbers (0, 1, ... 7) signify the priority of the device, with the highest priority device being 0, then 1, and so forth. In theory, applications should first attempt to use the highest priority device first, but if for some reason the application is unable to use the device, it will use the next highest priority device. For example, if you have a USB sound card that can get picked up with OSS, which browsers, flash, and skype may not output, if you set your USB card at first priority, it will play when using, say, Rhythmbox, but your other applications will play through your other soundcard. FIXME PLEASE: for more information go to the ALSA-Configuration kernel document.

Checking permissions and resources

  1. Make sure that all users needing access to the Sound Device can "Use audio devices" in the "User Privileges" tab of users-admin (System->Administration->Users and Groups).

  2. Test different "Sound Servers": Go to System > Preferences > Sound ("Multimedia Systems Selector" in earlier editions of Ubuntu). From there, you can test the different options. In some scenarios several different sound servers may be installed, and only one may work. This is probably the origin of the problem if you cannot play audio with xine or rhythmbox, but you can with xmms or helix/realplayer.

  3. If you application sounds works, but your system sounds does not (login, logout, error sounds...) try removing the .asoundrc* files from your own directory (e.g. with 'rm .asoundrc*'). It should make the system sounds work without a reboot.
  4. If you can get absolutely no sound and you have an onboard sound chip you can try to disable it in the BIOS. This solves the problem is some cases.
  5. If you have no sound and you have a regular sound card type "lsmod | grep snd" in the terminal and see if there is more than one card listed. It's possible that you have a motherboard sound chip that is interfering. Add it to the bottom of the blacklist file. For example, sudo nano /etc/modprobe.d/blacklist then add "blacklist snd_via82xx" to the bottom.

Reporting Sound Bugs

Please do not report problems on this page; use the normal support channels instead. See http://www.ubuntu.com/support

If you feel you have encountered a software bug, please report the bug using the following command in a terminal:

ubuntu-bug -p alsa-base

This will submit a detailed bug report regarding your current system and will work on any release later than and including 9.04 (Jaunty Jackalope).

Automatic Sound Information Collection

In the event that you are not running Jaunty Jackalope (9.04) you can less automatically gather sound information using the following script http://alsa-project.org/alsa-info.sh . By default, the script uploads the information to alsa-project.org . This information can be used by ALSA developers to improve current support for some cards. If you do not wish your information to be uploaded, please use the --no-upload argument when running the script. The script was written to aid the alsa developers, and also to help the people in #alsa to sort out sound issues. Please download and run the script as follows:

  1.  bash alsa-info.sh
  2. The script will generate a URL. Please add this URL to your bug report.
  3. If for some reason the script does not generate a URL, please use the --pastebin option (our original upload method)
  4. The alsa-info.sh script can either be run as 'bash alsa-info.sh' _or_ made executable and run as './alsa-info.sh'.

Further sound troubleshooting

After reporting a bug you might want to see the community documentation:


CategoryDocumentation CategoryBugSquad CategoryDebugging

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