<br /> HOWTO get your G400/450 singing and dancing – Debian Planet

Welcome to Debian Planet

News for Debian. Stuff that *really* matters

These are important Debian sites one should not be without!

  • Official Debian site
  • Package search
  • Mailing list archives
  • Bug reports
  • Debian on CD
  • Debian Weekly News — excellent news source!
  • Unofficial APT sources

  • Developers’ Corner
  • Community
    Need help? You’re not alone on this planet.

  • debianHELP
    (User support site)

  • Debian International
  • DebianForum.de

  • DebianForum.dk

  • EsDebian

  • DebianWorld

  • Debian-Fr

  • MaximumDebian

  • DebianUsers

  • Debian-BR

  • DebianHOWTO (Deutsch)
  • Contribute
    Got that latest or greatest scoop? Perhaps you have some important news for the Debian community? Submit a news item!

    Or perhaps you’ve written a rather ground breaking insight into some aspect of Debian and you feel compelled to share it with others? Knock up a longer editorial article and send it to the editors.

    General feedback should be sent to staff@debianplanet.org

    The place to get help on a Debian problem (after reading docs) or to just chat and chill is #debian on irc.oftc.net.

    Many of the Debian Planet staff live there so pop by and say hello.

    Debian Planet also has its own channel on the same network called #debianplanet.


    DP is sponsored by Xinit Systems.

    Domains paid for and hosted by uklinux.net.

    Buy your Debian merchandise at DebianShop.com.

    Support Debian through Bytemark Hosting. At least £7 will be given for each new account


    HOWTO get your G400/450 singing and dancing
    Submitted by agl on Friday, June 22, 2001 – 18:23
    X Windows* DRI Accel
    * FMV Playback
    * Dualhead Consoles and X
    * AA Fonts
    * Playing DVDs
    * DivX 😉 Encoding

    Everything in this works for me except where I say something is
    untested (only the TV out stuff). You might need to play about in
    order to get some of this working because systems differ. If you
    aren’t confident building kernels, configuring X and so on – this isn’t for you.

    DRI Accel Brandon has X4.1.0 BETA debs packaged in his
    area. Apt line: deb http://people.debian.org/%7Ebranden/

    You can get the very latest X from there. This is what I’m using at
    the moment and everything here works with it. Since I downloaded them,
    Brandon has updated them and Xft was missing according to #debian – so
    it is worth checking up on their state before downloading
    them. Otherwise stick to the debs in sid. If you want to stick to
    4.0.3 then you should be ok, but I’m not promising.

    Note the kernel (as of 2.4.5) isn’t quite up to date. You need to
    download the 3.x DRI modules from http://www.xfree86.org/~alanh/. Download
    the source, not the binarys and build them. Before starting X you need
    the mga.o from that directory insmodded. If you are running
    4.0.3 then these modules might be too recent, check startup logs.

    In your /etc/X11/XF86Config-4 you need to have the line
    Load “dri” in the Module section. You also need
    an IRQ assigned to your AGP slot. You can usually do this in the
    BIOS. I’m afraid that if you run Xinerama you have to disable it to
    get DRI to load.

    Now, start X and check /var/log/XFree86.0.log for lines
    containing DRI and check for errors. The X utility glxinfo
    will tell you if DRI is loaded. Look for the string Direct
    Rendering. Once you have DRI running you can try tuxracer out 😉

    AA Fonts You need recent versions of libqt to get AA fonts. You
    can check if your QT can do AA by running ldd
    /usr/lib/libqt.so can checking that the library is linked
    against Xft and Xrender. You also need RENDER support in your X server
    which you can check with xdpyinfo | grep RENDER. You should
    also have the freetype and type1 X modules

    If you have a font server configured you should disable them and make
    sure you have a truetype font directory configured. You can get the
    (free) MS font pack by installing the msttcorefonts package
    which downloads the font pack from the Microsoft server. AA
    fonts are configured by /etc/X11/XftConfig but the default
    is a reasonable start. Once you have all this configured
    export QT_XFT=1 and run a QT app like konqueror. The fonts
    should be anti-aliased. Unfortunately, AA fonts do not work well with
    Xinerama (again) so you have to disable it for them to work.

    Here is my X config Files section:

    Section “Files”
    RgbPath “/usr/X11R6/lib/X11/rgb/index.html”
    FontPath “/usr/X11R6/lib/X11/fonts/local/index.html”
    FontPath “/usr/X11R6/lib/X11/fonts/misc/index.html”
    FontPath “/usr/X11R6/lib/X11/fonts/75dpi/-unscaled/index.html”
    FontPath “/usr/X11R6/lib/X11/fonts/100dpi/-unscaled/index.html”
    FontPath “/usr/X11R6/lib/X11/fonts/PEX/index.html”
    FontPath “/usr/X11R6/lib/X11/fonts/TrueType/index.html”
    FontPath “/usr/X11R6/lib/X11/fonts/truetype/index.html”
    FontPath “/usr/X11R6/lib/X11/fonts/cyrillic/index.html”
    FontPath “/usr/X11R6/lib/X11/fonts/Type1/index.html”
    FontPath “/usr/X11R6/lib/X11/fonts/Speedo/index.html”
    FontPath “/usr/X11R6/lib/X11/fonts/75dpi/index.html”
    FontPath “/usr/X11R6/lib/X11/fonts/100dpi/index.html”
    FontPath “/usr/X11R6/lib/X11/fonts/misc/index.html”

    Dualhead X
    After seeing all the stuff above about how Xinerama breaks things you
    might be wondering why you would want a dualhead system. Well, for
    one, it is damm useful for coding and you don’t have to run Xinerama
    to get dualhead. Xinerama just binds 2 displays together into one but
    if you run dualhead without it, you get 2 different displays. This means
    that you can’t move windows across the displays and so on – but it
    does work.

    To get dualhead working you need to config your G400 card as 2
    different devices. Here is the section from my X config:

    Section “Device”
    Identifier “G400_1”
    Driver “mga”
    Option “AGPMode” “1”
    BusID “PCI:1:0:0”

    Section “Device”
    Identifier “G400_2”
    Driver “mga”
    BusID “PCI:1:0:0”
    Screen 1

    Note that if you don’t have a wonderful dualhead card you can run 2
    different cards in the same way. This means you have to dig up a PCI
    graphics card (I’ve never seen a motherboard with two AGP slots) but
    they aren’t too hard to find. This also means that you can run 3, 4,
    5, … screens if you like (and if you have desk space for all these

    You need to setup 2 Screen sections like you would normally and then a
    ServerLayout section:

    Section “ServerLayout”
    Screen “Screen 1” RightOf “Screen 2”
    Screen “Screen 2” 0 0
    InputDevice “Mouse1” “CorePointer”
    InputDevice “Keyboard1” “CoreKeyboard”
    Option “Xinerama”

    “Screen x” is just what I called my Screen sections. Also
    make sure you get the direction round the right way. Matrox have
    release a Linux version of their PowerDesk utility (pompous name for a
    simple utility). You can get it from their
    (follow the links to the Linux drivers).

    This utility also allows you to set the second head to output NTSC or
    PAL output (for TVs) given that you have the Matrox HAL library
    installed. This is a closed source library which you can get from the
    Matrox website and enables Macrovision
    (a really stupid system which upsets some VCRs). High-quality VCRs
    aren’t affected by Macrovision – but these are rare.

    I’ve not tried running the output to a TV yet. The G400 comes with a
    converter from a standard PC video out to S-VIDEO and something that
    looks like a coax video cable. The coax connector isn’t actually a
    normal connector (it’s a little too big) but you can get S-VIDEO->Coax
    converters (in the UK, try Maplins).

    FMV playback

    By far the best video player I’ve found is MPlayer. This has played everything
    I’ve thrown at it so far. It uses the avifile way of loading windows
    DLLs for codecs so you need the set of DLLs in /usr/lib/win32 (you can
    get them from the avifile site, I think)

    However, it also comes with some interesting drivers for the
    G200/G400. Under the drivers subdir of the mplayer source
    there is a kernel module for the mga_vid device. This
    allows applications to use the hardware scaling and colour conversion
    which really speeds up playing.

    After building and insmodding the mga_vid.o you need to
    create a device for it with mknod /dev/mga_vid c 178
    0. After this you need to run the configure script for mplayer
    again and rebuild it. Once you have done this you can use the switch
    -vo mga (console mode) or -vo xmga (in X) to use
    it. Note that this conflicts with Xv (the X video extension, load the
    extmod X module) and you might need to reboot to get Xv
    working again. In X, Xv does almost the same thing that xmga does
    except that xmga can play on the second-head.

    Mplayer really is worth playing with – it’s a great piece of work

    Dualhead Console if you have the matrox frame buffer drivers
    installed in your kernel you can actually get dualhead console
    mode. Now I don’t find the matrox frame buffer is very stable when
    switching to X and back – so keep those disks sync’ed. That being
    said, switching to X via Alt-F7 locks my box up hard without

    You need to persuade the kernel to build the i2c-matrox and
    matrox-maven modules as well as all the normal Matrox
    frame buffer ones. I couldn’t find this in the normal
    config and had to edit the .config file manually. The
    CONFIG_FB_MATROX_I2C. Note that this needs I2C support and
    I2C bit-banging support (in the normal config under character
    devices). I’d suggest building all of these as modules.

    Insmodding all the modules can take a bit of time in order to get all
    the depends right – but there is only a finite number of orders you
    can insmod them in. It’s best if you install the modules properly and
    use modprobe.

    Now we go back to the mplayer source and into the TVout
    subdir. This contains all the tools needed, so build each of
    fbset, con2fb and matroxset. Running
    the modules script will try to insmod all the needed
    modules. Once you have all the modules installed you should have 2
    frame buffer devices – fb0 is the primary head and fb1 is the secondary

    The matroxset utility can setup the second head. matroxset -m
    128 should activate the second head and con2fb/con2fb
    /dev/fb1 /dev/tty2 should bind tty2 to it. You should now have
    tty2 on the second head and another console on the primary head. You
    can switch consoles as normal and see 2 at once. Note that consoles on
    the second head are really slow.

    You can also set the second head to TV mode with matroxset -m
    x (where x=1 for PAL and x=2 for NTSC). I haven’t tried this yet
    – see above for information about the connector. Also untried (but it
    should work) is using mplayer’s fbdev mode (-vo fbdev
    option on the command line) and setting $FRAMEBUFFER to
    /dev/fb/1 (this maybe /dev/fb1 if you don’t run devfs) to play to a
    VCR because I don’t think this will have Macrovision.

    Playing DVDs
    You should have read the above section on FMV playback before reading
    this. Also, if you are in the USA it might be illegal for you to read
    this or try any of this. Just don’t be surprised that the MPAA decrees
    your head to be their intellectual property in 10 years time.

    Firstly, you need a DVD drive. I have an SR-8585-B and it
    works for me. Before investing you might want to check which DVD
    drives are region-free, or can be made so. More on this below

    DVDs use the UDF file system so you need to build your kernel with UDF
    support in (or as a module). Get a DVD (they can be quite expensive
    but you can rent one to try it out) and try to mount it with
    mount -t udf /dev/hdd /cdrom. I’ll be using
    /dev/hdd as my DVD device, change it to fit your
    system. I’ll also be using /cdrom as my mount point, again,
    change to fit your system. Once mounted, you should see a
    VIDEO_TS directory and a few files in it.

    You can’t actually read those files (yet) because of CSS – the
    encryption system which DVDs use. You must have heard all about CSS by
    now – so I won’t talk about the legal/social aspects here. One other
    trick DVDs have is regions. All DVDs have a region marker which the
    DVD reads (Region 1 = USA, 2 = Europe, … up to region 8). Some DVDs
    are hardwired only to read certain region DVDs, some are region-free
    and will read anything and some use the 5 strikes system where the DVD
    drive will change regions 5 times and lock on the 5th
    time. If you happen to put a odd region in on the 5 change – you are
    stuck with it.

    With my drive I can use the regionset utility from LinuxTV.org
    to set the region of my drive.

    Now grab libcss from LiViD and build and install it. You
    can now reconfigure mplayer with the –with-csslibdir and
    –with-cssincdir options (these are required) to use
    libcss. Do so and rebuild mplayer.

    Now in libcss/src there are a number of utilities. Firstly run
    ./tstdvd /dev/hdd (you may need to be root). This should get
    the 2048 byte disc key for the DVD and dump it in a file called
    disc-key. Then run ./tstdvd /dev/hdd
    /cdrom/VIDEO_TS/VTS_01_1.VOB (you may need to put in a valid
    filename here). This will get the title-key from the DVD. If getting
    the title key fails with an I/O error it usually means the region is
    wrong – check your syslog.

    If that went well, mplayer should be able to play the DVD (you did
    rebuild mplayer with libcss support, right?). So run mplayer -vo
    xv -dvd /dev/hdd -aid 128 /cdrom/VIDEO_TS/VTS_01_1.VOB and
    hope. The -aid option selects the audio track and 128 seems
    to be English for me, without it I get only the sound-track (no
    speech). Interestingly, AID 130 gives me a commentary.

    If the audio isn’t in sync with the video (you can see this as soon as
    someone speaks) you can use the -delay option. A delay of
    -0.3 seconds works well for the DVD I’m using.

    DivX 😉 Encoding Think of this what you will. As I said above
    I’m not getting into the legal/social aspects here.

    Firstly – you need to get the unencrypted MPEG file from the DVD. You
    can use the css_cat utility from the libcss source to get
    this. It needs the disc-key and title-key files
    produced by tstdvd above. Note that different titles (the
    first number in the VTS filename) may have different
    keys. The command is roughly css-cat -v1P
    /cdrom/VIDEO_TS/VTS_01_1.VOB > vts1.mpeg.

    Now we have the raw MPEG we can encode it to DivX ;-). Mplayer can
    actually make DivX using the Project Mayo encode code – but it has no
    audio. However, x2dixv
    works well. With x2divx I didn’t get any audio until I used the CVS
    version of avifile – your luck may vary. x2divx can take a -b
    option to set the DivX bit rate and I find a value of 6000 gives good
    quality and a 5:1 compression ratio.
    As always – have fun. AGL

    Category: HOWTOs

    Control panel

    Comment viewing options:

    Select your prefered way to display the comments and click ‘Update settings’ to activate your changes.

    Subject: Re: what about xine?
    Author: Anonymous
    Date: Sunday, 2001/10/21 – 23:01
    Why build from source?
    If you’re running sid, you can just install xine from Debian packages (apt-get install xine-ui)
    Using the DVDnav plugin (package xine-dvdnav), you can even play menus and some other special features…

    Okay, that’s all on non-encrypted DVDs so far, but if you got libcss installed, that will be used by libdvdread which in turn is used by the DVDnav plugin, so: works as well!

    [ return ]

    Search articles

    ·News (199)
    ·Features (3)
    ·Site News (9)
    ·HOWTOs (41)
    ·Tips (7)
    ·Opinion (12)
    ·Q & A (19)
    ·Sponsorship (1)

    Log in


    Remember me

    » Register
    » New password

    Debian Security Announcements
    DSA-377 wu-ftpd
    DSA-376 exim
    DSA-375 node
    DSA-374 libpam-smb
    DSA-373 autorespond
    DSA-372 netris
    DSA-371 perl
    DSA-370 pam-pgsql
    DSA-369 zblast
    DSA-368 xpcd

    Latest poll: Favourite DebianPlanet editor
    You all suck

    home · archives · news feeds · about · polls · search · sections · user account

    Powered by the amazing Drupal

    Debian Planet is not officially related to the Debian Project.
    Debian and the Debian logo are trademarks of Software in the Public Interest, Inc.