DVD Players

We compare features, convenience and performance of the leading DVD-playing software for Linux and cover some important tweaks for smooth playback.
Kernel Options

Some kernel options should be activated for optimizing DVD playback. I strongly urge the application of Andrew Morton's low-latency patches, and it also may be advisable to apply Robert Love's preemptive kernel patch. The combination of these patches provides very low latency (below 3msecs) over sustained periods of time. My kernel of choice is currently 2.4.18, but Andrew's and Robert's patches are available for a variety of kernel releases (see Resources for more information).

You also should make sure your kernel has enabled support for the RTC and MTRR options (found under the Character devices and Processor type and features kernel configuration sections, respectively). RTC provides access to the real-time hardware clock of your PC. According to the kernel configuration help file, all PCs have such a clock but it is not enabled by the default kernel configuration. Although it is not absolutely required, many Linux audio and video applications can utilize this clock for a finer timing response (MPlayer likes it), so I suggest building it directly into your kernel or as a dynamically loadable module.

According to the kernel configuration help, enabling the MTRR (memory type range registers) provides a mechanism that is used:

...to control processor access to memory ranges. This is most useful if you have a video (VGA) card on a PCI or AGP bus. Enabling write-combining allows bus write transfers to be combined into a larger transfer before bursting over the PCI/AGP bus. This can increase performance of image write operations 2.5 times or more.

So, if you have a PCI or AGP video card you will want to enable this option.

Under the ATA/IDE/MFM/RLL Support section, I advise enabling the options for generic PCI bus-master DMA support and the use of PCI DMA by default.

The last step is to configure sound support for your hardware. I use the ALSA sound system, so all I do is enable sound card support in the kernel options. The ALSA drivers are built in normal user space and installed as root as loadable kernel modules. You safely can use the available kernel modules instead of ALSA, but in my opinion the ALSA drivers are superior. In fact, ALSA will become the de facto kernel sound system for Linux kernels beyond the 2.5.x series.

The X Factor

I began my tests with XFree86 4.1.0. Everything seemed to work fine except for an annoying problem with xine: after closing that player my X server would unceremoniously crash, dumping me back at the console prompt. When I upgraded to XFree86 4.3.0 and the latest driver for my GeForce2 from NVIDIA (1.0-4363), all problems were resolved. Because XFree86 4.3.0 fixes a number of problems and bugs found in the earlier versions, I suggest the upgrade to anyone using any of these players, not only xine. And, if you're using an NVIDIA card you always should use their latest drivers.

As mentioned earlier, XFree86 provides a video output driver called Xv, but other drivers are available for the frame-buffer device, SDL (Simple DirectMedia Layer) video output and X11/Xshm. The driver you select affects playback performance. Xv normally is preferred, but you can experiment with whatever drivers are supported by your player of choice for the best output.

My X environment also includes the Blackbox window manager. I prefer simple and fast, and Blackbox fits the bill for me. Be advised that your DVD-viewing mileage may vary in part due to your window manager or desktop environment of choice, and you may need to adjust your available video resources accordingly.

Tuning the Drive

It may come as a surprise to learn that you can tune your DVD and CD-ROM drives as easily as you can tune your hard disks. The hdparm utility can optimize drive performance to peak efficiency, run it (as root) with at least the following parameter options:

hdparm -c1 -d1 -a8 -u1 /dev/hdd

where -c1 enables 32-bit I/O, -d1 enables DMA access, -a8 sets the filesystem read-ahead value and -u1 sets the drive's interrupt-unmask flag. /dev/hdd should specify your particular DVD drive device location.

The parameters shown above work well with my DVD drive, but I urge you to read the hdparm manual page (man hdparm) before running the utility. Your DVD drive is a read-only device, so filesystem corruption is not an issue here. You might, however, inadvertently lower your drive's efficiency with non-optimal settings.

It has been brought to my attention that Red Hat 8.0 users have reported difficulties enabling DMA on their DVD drives. If you're running that distribution, add the following line to your /etc/modules.conf to fix the problem:

options ide-cd dma=1

______________________

Similis sum folio de quo ludunt venti.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Things have changed

Jason's picture

While this was a great article back when it was written, things have changed very much sense then. Installing DVD playback software is now much easier, and with a growing number of Distributions (Ubuntu for example) everything is pre-optimized for video and DVD playback. All the user needs to do is launch into the terminal and type the following (for Ubuntu)

