komputes

Attachment 'audio-troubleshooting.txt'

Download

   1 Ubuntu Linux - Linux Audio Subsystem Introduction & Troubleshooting Guide
   2 komputes <komputes AT-SpamFree ubuntu DOT com>
   3 Version 0.3 - For use with console-presenter
   4 
   5 
   6 1 - Make sure that the sound system is turned on and the hardware volume regulator is up.
   7 
   8 2 - Check software volume levels for low/muted volume.
   9 
  10 You can also run the following commands to make volume adjustments 
  11 $ alsamixer #Will bring up PulseAudio abstract volume
  12 $ alsamixer -c0 # Will bring up ALSA volume levels for Card 0
  13 
  14 3 - Listing sound cards.
  15 
  16 There are multiple ways of doing this...
  17 
  18 Listing sound cards
  19 
  20 $ cat /proc/asound/cards
  21 $ aplay -l
  22 $ lspci -v | grep -A10 -i audio
  23 $ hwinfo --sound
  24 $ cat /dev/sndstat
  25 
  26 4 - Make sure the user has permissions to use audio devices in System > Administration > Users and Groups
  27 
  28 You can also do this via CLI by making sure that the username is part of the "audio" group.
  29 
  30 $ grep audio /etc/group
  31 
  32 5 - Try different sound server (i.e. revert to ALSA).
  33 
  34 Go to System > Preferences > Sound
  35 
  36 Change all options from Auto-Detect to ALSA
  37 
  38 In a terminal (Applications > Accessories > Terminal) type in the command:
  39 
  40 $ killall pulseaudio
  41 
  42 In 8.10 and upgraded releases, you will want to turn off PulseAudio session manager (at boot) by going into System > Preferences > Sessions and uncheck "PulseAudio Session Management" 
  43 
  44 6- Try to remove the user sound configuration file and restart a session:
  45 
  46 $ rm ~/.asoundrc ~/.pulse/ ~/.pulse-cookie
  47 
  48 7 - BIOS options can allow or stop audio from working in the operating system. Check BIOS settings to see if there is anything relating to audio. It is also recommended to reset BIOS settings to default and try again.
  49 
  50 8 - Try to diagnose conflicting modules. If you find one, report it as a bug.
  51 
  52 $ lspci -nnk
  53 
  54 If you run this command and see more than one module listed for one card, it's possible that you have a conflict.
  55 
  56 If this is the case you may need to blacklist the module which is interfering by adding it to /etc/modprobe.d/blacklist(.conf in jaunty+)
  57 
  58 9 - Now that you know the model and PCI ID of the card, you now want to see the "Codec" or how the sound card is wired. To lookup the codec of the card use the following command:
  59 
  60 $ cat /proc/asound/card*/codec* | grep Codec
  61 
  62 
  63 10 - Make sure the following packages are installed
  64 
  65 $ sudo apt-get install linux-ubuntu-modules-`uname -r` linux-generic
  66 
  67 11 - Is sound card supported? Check the ALSA SoundCard Matrix page to check.
  68 
  69 If NOT you can
  70 A - Contact developers to get card supported
  71 B - Go out and buy yourself a compatible sound card
  72 
  73 12 - Is the card supported but needs an option/quirk applied?
  74 
  75 Quirk/Option details for particular cards can be found in 
  76 /usr/share/doc/alsa-base/driver/ALSA-Configuration.txt.gz
  77 
  78 Changes are made in:
  79 /etc/modprobe.d/alsa-base [Before Jaunty]
  80 /etc/modprobe.d/alsa-base.conf [After Jaunty]
  81 
  82 13 - Run ubuntu-bug alsa-base to create a bug on Launchpad.
  83 
  84 The alsa-info.sh script from ALSA contains detailed information concerning the sound hardware. Include the output file/URL in the bug you are reporting. 
  85 
  86 If you need to add information to an existing bug (to bug #696969 for example) run "apport-collect -p alsa-base 696969".
  87 
  88 Now for random notes!
  89 All your alsa-base are belong to us!
  90 
  91 If you are troubleshooting one or multiple USB audio devices. You may want to add the following line to set the sound card index number:
  92 
  93 $ sudo nano /etc/modprobe.d/alsa-base (alsa-base.conf in Jaunty+)
  94 
  95 # and add the following text #
  96 options snd-usb-audio index=1
  97 
  98 # and then restart alsa with the following command#
  99 /etc/init.d/alsa-utils restart
 100 
 101 All ALSA modules are named thn the following manner:
 102 <prefix>	<module_name>
 103 snd-		via82xx
 104 
 105 If you need to load a module at startup, add the module name to /etc/modules
 106 
 107 If you need to do this manually, you should report that it is not auto-detected it to Launchpad
 108 
 109 To check the snd modules which are loaded, use the following command:
 110 $ lsmod | grep snd
 111 
 112 Resetting back to default - The official ubuntu sound stack core
 113 sudo aptitude --purge reinstall linux-sound-base alsa-base alsa-utils linux-image-`uname -r` linux-ubuntu-modules-`uname -r` libasound2
 114 
 115 Profiles
 116 Profiles for a machine can be saved and loaded.
 117 
 118 Saving a copy: 
 119 $ cp /var/lib/alsa/asound.state /media/disk/
 120 
 121 Loading a preset: 
 122 $ alsactl -F -f asound.state restore
 123 
 124 Older programs may expect ALSA, for this there is a command called pasuspender which will temporarily suspend PulseAudio for a particular process and route audio directly through ALSA.
 125 
 126 
 127 In the following example we will disable PulseAudio for the arecord command
 128 
 129 $ pasuspender -- arecord -D plughw:0
 130 $ arecord -D plughw:0 file.wav
 131 
 132 Older programs and some games may expect OSS, for this there is an OSS module for ALSA
 133 
 134 $ sudo apt-get install alsa-oss
 135 
 136 Usage:
 137 $ aoss quake
 138 
 139 MIDI support
 140 MIDI data is usually transfered on port 330, for this reason, we may need to specify this in /etc/modprobe.d/alsa-base in the following manner:
 141 
 142 options snd-maudio mpu_port=0x330
 143 
 144 Frequently asked questions
 145 
 146 What are the different names associated to output/input devices depending on the sound server which is naming/abstracting them?
 147 
 148 Most, if not all, sound servers present "Playback" and "Capture" views. Some of these are slightly different, e.g., "Recording" vice "Capture". Few people have trouble choosing the appropriate view, however, given the prevalence of audio machinery in the real world.
 149 
 150 PulseAudio is consciously choosing to present only Playback and Recording views as logical abstractions. From the physical devices, there are Output Devices and Input Devices.
 151 
 152 GSt and Xine-lib, when using PulseAudio, present PA's views.
 153 
 154 ALSA currently chooses to present Playback and Capture.
 155 
 156 GSt and Xine-lib, when using ALSA, present ALSA's views.
 157 
 158 Phonon, whether using GSt or Xine-lib, present the appropriate backend's views (so, either ALSA or PulseAudio).
 159 
 160 Would it be possible to run two or more sound servers at the same time. Is ALSA considered a "server" or does that term apply to PA and JACK?
 161 
 162 If there is only one audio device in the machine capable of playback and recording, then *generally*, it's not possible to have two or more sound servers running at the same time using the same device. This is the case due to most modern audio controllers having removed/omitted support for hardware multiopen as the older EMU (Sound Blaster Awe/Live), Aureal Vortex (Turtle Beach), and Cirrus Logic had.
 163 
 164 Once one introduces another audio device, it instantly becomes possible to run multiple sound servers, since it's (fairly) trivial to tell different sound servers to use different devices.
 165 
 166 Anything providing a "client" interface for audio is considered a client-server architecture. In this fashion, ALSA is as much a server as PA and JACK.
 167 
 168 *However*, most people don't think of ALSA in the traditional "play my music across a network" sense. PA does this, netjack does this, etc. 
 169 
 170 What are the important files are associated to ALSA?
 171 
 172 /var/lib/alsa/asound.state (system wide ALSA library definition for logical devices)
 173 ~/.asoundrc (user specific ALSA library definition for logical devices)
 174 /usr/share/alsa/alsa.conf ubuntu makes specific changes here to support PA and bluez
 175 /etc/asound.conf is the canonical system-wide ALSA library definition for logical devices
 176 
 177 These files that allow for (re)defining ALSA library logical configurations manipulate which audio device is chosen as default (at runtime, or application invocation), how specific channels are routed between multi-channel devices, etc.
 178 
 179 How does PulseAudio work in relation to ALSA?
 180 Currently ALSA talks to the audio devices and load proper sound modules to make them work. PA uses whatever ALSA hands it.
 181 
 182 Here is an example of the layers at work:
 183  -- Rhythmbox --
 184  -- GStreamer --
 185  -- PulseAudio --
 186  -- Alsa-lib --
 187  -- /dev/snd/* --
 188  -- Alsa-kernel / linux --
 189  -- audio hardware --
 190 
 191 PulseaAdio was first shipped with Ubuntu 8.04; as of 8.10, all native ALSA apps are exposed/routed through the pulse alsa-lib pcm+ctl plugins. The pulse alsa-lib pcm+ctl plugins are shipped in libasound2-plugins (from the alsa-plugins source package)
 192 
 193 This is what it looks like if you are only using ALSA (Previous to Ubuntu 8.04):
 194  -- Rhythmbox --
 195  -- GStreamer --
 196  -- Alsa-lib --
 197  -- /dev/snd/* --
 198  -- Alsa-kernel / linux --
 199  -- audio hardware --
 200 
 201 
 202 How does one unload a snd-module? Usually with modules, rmmod should do the trick, but there must be a simple way to turn off the card which is in use before removing the module. Trying to unload the module with rmmod will dive you this error
 203 $ sudo rmmod snd-hda-intel
 204 $ ERROR: Module snd_hda_intel is in use
 205 
 206 In Ubuntu, this step would be: sudo /sbin/alsa force-unload
 207 
 208 The command takes care of killing processes using the sound devices and unloading the sound driver modules in order.
 209 
 210 How to tell whether two sound modules are interfering with each other?
 211 
 212 If two modules are assigned to a sound card (in lspci -vv) there may be a conflict. Known/frequent conflicts include:
 213 
 214 nvsound conflicts with snd-intel8x0
 215 emu10k1 conflicts with snd-emu10k1
 216 ac97_codec conflicts with snd-ac97-codec
 217 via82cxxxaudio conflicts with snd-via82xx
 218 
 219 None of the above should be a problem in Ubuntu; we decided many releases ago to ship ALSA and not OSS.
 220 
 221 snd-ca0106 & ALSA X-Fi driver all conflict with with snd-hda-intel

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2009-10-04 19:14:51, 9.3 KB) [[attachment:audio-troubleshooting.txt]]
  • [get | view] (2010-09-06 17:11:14, 4.7 KB) [[attachment:kms_presentation.txt]]
 All files | Selected Files: delete move to page

You are not allowed to attach a file to this page.