DebuggingSoundProblems
| 
  
   Size: 6076 
  
  Comment: more cleanup 
 | 
  
   Size: 7948 
  
  Comment: Removed section about hardware detection in favour of linking to such an article. 
 | 
| Deletions are marked like this. | Additions are marked like this. | 
| Line 1: | Line 1: | 
| Do not report problems on this page; use the normal support channels. | #### 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: | 
|  * 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.  | 
= Basic troubleshooting = | 
| Line 7: | Line 8: | 
|  * 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  | 
Running Lucid (10.04) or later? There is a troubleshooter that checks for some of the most common problems. Open a Terminal (Program -> Accessories -> Terminal), then enter this command: | 
| Line 19: | Line 10: | 
| $ aplay -l aplay: device_list:200: no soundcards found...  | 
ubuntu-bug audio | 
| Line 23: | Line 13: | 
| The following commands can help to figure out what sound card (chip set) you have (Look for lines that contain 'Multimedia audio controller') | Running Ubuntu Karmic Koala (9.10)? [[https://wiki.ubuntu.com/DebuggingSoundProblems/KarmicCaveats|First have a look at this list]] of the most common problems with sound in this release. == 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. :-( 2. Is your speaker or microphone muted? Check here (9.10 and later) : * [[Audio/CheckForMutedSpeakerVolume|Check for muted speaker]] * [[Audio/CheckForMutedMicrophone|Check for muted microphone]] == 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"). 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. == 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. == 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. = 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, the way to report it varies between versions. For Ubuntu Lucid Lynx (10.04) and later, run the following terminal command:  | 
| Line 25: | Line 64: | 
| $ 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: * 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. 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  | 
ubuntu-bug audio | 
| Line 53: | Line 67: | 
| If this doesn't return any errors, we can save the parameters. | For Ubuntu Jaunty (9.04) or Karmic (9.10), run the following terminal command: | 
| Line 55: | Line 69: | 
| $ echo options [module-name] [module-options] >> /etc/modprobe.d/[module-name] | ubuntu-bug -p alsa-base | 
| Line 58: | Line 72: | 
| 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 }}}  | 
This will submit a detailed bug report with information about your current system. | 
| Line 70: | Line 74: | 
| == PolypAudio == | For older versions, or if the above fails for some reason, you can file a bug report, then upload alsa-info information [[Audio/AlsaInfo|according to these instructions]]. | 
| Line 72: | Line 76: | 
| Suggested by DanielTChen | == Triaging sound bugs == | 
| Line 74: | Line 78: | 
| 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 | In general, no-sound/low-sound/headphone-no-sound/no auto-mute/etc. bugs should be: * Filed against the '''linux''' source package. * Add the '''kernel-sound''' tag * '''Subscribe''' (do not assign) the '''Ubuntu-audio''' team (not the ubuntu-audio-dev team)  | 
| Line 76: | Line 83: | 
| 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 77: | Line 85: | 
| * Do not mark bugs as duplicates unless you're 100% sure that both the '''hardware''', '''software''', and '''symptom''' match exactly. Slightly different hardware very often requires slightly different fixes. If in doubt, file a new bug. | |
| Line 78: | Line 87: | 
| == Software Mixing == | [[Audio/SameHardware|Here's an article]] of how to determine whether you have the same hardware as the original bug reporter. | 
| Line 80: | Line 89: | 
| A much better way of getting esd to work with non-esd-aware apps is to make alsa use its software mixer. | = Further sound troubleshooting = | 
| Line 82: | Line 91: | 
| $ 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  | 
After reporting a bug you might want to see the community documentation: | 
| Line 87: | Line 93: | 
| {{{ # 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  | 
 * https://help.ubuntu.com/community/SoundTroubleshootingProcedure * https://help.ubuntu.com/community/Sound * https://help.ubuntu.com/community/SoundTroubleshooting * https://help.ubuntu.com/community/DebuggingSoundProblemsMisc  | 
| Line 142: | Line 99: | 
| Handy links: http://alsa.opensrc.org/index.php?page=OssEmulation CategoryDocumentation CategoryCleanup  | 
CategoryDocumentation CategoryBugSquad CategoryDebugging | 
This page is part of the debugging series — pages with debugging details for a variety of Ubuntu packages.  | 
Basic troubleshooting
Running Lucid (10.04) or later? There is a troubleshooter that checks for some of the most common problems. Open a Terminal (Program -> Accessories -> Terminal), then enter this command:
ubuntu-bug audio
Running Ubuntu Karmic Koala (9.10)? First have a look at this list of the most common problems with sound in this release.
Preliminary checks
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.
 - Is your speaker or microphone muted? Check here (9.10 and later) :
 
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.
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").
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
- 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
 - 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
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).
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.
- 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.
 - 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.
 - 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, the way to report it varies between versions. For Ubuntu Lucid Lynx (10.04) and later, run the following terminal command:
ubuntu-bug audio
For Ubuntu Jaunty (9.04) or Karmic (9.10), run the following terminal command:
ubuntu-bug -p alsa-base
This will submit a detailed bug report with information about your current system.
For older versions, or if the above fails for some reason, you can file a bug report, then upload alsa-info information according to these instructions.
Triaging sound bugs
In general, no-sound/low-sound/headphone-no-sound/no auto-mute/etc. bugs should be:
Filed against the linux source package.
Add the kernel-sound tag
Subscribe (do not assign) the Ubuntu-audio team (not the ubuntu-audio-dev team)
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.
Do not mark bugs as duplicates unless you're 100% sure that both the hardware, software, and symptom match exactly. Slightly different hardware very often requires slightly different fixes. If in doubt, file a new bug.
Here's an article of how to determine whether you have the same hardware as the original bug reporter.
Further sound troubleshooting
After reporting a bug you might want to see the community documentation:
https://help.ubuntu.com/community/SoundTroubleshootingProcedure
https://help.ubuntu.com/community/DebuggingSoundProblemsMisc
DebuggingSoundProblems (last edited 2014-07-26 11:08:14 by penalvch)