$ sudo su
[password]
$ apt-get install libdvdread4 (this command is not required for 10.04 as 10 comes pre-loaded with libdvdread4. With mine it did anyways, not sure if thats the norm though.)
$ /usr/share/doc/libdvdread4/install-css.sh (Installs libdvdcss2)
$ apt-get install vlc (Because the default video player in Ubuntu is a b**ch to get working with libdvdcss2... says you don't have it when you do).

And done. Watch DVDs to your hearts content.

Right you are. Infinitely

Dave Phillips's picture

Right you are. Infinitely easier than "back in the day". Oh well, at least there's some historical curiosity to the article. Thanks for the comment, Jason, I appreciate the read.

Best,

dp

Similis sum folio de quo ludunt venti.

i m a new user of fedora 8

bhupendra yadav's picture

i dont know that how softwares are instlled in linux and how we can use software that are inbuild . and how java,sql,c,c++ programs run in linux. plz give me any solvable solution

NEWBIE step-by-step compile tutorial.

Harding Leite's picture

Howdy...I'm trying to spend more and more time on the Linux "side" of my dual-boot PC but don't have enough mileage yet using the Terminal and the command-line to perform functions such as the ones demanded to get a DVD player up and running (i.e., Xine, Mplayer, etc).

Can anyone point me at a newbie-geared tutorial on how to compile sources? Can it be done from within KDE or must be using comands from the console?

I'm using OpenSuse 10.1.

Thanks!
Harding Leite
Rio de Janeiro, Brazil

It works!

Anonymous's picture

Re: DVD Players

Anonymous's picture

I just can't understand the hardware requirements for DVD playback. What is the claims about >1GHz processor etc?

I had RedHat9 with vanilla 2.4.20-8 kernel, 450MHz Celeron, 320MB of RAM, Matrox Millennium G550 videocard, TerraTec DMX XFire 1024(Only stereo playback), Eizo 17" TFT and Plextor PX-116A DVD-drive.
First I didn't do any "optimization" for DVD playback, just hit xine and movies are running very smoothly at full-screen (1280x1024x32bit). DVD-drive was also working with 16bit I/O and DMA disabled. CPU load is approx. 60%.

I didn't notice much difference w/ 32bit I/O and DMA enabled.

-rushi, Finland

My wife would love this,

Scott1202's picture

My wife would love this, right now she’s going to have twins in July and she is pretty big, it would be nice if she could lay on the bed and watch some dvd’s in our bedroom, great. thank you!

Re: DVD Players

Anonymous's picture

Being new to Linux, I have been searching for a printed source of info on many things that have been vexing me. I found a source in your magazine ( the first one I have seen) which is the article on DVD players. I downloaded and compiled XINE, and after many tries I have finally got it to work. Somewhat. I still cannot get it to play many of my DVDs. I either get an error message, it locks up, or crashes. I have found that documentation for XINE, as well as many Linux programs, assumes that the user is a programmer. I would appreciate any help I could get on setting up XINE properly! I must say, I do not plan on ever going back to Windows and the daily, or more often, crashes that I suffered. Thank You for the article.
Michae Driver
daddy-d_rn@comcast.net

Re: DVD Players

Anonymous's picture

Hi Michael: You should write directly to the people at xine and describe your troubles to them. Perhaps you should join the mail-list or search its archive, you might find some users have had the same particular problems. When sending a report be sure to detail whatever error messages or reports occur after xine crashes, the developers will need that info. To make a good report you should indicate the version you have; be aware that xine comes in two pieces, the UI (user interface) and the player engine, so hopefully you can let the developers know what versions of the pieces you have. Btw, I use xine daily, I've had no problems with any discs or files except for some recent WMV files. I'm even able to play DVDs with regional codes from other countries, something our standalone player won't do. I truly hope you're able to get it working better, it's a wonderful program.

Dave Phillips

Re: DVD Players

Anonymous's picture

Great article! I was able to get the packages for xine, install them, and start watching my DVD's in under 30 minutes. I'm using SuSE 9.0 on an P-III/933Mhz, and it works flawlessly.
THANKS!

Re: DVD Players

Anonymous's picture

can't seem to find the resources for this article

Re: DVD Players

Anonymous's picture

Doncha love a new article with fresh borken links? Try this:
http://www.linuxjournal.com/article.php?sid=7174

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix