There are many, many different types of hardware available for computers, including Webcams, network cards, hard disks, video cards, sound cards, and more. For each of these devices to work, a driver needs to be loaded by the Linux kernel. Unlike systems such as Windows, you don’t need to install a special driver included with the device. Instead, the driver should already be included in Ubuntu and ready to work out of the box.
Of course, this is not always the case, and sometimes hardware can be something of a beast to get working. In this section, we tear apart some of the hardware-related problems and attempt to resolve them.
Ubuntu Has Not Detected My Old Sound Card
Many older devices are not automatically detected by the current 2.6 kernel series. This is done to avoid hardware issues such as crashes. Unfortunately, if you have an older sound card, it means you need to roll up your sleeves and poke around to get it running. To do this, you need to know which kernel module your card needs and then load the module yourself. Loading the correct module for your device will not cause your system to crash, but loading the wrong one may well do so. You may need to experiment with different modules.
Look for the model of sound card you have by referring to your computer’s specifications, by checking the name of the device in Windows (if applicable), or by opening the computer case and looking at the sound chip. You can use Google to match a chip’s serial number with the chipset type. Here is a list of devices and their relevant kernel modules (taken from www.icewalkers.com/Linux/Howto/BootPrompt-HOWTO-8.html):
- snd-dummy = Dummy sound card
- snd-mpu401 = mpu401 UART
- snd-mtpav = MOTU Midi Timepiece
- snd-serial = Serial UART 16450/16550 MIDI
- snd-virmidi = Dummy sound card for virtual rawmidi devices
- snd-ad1816a = ADI SoundPort AD1816A
- snd-ad1848 = Generic driver for AD1848/AD1847/CS4248
- snd-als100 = Avance Logic ALS100
- snd-azt2320 = Aztech Systems AZT2320 (and 2316)
- snd-cmi8330 = C-Media’s CMI8330
- snd-cs4231 = Generic driver for CS4231 chips
- snd-cs4232 = Generic driver for CS4232 chips
- snd-cs4236 = Generic driver for CS4235/6/7/8/9 chips
- snd-dt019x = Diamond Technologies DT-019x
- snd-es168 = Generic ESS AudioDrive ESx688
- snd-es18xx = Generic ESS AudioDrive ES18xx
- snd-gusclassic = Gus Classic
- snd-gusextreme = Gus Extreme
- snd-gusmax = Gus Max
- snd-interwave = Interwave
- snd-interwave-stb = Interwave
- snd-opl3sa2 = Yamaha OPL3SA2
- snd-opti93x = OPTi 82c93x–based cards
- snd-opti92x-cs4231 = OPTi 82c92x/CS4231
- snd-opti92x-ad1848 = OPTi 82c92x/AD1848
- snd-es968 = ESS AudioDrive ES968
- snd-sb16 = SoundBlaster 16
- snd-sbawe = SoundBlaster 16 AWE
- snd-sb8 = Old 8 bit SoundBlaster (1.0, 2.0, Pro)
- snd-sgalaxy = Sound Galaxy
- snd-wavefront = Wavefront
- ad1848 = AD1848
- adlib = Adlib
- mad16 = MAD16
- pas2 = ProAudioSpectrum PAS16
- sb = SoundBlaster
- uart401 = UART 401 (on card chip)
- uart6850 = UART 6850 (on card chip)
- opl3 = Yamaha OPL2/OPL3/OPL4 FM Synthesizer (on card chip)
- opl3sa = Yamaha OPL3-SA FM Synthesizer (on card chip)
- opl3sa2 = Yamaha OPL3-SA2/SA3 FM Synthesizer (on card chip)
When you have found the name of the module required, try loading it into the kernel:
foo@bar:~$ sudo modprobe themodule
If there is no error message, the module may just be the right one! Run alsamixer to see if there is a sound device for it to configure:
If the module is the wrong one, alsamixer will not allow you to set the sound parameters. If you can, add the module name to the /etc/modules file so that it gets loaded every time you boot:
foo@bar:~$ sudo gedit /etc/modules
My Cardbus Adapter Is Not Being Recognized
If you have a cardbus adapter and are having difficulty getting it to work, open a terminal and run this command:
foo@bar:~$ sudo gedit /boot/grub/menu.lst
Find the line ## ## End Default Options ##, below which you can see your kernel. Here’s an example:
title Ubuntu, kernel 2.6.12-10-686-smp root (hd0,0) kernel /boot/vmlinuz-2.6.12-10-686-smp @C:root=/dev/sda1 ro quiet splash initrd /boot/initrd.img-2.6.12-10-686-smp
Add this to the end of the kernel line, one space after splash:
It should now look like this:
title Ubuntu, kernel 2.6.12-10-686-smp root (hd0,0) kernel /boot/vmlinuz-2.6.12-10-686-smp @C:root=/dev/sda1 ro quiet splash pci=assign-busses initrd /boot/initrd.img-2.6.12-10-686-smp
Restart your computer, and your cardbus device should work.
I Plug In My USB Stick and Nothing Happens
When a USB stick is plugged in, it must be mounted before you can access it. This normally happens automatically, and you should see an icon on your desktop similar to that displayed in Figure 6-7.
Unfortunately, in some rare cases it doesn’t work. To fix this problem, first check that your system is set to automatically mount USB sticks. Click System > Preferences > Removable Drives and Media and look in the Storage tab. The following checkboxes should be selected:
- Mount removable drives when hot-plugged
- Mount removable media when inserted
- Browse removable media when inserted
When you have selected the boxes, click Close, and try plugging in your USB stick again.
If you still have no luck, plug in the USB stick and then click Places > Computer. If there is an additional drive in the Computer window, right-click it, and select Mount Volume.
If you still have no luck, you need to manually mount the disk. First, click Applications > Accessories > Terminal, and then plug in your USB stick. Now run the following command:
foo@bar:~$ sudo mount -t vfat /dev/sda1 /mnt
To view your files, use the file manager to access the /mnt directory. Before you finish with the disk, unmount it with this command:
foo@bar:~$ umount /dev/sda1
I Copied Some Files to/from My USB Stick, but When I Access It Later, the Files Are Not There
When you plug in your USB stick, Ubuntu automatically mounts it. When you copy files to or from the stick, the files are copied over in bursts. Due to the way the kernel in Ubuntu works, sometimes there can be a slight delay before your files copy. If you remove the USB stick before copying has finished, some or all of the files may not have copied over successfully.
To ensure that everything you do with the USB stick is complete before you remove it, you should unmount it. To do this, right-click the drive icon on your desktop or in Places > Computer, and select Unmount. Give it a few seconds, and when the light on the drive has stopped flashing, you can safely remove the USB stick from your computer.
My CD-ROM/DVD Drive Is Not Working
If you are having problems accessing your CD-ROM/DVD drive, it is most likely because it is not mounted. Click Places > Computer, and look at the CD-ROM/DVD drive icon in the window. If the CD drive is not mounted, the icon looks like a drive; otherwise, it looks like a disc. If the drive isn’t mounted, right-click it, and click Mount Volume.
My CD-ROM/DVD Drive Won’t Eject
If you press the eject button on your CD-ROM drive and it won’t eject a disc, click Places > Computer, right-click the CD-ROM/DVD drive, and select Eject. If this doesn’t work, load up a terminal by clicking Applications > Accessories > Terminal, and type:
I Bought a Device, but It Doesn’t Work in Ubuntu
When you buy a hardware device such as a graphics card, sound card, DVD drive, or Webcam, the device needs to have a driver installed for it to work.
Sometimes you need to go looking for a driver, or even find out whether Ubuntu supports it at all. To do this, search the Ubuntu forums or help wiki, or you can do a general search on the Internet for your device and the keyword Linux. After a bit of hunting around, you will probably find a driver that is available but obviously was not included with Ubuntu. Your first job should be to submit a bug report to say that the driver is not included in Ubuntu (see the subsection It Was Suggested I File a Bug Report, but I Don’t Know How, later in this chapter). Include in your bug report the location of where you found the driver.
My Computer Says It Is Out of Memory
If you get memory errors and have a reasonable amount of memory (256MB or more) and a swap partition, your memory may be faulty. To check whether your memory is working, restart your computer, and when you see GRUB loading, press Escape to display the boot menu. Select the memtest option, and a small tool will check your memory for errors.
The memtest utility tries its best to find problems with your memory, but there may be cases where memtest passes but the memory still has problems. To test this, try swapping the memory with some that is known to work and see if the problems go away. If they do, the memory is certainly faulty.
How Can I Copy Photos from My Mobile Phone to My Ubuntu Computer with Bluetooth?
Ubuntu has built-in Bluetooth support, but you need to install the gnome-bluetooth package. Inside this package is a small tool called gnome-obex-server. This application allows you to transfer files from your mobile phone to your computer.
When you have installed the package, hit Alt-F2, and enter gnome-obex-server. A small blue icon appears in the notification area, and you can now send a file from your phone via Bluetooth.
I Can Read My USB Storage Device, but I Can’t Write to It
If you are having trouble writing to a USB key or external USB hard drive, there are a number of possible causes of the problem.
The first and most simple to diagnose is that you may not have permission to write to the device. When you plug in the drive, right-click the icon that appears on your desktop, and select Properties. In the window that appears, click the Permissions tab and ensure that the Others line has the Write checkbox selected. If it is not selected, you don’t have permission to access the drive.
To change these permissions, fire up a terminal, and move to the /media folder:
foo@bar:~$ cd /media
Now take a look at which drives are in there:
foo@bar:~$ ls -al
In the output that appears, you should see usbdisk as one of the entries. Now change the permissions so everyone can access it:
foo@bar:~$ sudo chmod a+w usbdisk
You should now be able to access the disk.
I Still Can’t Write to My Drive!
If you have permissions to access the drive but still can’t write to it, the problem is likely to be a filesystem issue. On a storage device such as a floppy disk, USB key, or hard drive, a specific type of filesystem is used to manage how the files are written to the physical disk. Ordinarily, you don’t need to worry about this. But when things go wrong, it’s time to figure out the details.
There are a number of different filesystems. The default Linux filesystem is ext3. In the Windows world, a few other filesystems are available, such as FAT16, FAT32, and the NTFS system used by Windows NT.
Although FAT16 and FAT32 are fully supported in Ubuntu, an NTFS filesystem cannot yet be written to on a Linux computer. However, recent new code has gone into the Linux kernel to write to NTFS with FUSE or a kernel module. This code is still rather experimental and not included in a stock Ubuntu system, so be careful when playing with it.
To find out which filesystem the device uses, run the following command:
foo@bar:~$ sudo mount
In the output, look for the /dev/sda1 or /dev/sdb1 line. USB devices are usually located at either of these locations. You can see the filesystem next to where it says type, as in this example:
/dev/sda1 on /media/usbdisk type ext3 (rw,noexec,nosuid,nodev)
In this example, the filesystem is ext3. You can also add the umask=0000 option if you want to allow any user to read the disk.
If the filesystem is supported (ext3, VFAT, FAT16, FAT32) but you still can’t access the disk, the filesystem may be corrupted. In cases such as this, it makes sense to format the disk with a new filesystem.
Before you format your disk, make absolutely sure that you are happy to remove the entire contents of the disk. If you need the files on the disk, have a look around the Internet and post to the Ubuntu forums to see if anyone else can help you before you format the disk. Formatting really is the last option you have available!
How Do I Format a Disk?
When most people think of formatting a disk, they think it is the process of deleting everything on the disk. Formatting a disk actually involves a little bit more, and it completely replaces the filesystem on the disk.
A side benefit to formatting a disk is making the disk work on different computers. Only certain types of filesystems are supported by each OS, and formatting a disk with a common filesystem can ensure that it works with these different operating systems. As an example, if you format a USB key with the ext3 filesystem, it won’t work in Windows. If you use the VFAT filesystem, it will work in both Windows and Linux.
Formatting is fairly simple, and you just need to know the location of the device. USB storage devices (such as USB keyring drives and key fobs) tend to be located at /dev/sda1 or /dev/sdb1. Make sure that you have the right device, and then use one of the many mkfs commands to create the relevant filesystem. As an example, to create an ext3 filesystem, use the following command:
foo@bar:~$ sudo mkfs.ext3 /dev/sda1
A range of other mkfs commands can be used to create other filesystems:
Each of these commands is used in the same way.
The Keys on My Keyboard Spit Out the Wrong Letters/Symbols
Every keyboard on a computer has a particular keyboard layout and locale attached to it. The keyboard layout specifies how many keyboard keys you have, in what order, and the locale specifies what each key does.
The locale is particularly important as letters and symbols vary dramatically in different locales. Aside from different types of letters, common symbols are often placed in different areas. As an example, on some keyboards the double quote (″) is on the key above the right Shift key. On some keyboards, it is Shift-2. Having the wrong keyboard settings can be incredibly frustrating, and if the symbols printed on your keys don’t match up to the symbols spat out when you press the keys, your keyboard settings are incorrect.
To fix this, click System > Preferences > Keyboard. Click the Layouts tab, and next to the Keyboard model box click the Choose button to select your keyboard model if you know it. If you don’t know it, use the default setting. Now click the Add button, and resize the window so you can see the keyboard layout diagram more easily. Choose a different locale that matches your keyboard, and then click OK.
Now click on the Keyboard tab, and use the Type to Test Settings box to test whether your keyboard settings are correct.
My Serial Mouse Is Not Working
To get a non-USB serial mouse working, first run this command:
foo@bar:~$ sudo dpkg-reconfigure xserver-xorg
When asked for the mouse device, select /dev/ttys0 for COM1 or /dev/ttys1 for COM2.
My Mouse Scroll Wheel Does Not Work
To enable your scroll wheel, you need to run the X configuration program:
foo@bar:~$ sudo dpkg-reconfigure xserver-xorg
One of the questions asks if you would like to enable the scroll wheel. Enable this, and then restart your desktop. Your lovely little scroll wheel should work now.
My Remote Control Doesn’t Work
If you want to use a remote control with your Ubuntu computer, you need to install the Linux Infrared Control (LIRC) package in Synaptic. LIRC is the library, and it supports a wide range of remote control units.
The first step is to determine which LIRC driver is required for your particular remote control. Take a look at the list of remotes on the LIRC site at www.lirc.org, or use your favorite search engine if your remote is not listed on the site.
LIRC includes a number of built-in drivers. You can see which ones are included by running the following command:
foo@bar:~$ lircd -driver=help
When you know which driver is required and you know your installed LIRC supports your hardware, you can edit the hardware.conf file in the /etc/lirc file to configure which one is used. Simply set the DRIVER line to the driver you selected. With this complete, restart LIRC:
foo@bar:~$ /etc/init.d/lirc restart
With LIRC ready and running, you can test it by running the following command:
foo@bar:~$ /etc/init.d/lirc restart
When you press the buttons on your remote control, a code should appear. This code can be mapped to a button on your remote by editing the lircd.conf file in /etc/lirc. For more information, see http://help.ubuntu.com/community/InstallLirc.
How Do I Find Out Which Hardware Works in Ubuntu Before I Purchase It?
Currently, there is no centralized device database to search for hardware that works with Ubuntu.
A good place to start is to look at https://wiki.ubuntu.com/HardwareSupport. You should then search the discussion forums and use Google to find out whether anyone else has used the hardware you’re considering. Although not ideal ways to dig out your answer, the forums and Google are likely to give you the information you need until the full device database is complete.