Skip to content. | Skip to navigation

Personal tools
Log in
Sections
You are here: Home Software Ubuntu with Unichrome

Ubuntu with Unichrome

Using Ubuntu Linux (5.10) with the unichrome driver

INFO: i switched my Multimedia PC to an athlon64 based system. So i never finished the DRI part of this tutorial. Playing around with the board it was grilled so i can't do any tests with unichrome.

Motivation

The goal is to get the Unichrome driver from sourceforge working under Ubuntu Linux 5.10. The Reason to do this is a performance issue.

Out  of the box, Ubuntu is using x.org 6.8 with a via driver. This setup is working fine. If you don't have any issues with this, forget about this document.

Using the unichrome driver you can get two things

DRI:  That means direct access to the video hardware giving you opengl and xoverlay.
XvMC: Accessing the hardware mpeg2 decoder of the cipset, giving you increased performance during dvd or dvb playback.

I have a Epia M-10000 mainboard with a cle266 chipset. I want to use this system as a music-box and stepmania system. The system has no dvd so that's not my reason to get it to work. But if i have a lot of spare time i might add this.

Requirements

To get the Unichrome diver working under Ubuntu Linux 5.10 you need to compile a few things yourself. Don't be scared it's not that hard.

  • A working ubuntu setup (including xorg with the ubuntu-via driver)
  • Linux Kernel headers
  • build-essentials
  • gcc-34
  • source-tree of xorg
  • unichrome package

Get the Ubuntu packages. use apt as root:

root@epia:~# apt-get install linux-headers-2.6.12-9-686
root@epia:~# apt-get install build-essentials
root@epia:~# apt-get install gcc-3.4
root@epia:~# apt-get install xmkmf

(that was hard, was it? I really like apt). Be sure to get the headers matching your kernel.

Go to a nice directory. I did all the stuff as root (which is propably bad, but i'm lazy).

root@epia:~# cd /root
root@epia:~# mkdir sources
root@epia:~/sources# cd sources
root@epia:~/sources# apt-get source xserver-xorg
root@epia:~/sources# ls -l xorg-6.8.2
total 48934
drwxr-xr-x  6 root   root       6400 2005-10-21 20:54 debian
-rw-r--r--  1 scorch scorch 50050449 2005-02-18 09:27 xorg-6.8.2.tar.gz
root@epia:~/sources# tar zxvf xorg-6.8.2/xorg-6.8.2.tar.gz

This will download the xorg sources ubuntu used to build it's packages and extract them to the folder xc,

Next thing is the unichrome package. I don't really get it who is develloper and who is angry. I got my unichrome package from Ivors Page, who is no longer on sourceforge. *hm*

root@epia:~/sources# wget http://myth.ivor.org/unichrome/unichrome-20051018.tar.bz2
root@epia:~/sources# tar jxvf unichrome-20051018.tar.bz2
root@epia:~/sources# mv unichrome-20051018 uni

Sources are now complete. I will leave out the shell-prompt. Hope you still get it.
First we compile and install the kernel modules

cd ~/sources/uni/drm/linux-core 
make LINUXDIR=/usr/src/linux-2.6.12-9-686 DRM_MODULES=via
cp *.ko  /lib/modules/`uname -r`/kernel/drivers/char/drm/
depmod -ae
echo "drm" >>/etc/modules
echo "via" >>/etc/modules

reboot and check the xorg log. (Ok you don't need to reboot, it's linux not windows.  Go to vt1, stop gdm, load the modules drm and via, start gdm).

root@epia:~# grep /var/log/Xorg.0.log -e 'direct rendering'
(II) VIA(0): direct rendering enabled

Wow, now fire up glxgears and check the performance.

user@epia:~# glxgears -iacknowledgethatthistoolisnotabenchmark

some results for comparison. (Rember, Epia M-10000).

  • vesa 420 frames in 5.1 seconds = 81.694 FPS
  • no-dri, ubuntu via, 560 frames in 6.4 seconds = 87.379 FPS
  • dri, ubuntu via 2121 frames in 5.0 seconds = 424.164 FPS

libxvmc

now for libxvmc.

touch ~/sources/xc/config/cf/host.def
touch ~/sources/xc/config/cf/date.def
cd ~/sources/uni/libxvmc
xmkmf ~/sources/xc

ok, now we have a makefile. but compile will fail

root@epia:~/source/uni/libxvmc# make
...
/usr/include/linux/config.h:1:2: error: #error \
  "Compilation aborted. Please read the FAQ for linux-libc-headers package."
/usr/include/linux/config.h:2:2: error: #error \
  "(can be found at http://ep09.pld-linux.org/~mmazur/linux-libc-headers/doc/)"
make: *** [viaXvMC.o] Error 1


I have no real clue what I am doing. But it seems to work.

root@epia:~# cd /usr/include
root@epia:/usr/include# mv linux linux.bak
root@epia:/usr/include# ln -s ../src/linux-headers-2.6.12-9/include/linux/


try again. this time we get the error

viaLowLevel.c:521: error: EAGAIN undeclared (first use in this function)

edit /usr/include/linux/errno.h and add the following lines at the beggining

#ifndef _LINUX_ERRNO_H
#define _LINUX_ERRNO_H
#include <asm/errno.h>

/* add this */
#define EINTR            4      /* Interrupted system call */
#define EAGAIN          11      /* Try again */
#define ENOMEM          12      /* Out of memory */
#define EINVAL          22      /* Invalid argument */
/* till this */

#ifdef __KERNEL__


now we can compile install it.

root@epia:~/sources/uni/libxvmc# make
root@epia:~/sources/uni/libxvmc#make install

unichrome

I'm still struggling to compile the unichrome driver. It will throw a lot of exceptions when compiling.

mplayer

I also can't compile mplayer with xvmc support.

 

Any hints are welcome just mail me unichrome_AT_held-im-ruhestand.de