GNU/Linux Desktop Survival Guide
by Graham Williams |
|||||
CD/DVD Drives |
Note: With today's polished distributions of GNU/Linux, including Debian and Ubuntu, (as of 2008) the description here may be dated, but we retain this information for reference.
If watching a DVD seems a bit choppy (stops and starts) then perhaps the CD/DVD IDE device needs some tuning. First check to see what the current settings are (e.g., on Belinos (36.24) where the DVD driver is /dev/hda):
$ hdparm /dev/hda /dev/hda: IO_support = 0 (default 16-bit) unmaskirq = 0 (off) using_dma = 0 (off) keepsettings = 0 (off) readonly = 0 (off) readahead = 256 (on) HDIO_GETGEO failed: Invalid argument |
For a DVD, setting the readahead to 8 (-a8
) seems to fix
it. Turning unmask on (-u1
) also might help:
$ sudo hdparm -d1 -a8 -u1 /dev/hda /dev/hda: setting fs readahead to 8 setting unmaskirq to 1 (on) setting using_dma to 1 (on) HDIO_SET_DMA failed: Operation not permitted unmaskirq = 1 (on) using_dma = 0 (off) readahead = 8 (on) |
To have this tuning survive a reboot add something like the following into /etc/hdparm.conf:
/dev/hda { read_ahead_sect = 8 interrupt_unmask = on } |
$ wajig readme hdparm | most $ sudo editor /etc/hdparm.conf ROOTFS=/dev/sda $ sudo ln -s /etc/init.d/hdparm /etc/rcS.d/S39hdparm.second |
If you have any problem rebooting after making these changes, use the nohdparm boot parameter and this will inhibit hdparm from doing anything and allow you to boot and fix the problem.
Visit http://www.mplayerhq.hu/DOCS/HTML/en/drives.html for a collection of tuning suggestions.
Turning DMA on (-d1
) fails on many DVDs. According to the
Red Hat Linux Release Notes
(http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/release-notes/x86/)
DMA is often disabled on CD-ROM drives because they are often not
capable of IDE DMA. If you are sure that your CD-ROM drive is capable
of IDE DMA you can do the following:
# rmmod ide_cd # modprobe ide-cd dma=1 |