DVD under Linux

By Phantasm66
Mar 21, 2002
Topic Status:
Not open for further replies.
  1. I wanted to pose this question, perhaps more for Mictlantecuhtli than anyone else....

    If you are playing DVDs in Linux, and its working well, could you guide the others here through the process.... from start to finish if possible..... what software, how to install, what problems encountered, etc.....

    I am using xine with limited success. The tragedy is a DID have it working perfectly but now there are problems....

    Anyone with valuable info would be welcomed.
  2. svtcobra

    svtcobra TechSpot Paladin Posts: 875

    Phantasm, here is the FAQ that I used to improve my dvd playback quality with Xine. I found that enabling DMA helped alot.

    5.1.1 I have a lot of dropped frames - what can I do?

    Your hardware is too slow for xine. Make sure you turn on all
    speed optimizing options. A few things you should check:

    - use a recent kernel optimized for your hardware

    - use the latest gas/gcc

    - close other applications (use a tool like "top" to find out
    what applications are using up CPU power)

    - if you are not using Xv, make sure your display is set up
    to 16bpp, not 24 or higher (reduces memory bandwith)

    - make sure the hard drive which supplies the video data
    is in DMA mode (if supported)

    Under linux, you can use hdparm to check this.
    Example:

    hdparm /dev/hda

    ...
    using_dma = 1 (on)
    ...

    You can enable DMA mode with the following command:

    hdparm -d1 device_of_your_drive_that_supplies_video_data

    More information about this may be found here:
    => http://oreilly.linux.com/pub/a/linux/2000/06/29/hdparm.html

    - xine needs high speed memory access which depends on your chip set.
    Make sure you enable all speed-improving options.

    Especially the via apollo pro chipset is known to be quite weird,
    (most of all on my gigabyte board). If you can't configure the ram
    access thoroughly using the bios you might want to try some really
    nasty tricks, as explained on (for example):

    => http://www.overclockers.com/tips105/index03.asp

    This website centers around a windows-tool to tweak the chipset, you
    can do the same on FreeBSD with pciconf. On some linux distributions
    there are similar tools.

    Please contact Heiko if you have any problems or tips about via apollo
    pro chipset tweaking.

    - a nice performance tuning tool can be found here:

    => http://powertweak.sourceforge.net

    - enable MTRR support in your kernel. If you are still using XFree 3.x,
    you'll have to tell the kernel yourself where the graphics memory is.
    You'll find details about that in the linux dvd howto.

    If you're using XFree 4.x, enabling MTRR support in your kernel should
    be enough.

    Try a cat /proc/mtrr - if the file exists and you find an entry
    corresponding to the amount of graphics memory you have, everything
    should be fine.

    - set up and use raw devices for dvd access

    Raw devices should be available in linux kernel 2.4.x and there are
    patches for older kernels available from:

    => ftp://ftp.kernel.org/pub/linux/kernel/people/sct/raw-io/

    To use raw devices, first connect a free raw device to your dvd
    device, use something like:

    raw /dev/raw1 /dev/hdc

    then create a link named "rdvd" pointing to that raw device:

    ln -s /dev/raw1 /dev/rdvd
  3. Phantasm66

    Phantasm66 Newcomer, in training Topic Starter Posts: 6,504

    thanks for the great help, however i have done a lot of that, if not all, already....

    methinks its css encryption problems.....
  4. Mictlantecuhtli

    Mictlantecuhtli TechSpot Evangelist Posts: 4,916   +9

    I'll see what I can do. It'll take some time to check everything, though.
    Svtcobra's post should help in most cases.
    I've set my DVD-drive to use UDMA/33 with hdparm -X66 -d1 command.
  5. Mictlantecuhtli

    Mictlantecuhtli TechSpot Evangelist Posts: 4,916   +9

    Well, it didn't take long ;)

    Ok, here's how I watch DVDs in Linux.


    Red Hat Linux 7.2
    -----------------


    hdc: TOSHIBA DVD-ROM SD-M1212 (/dev/scd0 aka /dev/cdrom aka /dev/dvd)
    hdd: RICOH CD-R/RW MP7060A (/dev/scd1 aka /dev/cdrom1)

    - I have SCSI emulation in kernel 2.4.9-13 because I want to burn CDR/RWs.

    Installed in kernel:
    ATA/IDE/MFM/RLL support
    IDE, ATA and ATAPI Block devices
    Include IDE/ATAPI CDROM support "Y"
    SCSI emulation support "Y"
    SCSI support
    SCSI CD-ROM support "Y"
    SCSI generic support "Y"

    - /boot/grub/grub.conf:

    kernel /boot/vmlinuz ro root=/dev/hda1 hdc=ide-scsi hdd=ide-scsi

    Similar options should be in /etc/lilo.conf when using LILO.

    - /etc/fstab:

    /dev/scd0 /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0
    /dev/scd1 /mnt/cdrom1 iso9660 noauto,owner,kudzu,ro 0 0

    - Write access to /dev/dvd (or whatever the DVD-drive is) is needed because of the css key negotiation process. It doesn't mean that DVDs would be burned, however.

    - DMA is enabled for DVD-drive. This drive supports UDMA/33 so it's enabled with hdparm -X66 -d1 /dev/hdc.

    - I haven't needed any raw devices but the command would be raw /dev/raw/raw1 /dev/hdc.


    GUI
    ---

    - XFree86 4.1.0

    - Gnome 1.4 & Enlightenment 0.16.4-11

    - NVIDIA_kernel & GLX 1.0-2802

    - Screen resolution 1600x1200, 24-bit colors


    Applications & libraries
    ------------------------

    - Ogle v0.8.2
    ogle-0.8.2-ogle1.i586
    ogle_gui-0.8.2-ogle1.i386
    requires libdvdcss >= 0.0.3, libdvdread >= 0.9.2, libxml2 >= 2.4.5

    - VideoLAN client
    vlc-0.2.92-1.i386
    vlc-gnome-0.2.92-1.i386
    requires libdvdcss, libSDL

    - Xine 0.98
    xine-lib-0.9.8
    xine-ui-0.9.8
    xine-dvdnav-0.9.8.beta2
    dvdnav-plugin requires libdvdread; for encrypted DVDs libdvdcss is also required

    - libdvdcss1-1.0.1-1

    - libdvdread-0.9.2


    libdvdcss
    ---------

    - Installed from rpm package

    - Installed in /usr/lib


    libdvdread
    ----------

    - Compiled & installed from tar.bz2 package:
    bzip2 -d libdvdread-0.9.2.tar.bz2
    tar xfv libdvdread-0.9.2.tar
    cd libdvdread-0.9.2
    ./configure
    make
    make install

    - Installed in /usr/local/lib


    Ogle
    ----

    - Installed from rpm packages, installation nags that libdvdread is required. Libdvdread is already installed from source code, so dependency check is skipped with --nodeps rpm option.

    - /usr/bin/ogle starts the program; a shortcut is also created in Programs/Multimedia menu.

    - STOP button doesn't work!!!
    Debug[ogle_nav]: unknown (not handled) DVDCtrlEvent 16

    - Random freezing:
    Note[ogle_a52]: resetting offset

    - Problems with movies:

    Tenebrae
    -only "Dolby Digital"-intro works, crash:
    A lot of DVD read cache misses, then
    play_PGC_post:
    ** Fell of the end of the pgc, continuing in NextPGC
    ogle_nav: vm.c:816: play_PGC_post: Assertion `state.pgc->next_pgc_nr != 0' failed.


    VideoLAN client
    ---------------

    - Installed from rpm packages, installation nags that libSDL is required. A newer libSDL is already installed, so dependency check is skipped with --nodeps rpm option.

    - /usr/bin/vlc starts the program.

    - Subtitles don't work:
    input error: no suitable decoder module for type 0x82

    - Sometimes vlc remains in memory after exiting, using 100% CPU. killall -9 vlc helps.


    Xine
    ----

    - Compiled & installed xine-lib, xine-ui & xine-dvdnav 0.98
    Installation procedure for xine-lib & xine-ui can be found here. It's the same for xine-dvdnav.

    - /usr/local/bin/xine starts the program; a shortcut is also created in Programs/Multimedia menu.

    - Xine nags:
    libdvdread: Can't open libdvdcss: libdvdcss.so.0: cannot open shared object file: No such file or directory.
    libdvdread: Encrypted DVD support unavailable.


    FIX: ln -s /usr/lib/libdvdcss.so.1 /usr/lib/libdvdcss.so.0

    - DVDs are played by clicking NAV-button (DVD Navigator plugin), then PLAY.

    - Using the location slider is s_l_o_w. I'm not sure if it works at all.

    - Chapter selection works with numpad keys 3/9 (NumLock on!)

    - Time seems to be 00:56:50 all the time.

    - Subtitles don't work at all (I've read KNOWN-BUGS no.3!)

    - Problems with movies:

    Final Fantasy: The Spirits Within
    -video_out seems to think that there are still images inside the movie, causing it to freeze for 1-20 seconds every now and then.
    -After one "still image" video_out gets stuck in an infinite loop, playing the same second over and over again.

    Full Metal Jacket
    -Very slow menu, leaves the selection rectangle on screen (xine-dvdnav KNOWN-BUGS no. 2)
    -Same still image problem as with FF:TSW but doesn't loop (though I didn't watch the whole movie)

    The Mummy
    -Crash:
    dvdnav_plugin_read_block: FIXME: Cell change
    Segmentation fault

    Tenebrae
    -Only "Dolby Digital"-intro works, crash:
    A lot of DVD read cache misses, then
    play_PGC_post:
    ** Fell of the end of the pgc, continuing in NextPGC
    xine: vm.c:921: play_PGC_post: Assertion `(self->state).pgc->next_pgc_nr != 0' failed.


    DVDs used for testing
    ---------------------

    - The Evil Dead
    R1 NTSC
    encrypted

    - Final Fantasy: The Spirits Within
    R1 NTSC
    encrypted

    - Full Metal Jacket
    R2 PAL
    encrypted

    - The Heroic Trio
    region-free NTSC
    not encrypted

    - The Mummy
    R2 PAL
    encrypted

    - Suspiria
    R2 PAL
    not encrypted

    - Tenebrae
    R1 NTSC
    encrypted


    P.S. This would be a bit easier to read if vB could leave the spaces there..
  6. Phantasm66

    Phantasm66 Newcomer, in training Topic Starter Posts: 6,504

    thankyou ALL. I will read through what you have all said.
  7. Mictlantecuhtli

    Mictlantecuhtli TechSpot Evangelist Posts: 4,916   +9

    Maybe it's needless to say but you don't need to mount DVDs if you're going to watch them.
    Should I write a story on how to make DivX backups of own DVDs as well?
  8. Phantasm66

    Phantasm66 Newcomer, in training Topic Starter Posts: 6,504

    go on... I love a story as do we all... :)
  9. TS | Thomas

    TS | Thomas Newcomer, in training Posts: 1,327

    & this, is why I don't use Linux :)
  10. Mictlantecuhtli

    Mictlantecuhtli TechSpot Evangelist Posts: 4,916   +9

    Hmm, should I write a simple version or just something like

    tccat -t dvd -T 6,-1,1 -i /dev/dvd |splitpipe -f /usr/dvd/vobs/rip.log 1024 /usr/dvd/vobs/vob vob |tcextract -a 0 -x ac3 -t vob|tcdecode -x ac3 |tcscan -x pcm
    transcode -i /usr/dvd/vobs/vob-001.vob -a 0 -w 1000,250,100 -b 128 -s 1.4 -V -f 23.976 -g 720x480 -M 2 -x vob -o MiBtrailer.avi -y divx4

    :giddy:
    Those commands rip "Men in Black"-trailer from FF:TSW DVD and convert it to DivX.
Topic Status:
Not open for further replies.


Add New Comment

TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...


Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.