Basic Installation Instructions for ATI All in Wonder Cards under Linux

Last updated

April 14th, 2005.

Note that although I still receive reports and feedback from users working to get AVView and PVR functionality going (and make updates to this page as appropriate), I myself haven't done a reinstall since 2003. So some or all of this documentation may use very out-of-date versions of XFree86 (haven't we ditched this now?), FFMpeg, ALSA, and so on. My hope is that the general process hasn't changed too much and that people will continue to send me updates when they find out-of-date information in the HOWTO.

Credits

The following individuals have provided invaluable feedback for this HOWTO, and deserve kudos accordingly:

If I've forgotten anyone, or if you're the Brett whose last name I don't have, please let me know (send me an email -- radeon 'at' reades.com -- I'm trying to avoid posting my personal email to limit spambots) and I'll update ASAP.

About this HOWTO

This is quick and dirty guide for installing and running the GATOS ATI drivers and related video applications for Linux. The intended audience is intermediate users who aren't afraid of configuring and compiling their own kernel and a number of applications from source, but who don't necessarily understand the guts of C and C++ coding (I certainly don't, although it might have helped if I did).

These instructions were written for the newer Radeon cards, but older cards using, for instance, the Rage 128 chipsets should also work correctly although you will need to make some adjustments (I've tried to highlight those places, but some changes may be missing).

If you start running into problems, or want to make sure that you have things right, I'd strongly suggest that you go to the GATOS site and review the official documentation. This page is designed to serve as a companion for those who find the GATOS documentation intimidating or hard to follow and it is by no means a substitute for reading the real thing.

Hardware

My installation platform was a Dell XPS T450 (PIII at 450 MHz) with the Radeon All in Wonder 32MB AGP card running at 2x. I am currently running Mandrake 8.1, so please don't ask me for help with Debian, Slackware or any of the other distros since I have no experience with their particular package managers.

Card Matrix and Compatibility

This is a new section and 'thoroughly' incomplete, so please help me update it with the correct information by sending me an email at gatos-at-reades.com. I'd also like to tie this back eventually the CVS repository, so if you have a working tag or revision let me know that as well.

If you can't find your card or see only '?'s for all of the capabilities, do not despair! The GATOS project supports most ATI cards, so you should go ahead and give it a try! As I receive confirmation of various functionalities from the GATOS developpers, I will update the matrix to help you determine what features of your card are supported.

Update: 03.05.2002 (March 3rd) -- I am completely swamped at work and haven't had time to update this with all of the good info that people are sending in! Here's a general rule based on what I've seen from off-list emails -- if you have a very old card then you are best off using the older ati.2 code with XFree86 4.1.x, while if you have a very new card (such as the 8500) you should be able to get most things running correctly, but can expect to encounter issues with specific features (such as video capture).

Card Type DRM ATI.2 Video In Video Out Capture (km) Recommended X Server
AIW Radeon 8500DV N Y P ? Y 4.2.x
Radeon 8500 ? ? ? ? ? ?
Radeon 7500 ? ? ? ? ? ?
Radeon 7200 ? ? ? ? ? ?
Radeon 7000 ? ? ? ? ? ?
Radeon VE Dual Display ? ? ? ? ? ?
Radeon 64MB DDR Y Y N N Y 4.1.x/4.2.x
Radeon 32MB DDR ? ? ? ? ? ?
Radeon 32MB SDRAM ? ? ? ? ? ?
AIW Radeon Y Y Y ? Y ?
Rage Fury Maxx ? ? ? ? ? ?
Rage Fury Pro ? ? ? ? ? ?
Rage Fury ? ? ? ? ? ?
DV Wonder ? ? ? ? ? ?
AIW Rage128 N Y Y ? Y 4.1.x/4.2.x
AIW Rage128 Pro N Y Y ? Y 4.1.x/4.2.x
ATI TV Wonder ? ? ? ? ? ?
TV Wonder VE ? ? ? ? ? ?
TV Wonder USB ? ? ? ? ? ?
Xpert 2000 ? ? ? ? ? ?
Xpert 128 ? ? ? ? ? ?
Xpert 99 ? ? ? ? ? ?
Xpert 98 ? ? ? ? ? ?
Mobility Radeon ? ? ? ? ? ?
Rage Mobility (M3/Rage 128) ? Y N N Y 4.1.x/4.2.x
Rage LT Pro ? ? ? ? ? ?
3D Rage LT ? ? ? ? ? ?
Impact V2 ? ? ? ? ? ?
Rage XL/XC ? ? ? ? ? ?

Required applications/libraries

You will need the following, but some of them may already be installed on your system:

Also note that Redhat 9.x contains a custom kernel that breaks compatibility with AVView. If you are using RH9 you will need to rebuild your kernel.

Update for new installations: since most distros now enable everything and the kitchen sink as a module much of this work no longer appears to be necessary -- on Mandrake 9.1 I found that I had ALSA enabled by default and XF86 4.3.0 with DRI. With this combination I was able to jump straight to the DRM section (after installation the kernel source from RPM) and proceed from there. If, however, you encounter difficulties with your installation then please review the sections for both Kernel Configuration and XF86 Installation and Configureion.

Kernel Configuration

The instructions here assume that you're using a Radeon, but it should be possible to simply substitute the appropriate ATI module if you're using a different ATI card (such as the Rage128 or Rage Pro chipsets).

The first thing you need to do is check your kernel configuration. If you aren't running the latest kernel, I'd suggest updating to at least 2.4.17 (the newest as of this writing). It is way beyond the scope of this page to go over compiling and installing a kernel, but even if you've done this before there are still a few gotchas to watch out for...

  1. Under "Loadable module support"
  2. Under Console Drivers -> Frame-buffer support
  3. Under Character Devices
  4. Under Multimedia Devices
  5. Sound configuration (this section is a lot sketchier since the correct configuration will depend on the specific sound system in your machine, but this is what worked for me with the Yamaha onboard sound card on my Dell)
  6. Depending on your kernel configuration (you should know the drill)
  7. If you've had to make changes to your kernel config, at this point you'll need to reboot your machine to take advantage of the changes you've made.

XFree86 4.2.0

Now that your kernel is correctly configured, your next step is to follow the instructions for compiling and installing XF86 from source. I'll summarize them below, but please note that I cannot be held responsible for your failure to read the documentation if BAD THINGS happen.

Compiling

The steps for XF86 are pretty straightforward:

  1. Download tarball from XFree86.org
  2. Back up your existing X server with tar -cvf XFree86-bak.tar /usr/X11R6
  3. tar -xzvf X420src-x.tgz (where 'x' is each of the three source tarballs)
  4. cd xc
  5. make World WORLDOPTS= 2>&1 world.log ('WORLDOPTS=' causes compilation to die on any errors)
  6. make install >& install.log
  7. make install.man >& manpages.log

Note that the build phase for XF86 will easily run to three or four hours. I had time to go in to Manhattan from Brooklyn, visit a couple of shops, come back on the subway again (the 'F' train, no less) and it was still compiling. Also, you will need close to 300MB of free space to hold the unpacked source files and perform the installation. By piping the process output into world.log/install.log, you free yourself up to check up on the compilation from the office, or just look through the log for problems if anything goes wrong.

Do not delete the source tree under xc since you will need it to build the ATI.2 drivers if you are building from CVS.

Backing up your clean X 4.x.x directory

After this, I'd suggest doing the following:

  1. cd ..
  2. tar -cvf XFree86-4.2.0-clean.tar xc
  3. gzip XFree86-4.2.0-clean.tar

This will give you a clean, but already compiled, XF86 tree to use if you screw up at some point and aren't sure if your installation is still functional. After recompiling X three times (at three hours a pop) I learned the wisdom of keeping a backup around.

X Config File

You should also check your XF86Config-4 file to make sure that X will load the correct extensions when you start X. The config file can normally be found in /etc/X11/ and you'll need to add the following:

  1. In Section "Module"
    • Load "glx"
    • Load "dri"
    • Load "dbe" (you may already have this)
  2. In Section "DRI" (you'll probably need to create this)
    • Section "DRI"
    • Mode 0666
    • EndSection (don't forget to end the new section)

Please note that I have received reports that DRI-support is not available on all ATI cards using the default XFree drivers. There is a small, but very real, possibility that this might cause a system crash. If this occurs, then turn off DRI support and proceed to installing the GATOS driver before attempting to turn on DRI again.

At this point, if you built your kernel with the ATI Radeon module set to 'M' (instead of 'N') you should be able to test your installation using the default ATI drivers from XFree86 by running glxgears after restarting X. I seem to recall performance in the range of 900 FPS using the non-GATOS drivers. If you are getting performance in the sub-300 FPS range then DRI is not working correctly and you should check your X log for errors or issue the following command to start X: startx >& x.log and then checking x.log.

Note also that installing X from source has completely mangled my Mandrake installation -- the nice front end for rpmdrake and for configuring mount points is gone... and I haven't figured out how to get it back despite installing *drak* from rpmfind.net. You have been warned.

DRM Kernel

You're now ready to replace the XFree86 DRI modules with those from the GATOS project. This process if fairly straightforward.

  1. cvs -d:pserver:anonymous@cvs.gatos.sourceforge.net:/cvsroot/gatos login
  2. <hit enter to login anonymously>
  3. cvs -z3 -d:pserver:anonymous@cvs.gatos.sourceforge.net:/cvsroot/gatos co drm-kernel
  4. cd /path/to/drm-kernel
  5. make -f Makefile.linux
  6. cp radeon.o /lib/modules/2.4.17/kernel/drivers/char/drm/ (see below)

It's possible that the Makefile.linux file is missing from the CVS checkout. I poked around on the GATOS site and found a copy of this file which appeared to function correctly.

Also, if you are using the Rage128 chipset, instead of copying radeon.o over to lib/modules, you'd copy r128.o instead. Simply substitute Rage 128 wherever you see me using the Radeon module.

DRM installation alternatives

There are, in fact, three ways to complete the drm-kernel installation.

  1. If you don't recompile your kernel very often then the way outline above works fine. Basically, you're just replacing the DRI driver module for the Radeon that comes with XFree86 with the one from the GATOS project. The trick is to remember that you've replaced this module, and that any time you recompile your kernel you also need to remember to copy the radeon.o file over to lib/modules again.
  2. Another way to manage the new module is to insmod it at startup via a script in /etc/init.d. That way, if you recompile your kernel you don't need to remember to copy over the driver since the rc.d script will take care of it for you.
  3. A third way, suggested by Lars Hugentobler, is to use 'N' for the Radeon module in the kernel config, and then place the radeon.o module in lib/modules/kernel-version/misc. Apparently, the misc directory is left untouched during module (re)compilation so you don't need to worry about either a) copying it over each time, or b) writing your own shell script to insmod the driver at startup.

I set my machine up the first way since it was the way that made sense to me thanks to a helpful list member (if you're reading this oh helpful person, please let me know your name since I've lost the original email and I'd like to add a credit), the second was recommended by the architect of the GATOS drivers, and the third is what I'd do if I were starting over again since I'm not big on shell scripting (although please note that I haven't tested this method so I make no guarantees), so you make the call.

ATI.2 drivers

Please note that it is possible to install the ATI.2 drivers as binaries so that you don't need to go through compiling XFree86. However, I found that I had far fewer issues with compiling and installing from source than I did when I tried to stay binary.

The CVS checkout here will give you the devel branch (which is required, as of this writing, for TV out). If you want to check out the main branch, just remove the "-r devel" from the checkout command.

  1. cvs -d:pserver:anonymous@cvs.gatos.sourceforge.net:/cvsroot/gatos login
  2. <hit enter to login anonymously>
  3. cvs -z3 -d:pserver:anonymous@cvs.gatos.sourceforge.net:/cvsroot/gatos co -r devel ati.2
  4. cd /path/to/ati.2
  5. xmkmf /path/to/your/xfree86/tree (e.g. /temp/xc)
  6. make
  7. make install

This is the main reason you keep your XFree86 source code lying around. The ATI.2 drivers need to be built against the XFree86 tree, and cannot be built against /usr/X11R6.

Reboot

Now would be a good time to restart your machine to make sure that everything is running correctly at the kernel and XFree86 levels.

After starting up X, type xdpyinfo to check that DRI and XVideo are loaded and running correctly. Then run glxgears to see DRI in action. On my AGP Radeon I was getting between 600 and 900 frames per second with the ATI.2 drivers.

KM

You do not need KM installed in order to watch video input from the ATI card. KM is required only if you want to do video capture work. It is also possible to install KM after getting AVView working, so if this is your first time getting an AIW card running under Linux you might just want to skip this stage for the time being.

KM allows you to capture video via your ATI card. I have not yet tested this feature however, so although installation went smoothly I don't yet know if it actually works.

Note that if you have Video For Linux set up as a module, then you will need to first insert the v4l module using the following command:

Installation goes as follows:

  1. cvs -d:pserver:anonymous@cvs.gatos.sourceforge.net:/cvsroot/gatos login
  2. <hit enter to login anonymously>
  3. cvs -z3 -d:pserver:anonymous@cvs.gatos.sourceforge.net:/cvsroot/gatos co km
  4. make
  5. make test
  6. make install

make install installs the km module under /lib/modules/kernel-version/misc. If make test fails (because, for instance, you didn't have the v4l module -- videodev -- inserted) then you'll want to run rmmod km_api to remove the km code from the running kernel before running make test again after fixing the errors.

Beyond that, you are currently on your own since I haven't used km to actually do anything yet. I will update this section as soon as I have been able to test and use km successfully.

FFMPEG

Installing FFMPEG should be fairly straightforward. Read the instructions. Make sure that you're using a version newer than 0.4.5 (or that you patch 0.4.5).

Please note that I have received a bug report from "Joe Smack" that compiling ffmpeg with the option --enable-mp3lame will cause AVView to fail to compile. You have been warned.

  1. cvs -d:pserver:anonymous@cvs.gatos.sourceforge.net:/cvsroot/ffmpeg login
  2. <hit enter to login anonymously>
  3. cvs -z3 -d:pserver:anonymous@cvs.gatos.sourceforge.net:/cvsroot/ffmpeg co ffmpeg
  4. cd /path/to/ffmpeg
  5. make
  6. make install

Do not delete the ffmpeg dir after installation because AVView will need it in order to build successfully.

ALSA

Sound was the biggest headache for me. I don't know what it is about me and ALSA but we just don't get along. I highly recommend a visit to the alsa-project Web site. They seem to have added a helpful configuration tool/document (click on the 'Details' link) that wasn't available last time to walk you through the installation based on the sound card that you have. I would have discovered that you don't need to run snddevices to configure ALSA on a system with devfs support and thus saved myself a lot of grief.

I also discovered that I needed to unload any existing drivers before being able to load the ALSA drivers for my card. So after a day spent tearing my hair out it came down to:

Avview requires the 0.9.x series of drivers and utils. You will need, at the very least, the driver and lib and util tarballs, and you want to install them in that order.

In case you've forgotten, to unzip bz2 files you just run bunzip2 name-of-file.tar.bz2, followed by the regular tar -xvf name-of-file.tar.

Remember to check if you need to run snddevices in the ALSA driver directory in order to set up the ASLA devices correctly after building and installing the drivers via make. Hint: don't do it if you have devfs support built-in (most recent Linux distros appear to have switched from making this an option to making it the default).

As far as I can tell, configuring alsa is something of a black art, and most people seem to simply appropriate someone else's working config file and adapt as necessary.

You may need to modify your modules.conf (or conf.modules, depending on the distro) file in the /etc directory. Here are the relevant portions of my modules.conf file which are for a Yamaha DX-G-somthing-or-other onboard sound card:

alias char-major-116 snd
above snd-ymfpci snd-pcm-oss
post-install snd-ymfpci alsactl restore
alias sound-slot-0 snd-ymfpci

Don't forget to set the permissions like this: chmod a+rw /dev/dsp /dev/mixer /dev/sequencer /dev/midi

Getting sound working properly was the hardest part of this process. I believe that this was in no small part because I had two sound cards -- an Aureal Vortex 2 (which is not supported by ALSA, but was supported by the kernel itself), and a Yamaha DX-G-something-or-other (which is). One was onboard, the other was in the PCI slot.

I had thought that the Yamaha (since ALSA was listing it with the YMFPCI driver) was in the PCI slot and the Aureal was onboard, but after disabling sound in the BIOS (which disabled the onboard system), I could no longer find the Yamaha but the Aureal was still showing up!

After that discovery, I decided to take the machine apart and see for myself. Sure enough, the unsupported Aureal was the one in the PCI slot, and once I had removed it and turned the Yamaha back on in the BIOS, sound setup went smoothly. Point is, before you give yourself a lot of grief because you make some assumptions about your computer's sound setup, take a look. Also, I'd suggest using only one soundcard in your system at a time (unless you're an ALSA wiz, in which case you probably don't really need this walkthrough).

The next-to-last step to getting sound working, and perhaps the most obvious but also easiest to forget is connecting the ATI card to the sound card (thanks to Brett/deek for this tip). On the All in Wonder this is done using the dongle that has a line-out jack (looks like a headphones jack). Just plug that jack into the line-in on your sound card (probably a blue input of matching size) and the other end into the S-Video out on the ATI card, and you should be set up with sound.

The final step is to turn on all of the ALSA controls. alsamixer is a good way to do this since it's relatively easy to understand. On the whole, you want to turn up everything that can be turned up (just turn your speakers way down while you're playing around) and make sure that nothing is muted. If you see a pair of M's at the top of the column, then even though you may have adjusted the sound, the channel is still muted. A good way to check that everything is set correctly is to run amixer | more. This gives you a textual representation of your ALSA channels to check against the visual one of alsamixer.

libzvbi

This was a new one since I last installed AVView. I was unable to use the standard RPMs since I'm running a fairly old Mandrake distro and the stock RPMs assume more recent versions of glibc. However, the source RPM worked just fine for me:

  1. rpm --rebuild zvbi-0.2.3-1.src.rpm
  2. cd /usr/src/RPM/RPMS/i686/
  3. rpm -Uvh zvbi-0.2.3-1.i686.rpm

Tcl/Tk 8.4.x

Another new requirement since my last bout of avview installation (maybe it's time I updated my machine...).

  1. tar -xzvf tcl8.4.2-src.tar.gz
  2. cd tcl8.4.2/unix/ (assuming that you're on Unix/Linux)
  3. ./configure
  4. make
  5. make install (no make test that I can find)

Same for tk8.4.2-src.tar.gz.

In order to get AVView to run I also had to do the folliwng:

  1. Make sure that /usr/local/lib is listed in /etc/ld.so.conf and then run ldconfig
  2. If all else failes then you can run export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib (since that last dir is where Tcl/TkConfig.sh is installed on my system) or add this in your .bashrc file

AVview

It took me two weeks to get Avview to compile, much less install. Whether there was an update to the CVS source, or whether something I changed enabled it to compile successfully, it nonetheless finally did after some long, frustrating evenings.

If you are installing AVview from CVS then you may have to lead off with the following commands inside the AVview directory to get things compiling on your system:

  1. #autoconf
  2. #autoheader
  3. #automake

Additionally, if you have a version of make installed that differs from what was used in CVS then you may need to deal with the following (top o' the hat to Alan Cooney):

# generated automatically by aclocal 1.9.1 -*- Autoconf -*- 

(this is the first line, the number needs to be changed to the correct version of automake)

# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])

(The number on the last line "1.9" needs to the correct version of automake)

# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
     [AM_AUTOMAKE_VERSION([1.9.1])])

(The number on the last line "1.9.1" needs to the correct version of automake)

  1. ./configure --with-ffmpeg=/temp/ffmpeg --with-tcl=/usr/local/lib/ --with-tk=/usr/local/lib/ (you may need to change the paths for your own distribution)
  2. export CFLAGS=-I/usr/include/tcl8.3 -I/usr/include/tk8.3 (this is currently recommended for Debian only because of Debian's Tcl/Tk layout, but if you run into problems on another distro it's worth trying)
  3. make
  4. make install

If you're so inclined, you can actually run make test, but you'll need to modify the Makefile since, as of this writing, the test points to an Xserver named inspiron. Changing the Xdisplay to localhost brought up avview on my desktop and I could watch something playing on the VCR.

To run AVView, just type avview.scp.

Using the avview controller, make sure that you unmute the input by pulling up the correct interface in the secondary window or you'll hear nothing.

I have also been able to watch games and DVDs from my PS2 by hooking it up the S-Comp dongle that is included with the Radeon card and changing the source accordingly. There's a tiny amount of distortion at the top and bottom edges of the window, but playback is really quite good considering that the signal is going from analog (PS2 out) to digital (ATI DVI out) before hitting my flat panel.

Video Capture

You know you want it.;)

If you've restarted your computer since running make test during the km setup portion, you'll need to go back and do it again or you won't see your video capture device in AVView. Be sure to restart X if you end up inserting the videodev module.

More recent versions of AVView support multiple formats -- I was recently able to view a couple of seconds of captured footage from a DVD using Apple's Quicktime viewer and the clip in an MPEG format (don't forget to change the extension).

I've also had some issues with sound during video capture, so I'm afraid that you'll need to play with the settings a bit to figure out how to include this and at what bitrate.

However, more than any other type of operation, video capture requires that you have a fairly new system with gobs of RAM. Although my Linux box has 640Mb of RAM and a large hard drive, the processor is creaking along since it's a PIII 400. I suspect that this is the main reason that my video capture experiment ended up with about 20 seconds of the same scene after successfully capturing the first six or seven seconds' worth of footage.

HTH