Download your favorite Linux distribution at LQ ISO.
Go Back > Linux Answers > Hardware
User Name


By mimithebrain at 2005-12-16 10:59
This article is meant to explain how to troubleshoot hardware in linux, more or less based on how to troubleshoot a soundcard.
The person should know how to open a console, and how to run commands as root, and not be afraid to compile the kernel. Compilling the kernel is outside the scope of this document.

1. What is the hardware?
You must know, before attempting to troubleshoot your hardware, the name of you hardware. Is it a USB? PCI? These are very important to know!
A lot of information can be gained by typing /sbin/lspci and /sbin/lsusb . Make sure your hardware is well pluged in and installed.

2. Is it working out of the box?
Does the hardware work out of the box? Have you tried rebooting? Some distro autoconfigure themselves to work with the devices they detect at bootup time. Plugging in a device doesn't automatically mean it'll work immediately, but sometimes it does.

3. Still doesn't work? Lets troubleshoot.
Assuming you have rebooted, the card is well installed, lets go on troubleshooting.

First step: syslog!
A lot of errors are caught and reported to syslog. Depending on your distribution, your log may (or may not) be located at /var/log/messages, /var/log/dmesg, /var/log/syslog... etc etc... please consult whatever reference manual is available with your distribution.

The command you should run as root will be cat /var/log/messages | less or perhaps cat /var/log/messages | tail.
Less will show you the date in a scrollable way and tail will post the last messages of dmesg.

These error messages are important to you, and to us. We need to know what the error messages are and the specs of your hardware at LQ if you want us to help you optimally, if this article is not sufficient, or you can't find the solution by yourself.

If you see there is an IRQ error, you will need to play with the IRQ settings in your BIOS. To enter the BIOS, you will need to press F1, F2, ESC, or similar keys at the first splash screen of your system to get into the BIOS. This, however, is tricky for inexperienced users. For the other users, you may go right ahead and modify it. How to fix IRQ problems is outside the scope of this document.

If there isn't anything that's obvious that pops out at you while reading the syslog or dmesg messages. Lets go on to the next steps.

4. Is it a classic error? Permission, module loaded, card in use, muted, external amplifier?
The most classic error is the permission denied error, IMHO.
To quickly test out whether root can access the sound card or not, test the card (To test a card, type cat /dev/urandom > /dev/dsp, type CTRL+C to stop the action.
) as root. If it works, congratulations! You are closer to making your soundcard work. If you can also test it as a normal user, you should have no problem making the sound card work.

type these commands:

ls -l /dev/dsp
ls -l /dev/audio
ls -l /dev/mixer

The owners, user would naturally be root, and the group (on some distros) "audio".
In that case, using any available GUI tool, add your user to the audio group. or using the console, type gpasswd -a user audio . You will need to relogin for the group change to make effect.

If the permissions read this : rwx------, or didn't permit "group" or "users" to read and write. Then we have a permission issue.
As root, type chmod 660 /dev/dsp or chmod 666 /dev/dsp . do that for /dev/audio and /dev/mixer too.
You can change the user and group by typing chown root:audio /dev/dsp . Change /dev/dsp for the name of the device.

If /dev/dsp doesn't exist, it's probably because your modules aren't loaded properly. Assuming the drivers are modules, and not built in the kernel, you can know whether they are loaded by typing /sbin/lsmod . If you aren't sure what modules are needed for your soundcard.... google it...

If they aren't loaded, load them using modprobe or insmod... like this, as root :
modprobe atiixp

The module name will vary.

If it is loaded... we move on to the other classical error.

If the card is in use... it's in use! You can know who uses it by typing /sbin/fuser /dev/dsp.
You can also restart the alsa service using the commands provided to you by your distro.
(gentoo: /etc/init.d/alsasound restart)
(Mandrake: service alsa restart)

You may type alsamixer, to look and modify the mixer's settings. Make sure the master's volume is high enough to hear, and not muted (having "MM" below it's bar). Use the arrow keys to raise and lower the volume. Use M to unmute and mute. Use left and right to move from one bar to the other. Make sure that PCM is high enough and not muted. If you have something called external amplifier, unmuted it.

5. Testing
To test a card, type cat /dev/urandom > /dev/dsp, type CTRL+C to stop the action.

by halvy on Wed, 2006-01-11 23:24
buying hardware that you know in advance will work in linux helps


All times are GMT -5. The time now is 05:49 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration