Command Line Help for Sound Troubleshooting
This is an addendum to
http://ubuntuforums.org/showthread.php?t=843012
so if you are looking for troubleshooting help you should really start there.
When troubleshooting a sound problem it is important to gather as much information as possible. Here are a bunch of commands you can execute from a terminal that will gather that information. These commands are very simple and will not do anything but display information.
The terminal is where you execute commands. The line you write these commands to is called the command line. You can open a terminal by going to Applications/Accessories/Terminal.
These are the commands we will be using. You can copy them from here with ctrl-c and paste them in terminal with ctrl-shift-v and then hit enter to execute them. Do this one at a time.
Code:
lspci
lsusb
cat /proc/asound/cards
cat /proc/asound/modules
aplay -l
arecord -l
Since you will want to save this information you can copy it from terminal by highlighting the information you want to save with the cursor and using ctrl-shift-c to copy it. You can then use ctrl-v to paste it to a tomboy note or some other notepad.
These listings following are the actual results of using these commands on my machine. I have 5 hardware sound devices. A sound chip on my motherboard, a pci sound card, a HDMI sound chip on my graphics cards, a usb webcam, and a usb headset. This is how we find them and gather information about them.
lspci will list all the pci devices the system can detect. Of importance for sound troubleshooting are devices listed as Audio device or Multimedia audio controller and the usb controllers for my usb devices. As you can see, 3 of the devices are detected and 6 usb controllers so thing are looking good so far. There is the Audio device: ATI....SBx00 Azalia which is my on-board sound chip. There is the Audio Device: ATI...RV635 Audio Device which is my HDMI chip on my HD3650 graphics card. There is the Multimedia Controller: C_Media 8738 (rev 10) which is my C-Media 8768 PCI sound card.
Code:
lspci
00:00.0 Host bridge: Advanced Micro Devices [AMD] RS780 Host Bridge
00:02.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (ext gfx port 0)
00:07.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 3)
00:11.0 SATA controller: ATI Technologies Inc SB700/SB800 SATA Controller [IDE mode]
00:12.0 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller
00:12.1 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI1 Controller
00:12.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller
00:13.0 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller
00:13.1 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI1 Controller
00:13.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller
00:14.0 SMBus: ATI Technologies Inc SBx00 SMBus Controller (rev 3a)
00:14.1 IDE interface: ATI Technologies Inc SB700/SB800 IDE Controller
00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia
00:14.3 ISA bridge: ATI Technologies Inc SB700/SB800 LPC host controller
00:14.4 PCI bridge: ATI Technologies Inc SBx00 PCI to PCI Bridge
00:14.5 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI2 Controller
00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration
00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map
00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control
01:00.0 VGA compatible controller: ATI Technologies Inc Mobilitiy Radeon HD 3600 Series
01:00.1 Audio device: ATI Technologies Inc RV635 Audio device [Radeon HD 3600 Series]
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)
03:05.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 10)
To find the usb devices we need to use lsusb. It will list everything connected by usb. It sees my multicard reader, my C-Media usb headset (which is a Plantronics) and my Logitec webcam.
Code:
lsusb
Bus 007 Device 002: ID 05e3:070e Genesys Logic, Inc. X-PRO CR20xA USB 2.0 Internal Card Reader
Bus 007 Device 001: ID 0000:0000
Bus 006 Device 001: ID 0000:0000
Bus 004 Device 003: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
Bus 004 Device 001: ID 0000:0000
Bus 005 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 003: ID 046d:08d7 Logitech, Inc.
Bus 001 Device 001: ID 0000:0000
Now we will use cat /proc/asound/cards. cat is short for concatenate or add to the end. It will take a file and add it to the end of the standard output which is the terminal screen. /proc is a sort of virtual directory where processes hang out. So to find out what the process asound, which is the sound process, has found for sound cards/hardware devices we use cat /proc/asound/cards
Code:
cat /proc/asound/cards
0 [CMI8768 ]: CMI8738-MC8 - C-Media CMI8768
C-Media CMI8768 at 0xe800, irq 21
1 [SB ]: HDA-Intel - HDA ATI SB
HDA ATI SB at 0xfe9f4000 irq 18
2 [HDMI ]: HDA-Intel - HDA ATI HDMI
HDA ATI HDMI at 0xfeaec000 irq 17
3 [U0x46d0x8d7 ]: USB-Audio - USB Device 0x46d:0x8d7
USB Device 0x46d:0x8d7 at usb-0000:00:12.0-3, full speed
4 [default ]: USB-Audio - C-Media USB Headphone Set
C-Media USB Headphone Set at usb-0000:00:13.1-1, full speed
As you can see, asound has all the cards. It has even numbered them for us and told us what irq interrupts or usb controllers they are using .
Now we should see which alsa modules these cards are using. For that we use cat /proc/asound/modules.
Code:
cat /proc/asound/modules
0 snd_cmipci
1 snd_hda_intel
2 snd_hda_intel
3 snd_usb_audio
4 snd_usb_audio
As you can see, the C_Media card is using the cmipci module, the two HDA devices are using the snd_hda_intel module and the usb devices are using the snd_usb_audio device module.
Now we will use aplay-l to get some other specific information. aplay-l will list for us all the outputdevices hiding in our hardware and tell us their addresses. My C-Media card is card 0 and has a PCI DAC/ADC (DAC, digital to analog converter, ADC analog to digital converter) as device 0. It also has a 2nd DAC as device 1 and a IEC958 (digital) as device 2. My on-board sound chip is card 1 and has ALC883 Analog as device 0 and ALC883 Digital as device 1. My HDMI chip is card 2 and device 3 on the graphics card and the usb headphones are device 0.
Code:
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: CMI8768 [C-Media CMI8768], device 0: CMI8738-MC8 [C-Media PCI DAC/ADC]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: CMI8768 [C-Media CMI8768], device 1: CMI8738-MC8 [C-Media PCI 2nd DAC]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: CMI8768 [C-Media CMI8768], device 2: CMI8738-MC8 [C-Media PCI IEC958]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 0: ALC883 Analog [ALC883 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 1: ALC883 Digital [ALC883 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: HDMI [HDA ATI HDMI], device 3: ATI HDMI [ATI HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 4: default [C-Media USB Headphone Set ], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
This is critical information for configuring direct hardware addressing. The standard is hw(card),(device). Thus my C-Media primary output is hw0,0 and the digital is hw0,2. The HDMI output of my graphics card is hw2,3. The webcam, card 3, is not listed here as it has no output, no speaker, only a microphone for capture.
Now we will see what our hardware can give us for capture devices. arecord -l will list for us all available hardware that can capture sound for us to record with. As you can see, there are some changes from aplay -l. For one thing, there is no device 1 on the C-Media card. This is because device 1 is for rear speaker surround sound playback only. card 3 is now listed. That means the mic on the webcam is available, yay.
arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: CMI8768 [C-Media CMI8768], device 0: CMI8738-MC8 [C-Media PCI DAC/ADC]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: CMI8768 [C-Media CMI8768], device 2: CMI8738-MC8 [C-Media PCI IEC958]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 0: ALC883 Analog [ALC883 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 1: ALC883 Digital [ALC883 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 2: ALC883 Analog [ALC883 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 3: U0x46d0x8d7 [USB Device 0x46d:0x8d7], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 4: default [C-Media USB Headphone Set ], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
Now we have a ton of information about my hardware.
We know that my C-Media8768 card is actually a C-Media8738-MC8 (rev10) PCI card on irq 21. It has a primary DAC/ADC input and output at hw0,0 and a second DAC for output only at hw0,1 and digital input and output at hw0,2and it is using the cmipci alsa module. We also know that my SB x00 Azalia HDA Intel chip on the motherboard is a ALC883 with analog and digital input and output and is using the snd_hda_intel module and is hw1. We know the HDMI output on my gpu is hw2,3 and that both of my usb devices are detected at hw3,0 and hw4,0 and we have their IDs. All this without trying to find the owners manual or opening the case up or spending hours searching the forums and google.
If you are having trouble with sound starting and stopping and pulseaudio crashes you can run pulseaudio from a terminal in verbose mode and gather a lot of information.
In a terminal type
Code:
killall pulseaudio
pulseaudio -vvv
This can pinpoint problems with alsa drivers, pulseaudio and applications.
You should save this information somewhere that is easy to get to and cut and paste from. I use tomboy notes myself.
If you are posting for help in the forums it is very important that you can share this information or it can be very difficult to help you. It is also important to give information on the make and model of your machine especially as there are many solutions that are very specific for certain machines.
Now you can return to the 10,000 page guide fully armed and if that does not help you now have enough information to obtain help from others.
http://ubuntuforums.org/showthread.php?t=843012
Bookmarks