Wednesday, January 09, 2008

DMA and Ubuntu

One of my readers is having a bit of a hard time with DVD playback, after reading my article:
Playing Encrypted DVD's in Ubuntu 7.10, he has been unable to get dvd's to playback smoothly.

One really common solution to slow, jerky, and unreliable playback is turning on DMA.
DMA stands for: Direct Memory Access. DMA allows a piece of hardware to talk directly with the RAM, reading and/or writing independent of the CPU (Central Processing Unit). In other words the hardware can use the system memory, bypassing the CPU, allowing the device to read and write much faster.

By default Ubuntu has DMA turned off (set to 0), this can be changed in the /etc/hdparm.conf file, like so:

  1. First make a backup of your hdpram file:# sudo cp /etc/hdparm.conf /etc/hdparm.conf.bak
  2. Now edit the file using your favourite text editor, I'm using gedit, however you can use the editor of you choice just change the following command to suit your needs: # sudo gedit /etc/hdparm.conf
  3. Once the file is open you will need to add the following at the end of the file:/dev/cdrom {
    dma = on
    }
  4. Once you restart your computer you should have DMA turned on.

Troubleshooting
I have been reading about a number of problems with turning DMA on. Here are a couple of solutions if DMA still doesn't work after trying the instructions above:
First try re-editing the hdpram.conf file to read /dev/dvd instead of /dev/cdrom, then restart the computer.
If you are getting the error:
`HDIO set dma failed: operation not permitted'
You may need to edit your /etc/modules.conf file, for more information please see this forum thread: #post93238.
Personally none of my systems have these issues so I can't test this solution.

I hope this proves useful to someone, have fun.

No More Beeping

*NIX Quick Tip

Beep, beep, beep,
If your like me and don't like auditory reminders, you can turning off the beeping quickly and easily:

X Windows
If you want to disable beeps in X11 (X Windows), you can turn them off with the command:
# xset b off
*Note: you will need to login as root or use sudo.

csh and tcsh
You can disable csh and tcsh shell terminal beep if you put `set nobeep' (no quotes) in your ~/.cshrc file.

This options will work on most *nix systems (using csh/tcsh or X windows), including Ubuntu, FreeBSD, and OpenBSD, however I tested this solution using FreeBSD.

Welcome to 2008

Hello everyone, and welcome to the new year, gee last year seemed to fly by, it's 2008 already.
I really hope that you all have a wonderful year, and learn heaps, and achieve everything you set out too.

I want to go out and really make this year a good one. I want to put it all on the line and not be afraid to lose what I have to achieve my dreams. My fiancé and I, are going to be married this year, which is really exciting, I can't wait. I'm not going to sit around and let this year pass me by, I want to make this year a fun and amazing ride, and I hope it is for all of you as well.

Geekybits³ reached over 100 new readers yesterday, for the first ever time. It feels so wonderful! After all there wouldn't be any point to me writing if no one was reading, yet it still feels very unreal having people interested in what I say.

Thank you to you all, I hope you find my content informative, and useful. Welcome to Geekbits³, and I hope you enjoy the ride.
If anyone has a comment or an idea, or just wants to say G'day, send me and email or drop a comment in the space below.

Thank you all very much, and HAPPY NEW YEAR!!! From Geekybits³