Setting up Margi DVD-to-Go on Linux

Preliminay: the Margi DVD-to-Go card works the best using the Zoomed Video on the PCMCIA port. Not all laptops have the ZV port (any more) and not all PCMCIA slots are ZV enabled. Check the documentation of the laptop.


In it's current implementation it will work on the Libretto 100/110CT which has ZV enabled PCMCIA slots.

I'm using Gentoo Linux but the kernel is a vanilla kernel.


To allow the Margi DVD-to-Go to run on Linux there are several issues that need to be addressed:

Driver and hardware issues


  • Kernel Setup.
  • Kernel Driver. The DVD-to-Go uses the DVB infra structure found in drivers/media/dvb. The margi driver is found in the sub directory margi. When the Margi DVD-to-Go is inserted it will register itself into the DVB frame work.
  • PCMCIA driver. The PCMCIA driver must be adapted to enable the Zoomed Video Port on the PCMCIA slots. Not all PCMCIA slots are ZV enabled or is the ZV port connected in any way to the video chip.
  • Sound Driver. The Sound Driver must enable the ZV audio port on the Sound Card. When done correctly the ZV port switch is found in alsamixer.
  • X Windows Display Driver. Since the Margi DVD-to-Go is capable of injecting frame into the graphics processor using the PCMCIA Zoomed Video port, the Display Driver must be enabled to use an overlay which is compatible with the frame data supplied by the Margi DVD-to-Go. This involves changes in the user mode X Windows Display Drive code to handle the Xv(3) calls to allow to accept ZV data. Note: most laptops don't have a ZV port any more.


DVD player

The dvd player is written using libdvdnav and is dependent on libdvdread and libdvdcss. The program uses the Xv() interface to allow the display of Zoomed Video in an overlay plane. Issues are:

  • ISO mode vs File mode. This is handled by the libdvdnav and is transparent to the user. The player supports both modes.
  • DVB adaption. The interface to the Margi DVD-to-Go goes via the DVB api calls.


How to use the player.

It should be able to play DVD's directly of a DVD player but I have choosen to fatten my Libretto with a 120Gb HD and I used dvdbackup (dvdbackup –I /dev/<your dvd player> -M –o </where you want to place the files>)

to place the DVD files. Note that dvdbackup doesn't shrink your dvd's. See here: dvdbackup for linux

On my libretto this is dvdbackup –I /dev/hdc –M –o /dvd where /dvd is my dvd store.


The margi-player has several options which I seldom use: use -? to display them.

Two options are not documented:


-D <debug level>              : this will generate a lot of trace out.

-d <initial screen division>  : use a number between 0 and 7. This will determine the initial screen size


most of the times I for example use:

./margi-player –d 1 –D 0 /dvd/MATRIX


The DVD player code is here. The DVD Player is still a bit archaic so don’t expect any miracles although the menu's work, including subtitles (which might wander out-of-sync). The mouse is also supported (more or less J )

It should display the video frames using the Zoomed Video and you should hear sound if you have installed everything correctly, recompiled your kernel and updated the when using X windows.

Using the Margi DVD-to-Go on the Libretto 100/110CT

Currently I'm using the Gentoo distribution as it allows the compilation of Linux using an optimized set of flags for the Libretto which uses a Pentium MMX processor. It allows to install only the parts which are neeeded. The first time setup can be tedious and will take a few days and the best way to do it is using a live CD on a host computer and connect the Libretto Drive to a USB device.

Kernel Setup

The files needed for the files in a tarball is here. Note: it contains a linux-margi/ file that I currently use.

This config contains a bit more that what is needed for the Libretto 110CT.

Kernel Driver

The kernel driver is mostly taken from the margi2 base code, which was written in a previous DVB framework. The driver has been adapted to accept the 2.6 driver .ko architecture, the newer PCMCIA handling, the new DVB architecture.

The Margi DVD-to-Go uses the 16 bit ZV port.

The driver is in

PCMCIA driver

To enable the ZV on the TOPIC Toshiba PCMCIA controller a small patch must be applied to the topic.h file. The correct enabling of the ZV port is an important step for a correct operation of the Margi DVD-to-Go. Both the Video Pins and the Audio Pins need to be enabled. The tarball contains an updated linux-margi/ and a updated linux-margi/

Sound Driver

The OPL-SA3 in the Libretto should be enabled to accept the ZV audio stream. For this a small patch is needed to enable this switch which in turn when applied correctly shows a toggle in alsamixer. The volume of the ZV audio is controlled via the FM volume slide bar.


X Windows Display Driver

The Neomagic driver is enhanced to have a better handling of the driver side Xv(3) interface. This includes better handling of the overlay plane including scaling of the overlay.  Adapted code is based on reverse engineering the neo20xx.dll Windows DLL which contains the Direct X code for handling overlays. The rest of the work is based on the work of Shigehiro Nomura.

Details of the reverse engineering of neo20xx.dll is found <here>. The reverse engineering was needed since there are no technical details available for the NeoMagic 2160 chip used in the Libretto.

Since this code lies in user space it easy to debug using gdb.

The adapted source code is in neovideo.c and a shared lib which contains the update Neomagic driver is here

Old 2.4 stuff

The 2.4 stuff can be found here. But I lost my 2.4 installation so no guarantees J

The chips used in the Margi DVD-to-Go.

This section will probably get me in trouble:

here is the manual of the L64014, L64020, the cs4952-3 chip used,  the 4333 and the eeprom that is hidden somewhere.

You can see how a Margi DVD-to-Go looks internally on the home page.