Go to TogaWare.com Home Page. GNU/Linux Desktop Survival Guide
by Graham Williams
Duck Duck Go



CLICK HERE TO VISIT THE UPDATED SURVIVAL GUIDE

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
}
This needs to be run on boot after the appropraite modules for the CD/DVD have been loaded, so following the instructions in the README file:
  $ wajig readme hdparm | most
  $ sudo editor /etc/hdparm.conf
    ROOTFS=/dev/sda
  $ sudo ln -s /etc/init.d/hdparm /etc/rcS.d/S39hdparm.second
The instructions suggest S29 but that did not work for me.

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


Support further development by purchasing the PDF version of the book.
Other online resources include the Data Science Desktop Survival Guide.
Books available on Amazon include Data Mining with Rattle and Essentials of Data Science.
Popular open source software includes rattle and wajig.
Hosted by Togaware, a pioneer of free and open source software since 1984.
Copyright © 1995-2020 Togaware Pty Ltd. Creative Commons ShareAlike V4.