Via CN400 and Linux
From RC-Autopilot Wiki
Contents |
Getting Linux to run with the Via Unichrome Pro CN400 Chipset
After about a week of searching the net, reading all sorts of different approaches to the same problem, I feel I'm maybe about halfway there. And since I fear I won't be able to reconstruct everything I finally did to get it to work after 2 weeks, I decided to start my HOWTO (which will be a documentation of trials, errors, frustration, confusion and failures until I finally get it working) in the middle.
Also, I just installed this cool Wiki system and want to learn how to use it in the process.
Arnolde 13:49, 30 December 2005 (CET)
Update: I'm almost there :-) Still working on wireless LAN and today I'll try another CF boot image. Arnolde 12:31, 5 January 2006 (CET)
The Goal
My goal is to get a small (maybe around 16MB) configuration of Gentoo Linux booting off a 256MB w:CompactFlash card on a small mainboard (max ITX size, or better Nano-ITX or PC104) with 30 minutes of XVID(MPEG4) video (which is 240MB at 8MB/min or 1Mbps bitrate) on the CF-card which is played back continuously on a monitor connected to the onboard VGA port. Using a wireless network adapter it should regularly sync it's video file directory with a master copy on a server whenever wireless Internet access is available. Since I do not need X (windows) to just playback videos fullscreen, I'd like to use framebuffer mode if possible. I should think that is easier, faster and more effiecient than using X. I'm not sure yet, though, most people want to use X so there may be more sources of knowledge there.
Different Approaches
What makes things to me (not quite Linux novice anymore, but far from guru) very confusing, is that there seems to be lots of different approaches to this problem, although many people seem to be working on it. Obviously almost everyone running Linux on a mini mainboard with mpeg2 hardware acceleration would want to use it. Most people on the forums seem just as confused as I am by the many different approaches. Now before I start editing existing Wiki's (which would only add to the confusion since I cant be of any help yet myself) I'll write up all my experience here, and hopefully find time to destill the successful method later.
What Finally Worked
Today I got it running and can watch (almost) fullscreen mpeg2 accelerated DVD videos on my machine :-) Now I will try to document how I got there and what is still happening. Before I forget the main problem: BadAccess or BadValue when starting mplayer or xine was caused by missing "System V IPC" support in the kernel. Unfortunately that had been disabled all the time.
32" Flatscreen TV
I also went right out and got a 32" LCD TV to play with. I'll handle it carefully so I can take it back next week if I dont want to keep it :-)
Here is what xorg.log says about my new TV (Medion/Tevion MD31132) connected to the VGA interface via the TV's DVI plug:
(II) VIA(0): Manufacturer: MED Model: c8bb Serial#: 0 (II) VIA(0): Year: 2005 Week: 34 (II) VIA(0): EDID Version: 1.3 (II) VIA(0): Digital Display Input (II) VIA(0): Max H-Image Size [cm]: horiz.: 71 vert.: 40 (II) VIA(0): Gamma: 2.20 (II) VIA(0): No DPMS capabilities specified; RGB/Color Display (II) VIA(0): First detailed timing is preferred mode (II) VIA(0): redX: 0.652 redY: 0.332 greenX: 0.270 greenY: 0.589 (II) VIA(0): blueX: 0.141 blueY: 0.068 whiteX: 0.285 whiteY: 0.293 (II) VIA(0): Supported VESA Video Modes: (II) VIA(0): 720x400@70Hz (II) VIA(0): 640x480@60Hz (II) VIA(0): 800x600@60Hz (II) VIA(0): 1024x768@60Hz (II) VIA(0): Manufacturer's mask: 0 (II) VIA(0): Supported Future Video Modes: (II) VIA(0): #0: hsize: 1280 vsize 1024 refresh: 60 vid: 32897 (II) VIA(0): #1: hsize: 1280 vsize 720 refresh: 60 vid: 49281 (II) VIA(0): #2: hsize: 1368 vsize 769 refresh: 60 vid: 49292 (II) VIA(0): Supported additional Video Mode: (II) VIA(0): clock: 85.1 MHz Image Size: 709 x 399 mm (II) VIA(0): h_active: 1366 h_sync: 1446 h_sync_end 1502 h_blank_end 1782 h_border: 0 (II) VIA(0): v_active: 768 v_sync: 771 v_sync_end 776 v_blanking: 798 v_border: 0 (II) VIA(0): Supported additional Video Mode: (II) VIA(0): clock: 79.5 MHz Image Size: 709 x 399 mm (II) VIA(0): h_active: 1280 h_sync: 1352 h_sync_end 1480 h_blank_end 1664 h_border: 0 (II) VIA(0): v_active: 768 v_sync: 771 v_sync_end 778 v_blanking: 798 v_border: 0 (II) VIA(0): Monitor name: Medion LCD32 (II) VIA(0): Ranges: V min: 50 V max: 60 Hz, H min: 28 H max: 65 kHz, PixClock max 80 MHz (II) VIA(0): I2C device "I2C bus 3:VT162x" registered at address 0x40. (--) VIA(0): Detected VIA Technologies VT1622A/VT1623 TV Encoder (--) VIA(0): VT162x: Nothing connected.
Here is my Monitor section of xorg.conf: (only one modeline uncommented rigt now because I forgot how to switch resoluions at the moment, but several of the others work too)
Section "Monitor"
Identifier "FlatscreenTV"
VendorName "Medion"
ModelName "MD31132"
HorizSync 31.5 - 64
VertRefresh 60 - 60
# Original visible dimensions
# DisplaySize 711 401
DisplaySize 400 300
Modeline "1280x720@60" 73.78 1280 1312 1592 1624 720 735 742 757
# ModeLine "720x480" 26.7 720 736 808 896 480 481 484 497
# ModeLine "720x576" 32.7 720 744 816 912 576 577 580 597
# ModeLine "848x480" 31.5 848 864 952 1056 480 481 484 497
# ModeLine "856x480" 31.7 856 872 960 1064 480 481 484 497
# ModeLine "1024x512" 41.3 1024 1056 1160 1296 512 513 516 531
# ModeLine "1280x768" 80.1 1280 1344 1480 1680 768 769 772 795
# ModeLine "1440x1050" 126.2 1440 1536 1688 1936 1050 1051 1054 1087
EndSection
With xrandr you can play around with the available (configured) video modes while X is running:
# xrandr -q SZ: Pixels Physical Refresh *0 1280 x 1024 ( 401mm x 302mm ) *60 1 1280 x 960 ( 401mm x 302mm ) 60 2 1280 x 768 ( 401mm x 302mm ) 60 3 1024 x 768 ( 401mm x 302mm ) 60 4 1024 x 512 ( 401mm x 302mm ) 60 5 800 x 600 ( 401mm x 302mm ) 60 6 720 x 576 ( 401mm x 302mm ) 60 7 640 x 480 ( 401mm x 302mm ) 60
And set it with -s <number>. When I set it to "2" I get the desired aspect ratio (the xclock is round :-) but the TV reports 1366x768@60Hz for some reason. Oh well, just so it looks ok... Now I still need to find out how to make Xorg select this mode by default when starting up.
Booting with Splash Screen
Still having a little trouble with the fbsplash. This line (in my grub.conf) sets the vga mode correctly, but no splash during booting:
kernel /boot/vmlinuz root=/dev/hda2 video=vesafb:ywrap,mtrr vga=792 splash=theme:emergence CONSOLE=/dev/tty1
With this version it doesnt do anything I want (no splash (not even a trace of it), and no vga mode setting):
kernel /boot/vmlinuz root=/dev/hda2 video=vesafb:1024x768-32@60 splash=theme:emergence quiet CONSOLE=/dev/tty1
The I found out a few things:
- With my Epia mainboard, I had problems with the vesa-tng driver (in the kernel settings), this usually gave me garbled text all over the screen when booting. Using the non-tng vesa driver worked better.
- It's not necessary to select the VGA16 driver if you're using Vesa.
- When using the Vesa (not tng) driver, the parameter "video=vesafb:1024x768-32@60" is non functional, so it can be left out. The parameter vga=792 (=1024x768-24@60) IS necessary, this is what actually changes the display mode.
- And the most important thing, which really frustrated me while debugging: The splash= parameter must include either verbose or silent or the splash will not be activated at all!!! No error message, no comment, nothing, it just acts as if you didnt have splash installed at all.
title=Gentoo Newest Test Kernel root (hd0,1) kernel /boot/vmlinuz root=/dev/hda2 vga=792 splash=silent,fadein,theme:emergence quiet CONSOLE=/dev/tty1 initrd /boot/fbsplash-emergence-1024x768
This works perfectly. The only drawback is, I have a USB keyboard which is enabled by loading a module, so pressing F2 doesnt work until halfway through. Also pressing F1 to go back to silent mode just prints "A[[[" or something on the screen and doesnt switch back. The former can of course be fixed by building the USB+keyboard support into the kernel instead of as a module.
Booting from CF Card
mkdir /mnt/tinygentoo echo "sys-apps/baselayout-lite -*" >> /etc/portage/package.keywords USE="make-symlinks minimal" ROOT=/tinygentoo emerge -av baselayout-lite uclibc busybox
(work still in progress) Arnolde 11:08, 7 January 2006 (CET)
At the moment I have the CF card in the IDE1 slot (HD in IDE0) and boot grub off the HD. If I enter a test section in the grub.conf to boot off the CF card instead:
title=Gentoo CF Test (bzImage 2.4) root (hd1,0) kernel /boot/bzImage root=/dev/hdc1 vga=792
Then it boots the kernel, and I can actually login and move around. No network yet though.
Installing minimal Xorg-server
Unfortunately we need X support just to play videos, because the only working CN400 drivers with mpeg acceleration are for X. We do not need any X aplications, fonts, window managers, etc. The standard "emerge xorg-server" would do all this: (cursive packages I'm sure we dont need, bold packages we do need.
[ebuild N ] x11-misc/util-macros-1.0.1 0 kB [ebuild N ] x11-proto/kbproto-1.0.2 0 kB [ebuild N ] x11-proto/xextproto-7.0.2 0 kB (libX11) [ebuild N ] x11-proto/xproto-7.0.4 0 kB (libX11) [ebuild N ] x11-proto/xf86bigfontproto-1.1.2 0 kB [ebuild N ] x11-proto/inputproto-1.3.2 0 kB [ebuild N ] x11-libs/libXau-1.0.0 0 kB (libX11) [ebuild N ] x11-proto/bigreqsproto-1.0.2 0 kB (libX11) [ebuild N ] x11-libs/libXdmcp-1.0.0 0 kB (libX11) [ebuild N ] x11-proto/xcmiscproto-1.1.2 0 kB (libX11) [ebuild N ] x11-libs/xtrans-1.0.0 0 kB (libX11) [ebuild N ] x11-libs/libX11-1.0.0 -ipv6 0 kB (xorg-server) [ebuild N ] x11-libs/libXext-1.0.0 0 kB [ebuild N ] x11-proto/xf86miscproto-0.9.2 0 kB [ebuild N ] x11-libs/libXxf86misc-1.0.0 0 kB [ebuild N ] x11-libs/liblbxutil-1.0.0 0 kB (xorg-server) [ebuild N ] x11-proto/compositeproto-0.2.2 0 kB [ebuild N ] x11-proto/renderproto-0.9.2 0 kB [ebuild N ] x11-libs/libXrender-0.9.0.2 0 kB [ebuild N ] x11-proto/damageproto-1.0.3 0 kB [ebuild N ] x11-proto/xf86dgaproto-2.0.2 0 kB [ebuild N ] x11-proto/videoproto-2.2.2 0 kB [ebuild N ] x11-libs/libICE-1.0.0 -ipv6 0 kB [ebuild N ] x11-libs/libSM-1.0.0 -ipv6 0 kB [ebuild N ] x11-libs/libXt-1.0.0 0 kB [ebuild N ] x11-libs/libXmu-1.0.0 -ipv6 0 kB [ebuild N ] x11-libs/libXpm-3.5.4.2 0 kB [ebuild N ] x11-libs/libXaw-1.0.1 -xprint 0 kB [ebuild N ] x11-proto/trapproto-3.4.3 0 kB [ebuild N ] x11-proto/scrnsaverproto-1.0.2 0 kB [ebuild N ] x11-proto/xineramaproto-1.1.2 0 kB [ebuild N ] app-admin/eselect-1.0_rc2 -bash-completion -doc 0 kB [ebuild N ] app-admin/eselect-opengl-1.0.3 0 kB [ebuild N ] x11-apps/rgb-1.0.0 0 kB [ebuild N ] x11-apps/iceauth-1.0.1 0 kB [ebuild N ] x11-proto/fontsproto-2.0.2 0 kB [ebuild N ] x11-proto/xf86rushproto-1.1.2 0 kB [ebuild N ] media-libs/freetype-2.1.9-r1 -bindist -doc +zlib 0 kB [ebuild N ] x11-libs/libfontenc-1.0.1 0 kB [ebuild N ] x11-apps/mkfontscale-1.0.1 0 kB [ebuild N ] media-fonts/encodings-1.0.0 0 kB [ebuild N ] x11-proto/fontcacheproto-0.1.2 0 kB [ebuild N ] x11-libs/libXfont-1.0.0 -ipv6 0 kB [ebuild N ] x11-apps/bdftopcf-1.0.0 0 kB [ebuild N ] media-fonts/font-util-1.0.0 0 kB [ebuild N ] x11-apps/mkfontdir-1.0.1 0 kB [ebuild N ] media-fonts/font-misc-misc-1.0.0 (-nls) 0 kB [ebuild N ] media-fonts/font-alias-1.0.1 0 kB [ebuild N ] x11-libs/libxkbfile-1.0.1 0 kB [ebuild N ] x11-libs/libxkbui-1.0.1 0 kB [ebuild N ] media-fonts/font-cursor-misc-1.0.0 (-nls) 0 kB [ebuild N ] x11-proto/glproto-1.4.3 0 kB (xorg-server) [ebuild N ] x11-proto/xf86vidmodeproto-2.2.2 0 kB [ebuild N ] x11-libs/libXxf86vm-1.0.0 0 kB [ebuild N ] x11-libs/libXi-1.0.0 0 kB [ebuild N ] x11-misc/makedepend-1.0.0 0 kB [ebuild N ] x11-libs/libdrm-2.0 0 kB (xorg-server) [ebuild N ] media-libs/mesa-6.4.1-r1 -motif 0 kB [ebuild N ] x11-proto/evieext-1.0.2 0 kB [ebuild N ] x11-apps/xauth-1.0.1 -ipv6 0 kB [ebuild N ] x11-misc/xbitmaps-1.0.1 0 kB [ebuild N ] x11-apps/xkbcomp-1.0.1 0 kB [ebuild N ] x11-misc/xkbdata-1.0.1 0 kB [ebuild N ] x11-proto/resourceproto-1.0.2 0 kB [ebuild N ] x11-proto/xf86driproto-2.0.3 0 kB (xorg-server) [ebuild N ] x11-proto/recordproto-1.13.2 0 kB [ebuild N ] app-arch/rpm2targz-9.0-r3 0 kB [ebuild N ] sys-libs/libutempter-1.1.2.1 21 kB [ebuild N ] media-libs/fontconfig-2.2.3 0 kB [ebuild N ] x11-libs/libXft-2.1.8.2 0 kB [ebuild N ] x11-terms/xterm-204 -Xaw3d -toolbar -truetype -unicode 0 kB [ebuild N ] x11-apps/xrdb-1.0.1 0 kB [ebuild N ] x11-wm/twm-1.0.1 0 kB [ebuild N ] x11-apps/xclock-1.0.1 -xprint 0 kB [ebuild N ] x11-apps/xinit-1.0.1 0 kB [ebuild N ] x11-proto/fixesproto-3.0.2 0 kB [ebuild N ] x11-proto/randrproto-1.1.2 0 kB [ebuild N ] x11-base/xorg-server-1.0.1-r1 +dri -ipv6 +minimal -xprint 0 kB
So we try:
emerge -avO xorg-server
(-O means not to emerge any dependancies, just the plain package.) During configure it complains about a missing pkg-config script, so we install:
emerge -av pkgconfig
when retrying, we get:
checking for XLIB... configure: error: Package requirements (x11) were not met: No package 'x11' found
tried this:
# XLIB_CFLAGS='-Os -pipe -march=i686 -fomit-frame-pointer -msse -mmmx -mfpmath=sse -m3dnow' # XLIB_LIBS=/usr/lib/xserver # export XLIB_CFLAGS # export XLIB_LIBS
now it complains about missing libx-util...
emerge -avO bigreqsproto xproto xextproto xtrans libXau xcmiscproto libX11 liblbxutil xorg-server
The Gentoo Unichrome HOWTO
http://gentoo-wiki.com/Unichrome This short summary makes it sound easy. Well, here's what I did:
If you have linux kernel version 2.6.13 or latter, just go to Device Drivers --> Character Devices, turn on agpgart, via_agp, drm, and unichrome, and compile the whole thing. You may now proceed to X, no need to worry about x11-drm.
I'm using Kernel 2.6.14-gentoo-r5 so I'm lucky. I activated all those modules, it compiled ok, so far so good.
The current masked version of xorg-x11 has all the necessary drivers. This version is snapshot of the soon to be release xorg-x11 6.9 / 7.0.
Followed the instructions there, unmasked xorg-x11-6.8.99, emerged it (took a bloody 5 hours!), so far so good.
The latest xine-lib already has unichrome support.
emerged xine-lib (get me version 1.1.1), that worked too.
But here is where the music ends for me. Then he says You need to enable an experimental option in the xine config file. The details can be found here (link to sourceforge.net) but there is only described what to do on a manually installed xine. Where do I set the mentioned options since I just "emerged" xine-lib instead of compiling it myself?
5 days later: Second Clean Try
After working at this for 5 days, I'm probably messed up my system beyond repair. So I decided to start fom scratch in a new chroot and see how far I can get with standard, stable, released, gentoo packages, and try to not use third-party software at first.
mkdir /mnt/niceclean cd /mnt/niceclean tar xjpf stage3-i686-2005.1-r1.tar.bz2 cp -L /etc/resolv.conf /mnt/niceclean/etc mount -o bind /usr/portage /mnt/niceclean/usr/portage (this is what I really should have done, actually I copied the whold thing (450MB)) mount -t proc none /mnt/niceclean/proc chroot /mnt/niceclean/ /bin/bash env-update && source /etc/profile
| File: /etc/make.conf |
CFLAGS="-mcpu=i686 -Os -pipe -fomit-frame-pointer -msse -mmmx -mfpmath=sse"
CHOST="i686-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
GENTOO_MIRRORS="http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://pandemonium.tiscali.de/pub/gentoo/"
USE="-fortran -motif -gnome -gtk -kde -qt -arts -xml2 -berkdb"
USE="$USE alsa directfb divx4linux dri drm fbcon ffmpeg flash mpeg4"
USE="$USE minimal mplayer mmx xv xvid cle266 xvmc xxmc unichrome"
FEATURES="ccache"
CCACHE_SIZE="1G"
VIDEO_CARDS="via"
ALSA_CARDS="via82xx"
PORTDIR_OVERLAY=/usr/local/portage
# emerge -a =xorg-x11-6.8.99.15-r4 These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild N ] media-libs/libpng-1.2.8 [ebuild N ] x11-base/opengl-update-2.2.1 [ebuild N ] media-libs/freetype-2.1.9-r1 [ebuild N ] media-libs/fontconfig-2.2.3 [ebuild N ] x11-apps/ttmkfdir-3.0.9-r3 [ebuild N ] x11-base/xorg-x11-6.8.99.15-r4 [ebuild N ] app-arch/rpm2targz-9.0-r3 [ebuild N ] sys-apps/utempter-0.5.5.6 [ebuild N ] x11-terms/xterm-204 Do you want me to merge these packages? [Yes/No] y
hours later, x is finally installed. (i really wish i could do without X alltogether)
After Xorg -configure and then configuring my USB-mouse (chance /dev/mouse to /dev/input/mice in xorg.config) I can run X, and it finds and uses the via driver.
But running mplayer -vo xv gives me a BadAccess error, and -vo -xvmc just says "can't open selected output device". sigh...
So basically I'm back where I was yesterday with my first system.
Unichrome Project
Discussion threads on gentoo.org
http://forums.gentoo.org/viewtopic-t-361352-start-0-postdays-0-postorder-asc-highlight-.html
http://forums.gentoo.org/viewtopic-t-350396.html
Hi! I'm shocked how cool this wesite is!
very mature ladies | free nude granny fuck boy | granny pussy | mature porn thumbs
directfb.org
viaarena.com
Lots of people complain about Via boasting about providing open-source Linux drivers, but only supporting a few distributions, and not providing source (or even working drivers at all) for all the features (like the mpeg4 hardware acceleration on the CN400). Anyway, most of the forum talk is from September 2005.
Via Framebuffer Console Driver October 04, 2005
I found this file: http://www.viaarena.com/Driver/linux-fbdev-kernel-bin_20050726.tgz
Building and loading viafb device driver for Linux kernel 2.6 (see readme.txt)
- (first restore the original contents of the linux/drivers/char/drm directory if you messed with it while trying to get the December 15th drivers to compile) (that's not actually in the readme ;-)
- Building fbcon console module: cd to /usr/src/linux, make menuconfig, -> Device Drivers->Graphics support->Console display driver support-> <M> Framebuffer Console support (make sure to use Module), exit, make, make modules_install install
- Building viafb as a module: Copy all the files from the package into a new directory /usr/src/linux/viafb, cd into it and then "make" and then "make install"
- After reboot, modprobe viafb and then modprobe fbcon
So far so good, I'm trying that now...
- emerge fbset
reboot
# modprobe viafb mode=720x576 bpp=16 refresh=60 accel=1 # modprobe fbcon segmentation fault
argh...
Via DRM Driver December 15, 2005
I found this file released on December 15, 2005: http://www.viaarena.com/Driver/p4m800ce-p4m800pro-cn-clexf40063-kernel-src_20051215.zip
I decided to try my luck, as the src/ReleaseNote.txt says:
VIA S3 UniChrome Linux Display Driver
Source Code Compiling Instructions
December 15, 2005
Copyright (C) 2002-2005 VIA Technologies, INC.
1. Summary
This document describes how to compile the VIA UniChrome family Linux display
driver source code on Fedora Core Linux 4. This software package supports
2D, 3D, hardware video mpeg2/4 and hardware video overlay.
The information and the source code files are provided "AS IS"
without guarantee of any kind.
2. Set up environment
(1) Xorg source code:
Fedora Core Linux 4.0: xorg-x11-6.8.2-31.src.rpm
(2) VIA UniChrome family display driver version: 4.1.0063.
The driver source code comprises files in three directories as described below:
via (C include files, MPEG2 dynamic-link object code, XServer and V4L driver source files)
DRM* (VIA DRM files for kernel or XFree86/Xorg)
DRM-kernel_agp (Kernel AGP patch files for VIA AGP BUS)
DRI-Xorg_bin (VIA DRI binary codes)
Utility (VIA/S3G TV display utility)
Note: After installing OS, using command "rpm -qa | grep gcc" to verify
the following packages have been installed on the system.
Fedora Core Linux 4.0 dependency packages:
bash-3.0-31.i386.rpm
bison-2.0-6.i386.rpm
cpp-4.0.0-8.i386.rpm
expat-devel-1.95.8-6.i386.rpm
flex-2.5.4a-34.i386.rpm
fontconfig-devel-2.2.3-13.i386.rpm
freetype-devel-2.1.9-2.i386.rpm
gcc-4.0.0-8.i386.rpm
glibc-devel-2.3.5-10.i386.rpm
kernel-2.6.11-1.1369_FC4.src.rpm
libstdc++4.0.0-8.i386.rpm
libpng-devel-1.2.8-2.i386.rpm
ncurses-devel-5.4-17.i386.rpm
pam-devel-0.79-8.i386.rpm
rpm-4.4.1-21.i386.rpm
rpm-build-4.4.1-21.i386.rpm
xorg-x11-devel-6.8.2-31.i386.rpm
xorg-x11-libs-6.8.2-31.i386.rpm
zlib-devel-1.2.2.2-3.i386.rpm
Now since I'm using gentoo and not fedora, the procedure will be a little different, so I'll try to make my way through. What I did:
- Install & Build the xorg-6.8.99.15 source (actually I already had this because I had already followed the instructions in the Gentoo Unichrome HOWTO). I just emerged the xorg and it landed... uh... dunno :-) let's see if i need to know later.
- Prepare kernel source: To me this means making a backup of the kernel sources I have (gentoo-source 2.6.14) because the next step involves messing with it.
- In the P4M800CE-P4M800Pro-CN-CLEXF40063-kernel-src_20051215/src/ directory I found a subdir named DRM_26X, in it a Readme.bak which instructs to copy the contents of that directory to /usr/src/linux-(version)/drivers/char/drm. I checked that that looked reasonable, and decided to try it.
- Now go to /usr/src/linux and do make menuconfig. Lo and behold, here are some new options under Character Devices:
[*] Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)
< > 3dfx Banshee/Voodoo3+ (NEW)
< > 3dlabs GMX 2000 (NEW)
< > ATI Rage 128 (NEW)
<M> VIA CLE266/KM400/KM800/PM800
< > ATI Radeon (NEW)
< > Matrox g200/g400 (NEW)
< > SiS video cards (NEW)
So I'll try selecting them this way, and make the kernel now, and see how far I get... Arnolde 22:08, 30 December 2005 (CET)
Well, didn't take long :-| got this when compiling:
CC [M] drivers/char/drm/via_drv.o drivers/char/drm/via_drv.c:49:22: drm_auth.h: No such file or directory drivers/char/drm/via_drv.c:50:28: drm_agpsupport.h: No such file or directory drivers/char/drm/via_drv.c:51:22: drm_bufs.h: No such file or directory drivers/char/drm/via_drv.c:52:25: drm_context.h: No such file or directory drivers/char/drm/via_drv.c:53:21: drm_dma.h: No such file or directory drivers/char/drm/via_drv.c:54:26: drm_drawable.h: No such file or directory drivers/char/drm/via_drv.c:55:21: drm_drv.h: No such file or directory drivers/char/drm/via_drv.c:56:22: drm_fops.h: No such file or directory drivers/char/drm/via_drv.c:57:22: drm_init.h: No such file or directory drivers/char/drm/via_drv.c:58:23: drm_ioctl.h: No such file or directory drivers/char/drm/via_drv.c:60:22: drm_lock.h: No such file or directory In file included from drivers/char/drm/via_drv.c:61: drivers/char/drm/drm_memory.h:65: error: redefinition of `drm_lookup_map' drivers/char/drm/drm_memory.h:65: error: `drm_lookup_map' previously defined here drivers/char/drm/drm_memory.h:83: error: redefinition of `agp_remap' drivers/char/drm/drm_memory.h:83: error: `agp_remap' previously defined here drivers/char/drm/drm_memory.h:123: error: redefinition of `drm_follow_page' drivers/char/drm/drm_memory.h:123: error: `drm_follow_page' previously defined here drivers/char/drm/drm_memory.h:151: error: redefinition of `drm_ioremap' drivers/char/drm/drm_memory.h:151: error: `drm_ioremap' previously defined here drivers/char/drm/drm_memory.h:163: error: redefinition of `drm_ioremap_nocache' drivers/char/drm/drm_memory.h:163: error: `drm_ioremap_nocache' previously defined here drivers/char/drm/drm_memory.h:174: error: redefinition of `drm_ioremapfree' drivers/char/drm/drm_memory.h:174: error: `drm_ioremapfree' previously defined here drivers/char/drm/via_drv.c:62:22: drm_proc.h: No such file or directory drivers/char/drm/via_drv.c:63:20: drm_vm.h: No such file or directory drivers/char/drm/via_drv.c:64:22: drm_stub.h: No such file or directory make[3]: *** [drivers/char/drm/via_drv.o] Error 1 make[2]: *** [drivers/char/drm] Error 2 make[1]: *** [drivers/char] Error 2 make: *** [drivers] Error 2
So I'll see if I can find those missing files... Ok, seems as though they reference files from the xorg source. So I'll follow their instructions a little more closely:
- place your kernel 2.6.14 source at /usr/src/linux
- place your xorg-x11 >= 6.8.2.31 source at /usr/src/xc
- copy the contents of directory P4M800CE-P4M800Pro-CN-CLEXF40063-kernel-src_20051215/src/DRM_for_FC4 to /usr/src/xc/extras/drm/linux
- copy the contents of directory P4M800CE-P4M800Pro-CN-CLEXF40063-kernel-src_20051215/src/DRM_26X to /usr/src/linux/drivers/char/drm
- in the P4M800CE-P4M800Pro-CN-CLEXF40063-kernel-src_20051215/src directory, run ./makedriver drm
--> still gives me loads of file not found errors (see above) and also more errors from the stupid script, although the files drm_auth.h etc. are right there in /usr/src/xc/.... where they are supposed to be.
Stepstone
As I'm clicking around collecting all these infos, I suddenly got a small success: Apparently I now have X working with the Via Unichrome display driver (at least it starts X at all, which is new, until an hour ago I was getting "no screen found" or something like that. So here is a snapshot of what I have right now, before I mess it up again:
startx output:
infoscreen ~ # startx hostname: Unknown host xauth: creating new authority file /root/.serverauth.23345 This is a pre-release version of the The X.Org Foundation X11. It is not supported in any way. Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/. Select the "xorg" product for bugs you find in this release. Before reporting bugs in pre-release versions please check the latest version in the The X.Org Foundation "monolithic tree" CVS repository hosted at http://www.freedesktop.org/Software/xorg/ X Window System Version 6.8.99.15 Release Date: 16 July 2005 + cvs X Protocol Version 11, Revision 0, Release 6.8.99.15 Build Operating System: Linux 2.6.14-gentoo-r5 i686 [ELF] Current Operating System: Linux infoscreen 2.6.14-gentoo-r5 #3 PREEMPT Sat Dec 31 12:56:40 Local time zone must be set--see i686 Build Date: 31 December 2005 Before reporting problems, check http://wiki.X.Org to make sure that you have the latest version. Module Loader present Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: "/var/log/Xorg.0.log", Time: Sat Dec 31 16:08:07 2005 (==) Using config file: "/root/xorg.conf" (WW) ****INVALID MEM ALLOCATION**** b: 0xe4000000 e: 0xe8000000 correcting (EE) VIA(0): [drm] drmAgpAcquire failed 1023
And I get a screen with some windows and my mouse even works.
Here is my lsmod output:
Module Size Used by via_agp 7392 1 via 37920 0 drm 65140 1 via agpgart 29576 2 via_agp,drm uhci_hcd 31340 0 snd_pcm_oss 48288 0 snd_mixer_oss 17024 1 snd_pcm_oss snd_via82xx 22272 0 snd_ac97_codec 91208 1 snd_via82xx snd_pcm 80232 3 snd_pcm_oss,snd_via82xx,snd_ac97_codec snd_timer 21412 1 snd_pcm snd_ac97_bus 1760 1 snd_ac97_codec snd_page_alloc 8456 2 snd_via82xx,snd_pcm snd_mpu401_uart 6176 1 snd_via82xx snd_rawmidi 19936 1 snd_mpu401_uart snd 44356 8 snd_pcm_oss,snd_mixer_oss,snd_via82xx,snd_ac97_codec,snd_pcm,snd_timer,snd_mpu401_uart,snd_rawmidi soundcore 7584 1 snd ehci_hcd 42792 0 via_rhine 19396 0
Here is my lsusb output:
00:00.0 Host bridge: VIA Technologies, Inc. CN400/PM880 Host Bridge 00:00.1 Host bridge: VIA Technologies, Inc. CN400/PM880 Host Bridge 00:00.2 Host bridge: VIA Technologies, Inc. CN400/PM880 Host Bridge 00:00.3 Host bridge: VIA Technologies, Inc. CN400/PM880 Host Bridge 00:00.4 Host bridge: VIA Technologies, Inc. CN400/PM880 Host Bridge 00:00.7 Host bridge: VIA Technologies, Inc. CN400/PM880 Host Bridge 00:01.0 PCI bridge: VIA Technologies, Inc. VT8237 PCI Bridge 00:0d.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev 80) 00:0f.0 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06) 00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81) 00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81) 00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81) 00:10.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81) 00:10.4 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 86) 00:11.0 ISA bridge: VIA Technologies, Inc. VT8237 ISA bridge [KT600/K8T800/K8T890 South] 00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60) 00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 78) 01:00.0 VGA compatible controller: VIA Technologies, Inc. S3 Unichrome Pro VGA Adapter (rev 02)
The last few lines of dmesg (when I inserted the modules agpgart,drm,via,via_agp):
[drm] Initialized drm 1.0.0 20040925 [drm] Initialized via 2.6.3 20050523 on minor 0: agpgart: Detected VIA PM800/PN800/PM880/PN880 chipset agpgart: AGP aperture is 32M @ 0xea000000
Now it's time to try playing a video:
# mplayer -vc ffmpeg12mc -vo xvmc 2005\,12\,26\ 14\,51\,18.mpg MPlayer dev-CVS-051230-01:02-3.3.5-20050130 (C) 2000-2005 MPlayer Team CPU: IDT/Centaur/VIA C3 Nehemiah (Family: 6, Stepping: 8) CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0 Compiled for x86 CPU with extensions: MMX MMX2 SSE Failed to open /dev/rtc: No such file or directory (it should be readable by the user.) Playing 2005,12,26 14,51,18.mpg. MPEG-PS file format detected. VIDEO: MPEG2 720x576 (aspect 2) 25.000 fps 15000.0 kbps (1875.0 kbyte/s) ========================================================================== Opening audio decoder: [mp3lib] MPEG layer-2, layer-3 AUDIO: 48000 Hz, 2 ch, s16le, 192.0 kbit/12.50% (ratio: 24000->192000) Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3) ========================================================================== Error opening/initializing the selected video_out (-vo) device. Exiting... (End of file)
Oh well... Next try:
# mplayer 2005\,12\,26\ 14\,51\,18.mpg MPlayer dev-CVS-051230-01:02-3.3.5-20050130 (C) 2000-2005 MPlayer Team CPU: IDT/Centaur/VIA C3 Nehemiah (Family: 6, Stepping: 8) CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0 Compiled for x86 CPU with extensions: MMX MMX2 SSE Failed to open /dev/rtc: No such file or directory (it should be readable by the user.) Playing 2005,12,26 14,51,18.mpg. MPEG-PS file format detected. VIDEO: MPEG2 720x576 (aspect 2) 25.000 fps 15000.0 kbps (1875.0 kbyte/s) ========================================================================== Opening audio decoder: [mp3lib] MPEG layer-2, layer-3 AUDIO: 48000 Hz, 2 ch, s16le, 192.0 kbit/12.50% (ratio: 24000->192000) Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3) ========================================================================== vo: couldn't open the X11 display ()! vo: couldn't open the X11 display ()! VO XOverlay need a subdriver [gl] using extended formats. Use -vo gl:nomanyfmts if playback fails. vo: couldn't open the X11 display ()! vo: couldn't open the X11 display ()! vo: couldn't open the X11 display ()! SDL: Initializing of SDL failed: No available video device. svgalib: Cannot open /dev/svga Is svgalib_helper module loaded?
Hmmm, the only line that looks like a hint there is VO XOverlay need a subdriver... And of course, the failure to open the X11 display. Hmmmm. Google again...
Ok, try it with xine:
# xine --video-driver xxmc --no-gui --no-logo 2005\,12\,26\ 14\,51\,18.mpg This is xine (X11 gui) - a free video player v0.99.3. (c) 2000-2004 The xine Team. Cannot open display
Well, that sure isnt helping. So whats the problem with my display? Okay, found on Google what helps:
export DISPLAY=:0.0
Now some things start to work:
# mplayer -vc ffmpeg12mc -vo xv VTS_01_1.VOB MPlayer dev-CVS-051230-01:02-3.3.5-20050130 (C) 2000-2005 MPlayer Team CPU: IDT/Centaur/VIA C3 Nehemiah (Family: 6, Stepping: 8) CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0 Compiled for x86 CPU with extensions: MMX MMX2 SSE Failed to open /dev/rtc: No such file or directory (it should be readable by the user.) Playing /mnt/smb/DVDs/A Knights Tale/VIDEO_TS/VTS_01_1.VOB. MPEG-PS file format detected. VIDEO: MPEG2 720x576 (aspect 3) 25.000 fps 9800.0 kbps (1225.0 kbyte/s) ========================================================================== Opening audio decoder: [liba52] AC3 decoding with liba52 Using SSE optimized IMDCT transform AC3: 5.1 (3f+2r+lfe) 48000 Hz 448.0 kbit/s Using MMX optimized resampler AUDIO: 48000 Hz, 2 ch, s16le, 448.0 kbit/29.17% (ratio: 56000->192000) Selected audio codec: [a52] afm: liba52 (AC3-liba52) ========================================================================== Forced video codec: ffmpeg12mc Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family Cannot find codec 'mpegvideo_xvmc' in libavcodec... VDecoder init failed :( Cannot find codec matching selected -vo and video format 0x10000002. Read DOCS/HTML/en/codecs.html! ========================================================================== Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??... AO: [oss] 48000Hz 2ch s16le (2 bytes per sample) Building audio filter chain for 48000Hz/2ch/s16le -> 48000Hz/2ch/s16le... Video: no video Starting playback...
That at least plays the audio, nothing happens on screen though.
# mplayer -vc ffmpeg12mc -vo xv dvb-s-sample.mpeg MPEG-PS file format detected. VIDEO: MPEG2 720x576 (aspect 2) 25.000 fps 15000.0 kbps (1875.0 kbyte/s) ========================================================================== Opening audio decoder: [mp3lib] MPEG layer-2, layer-3 AUDIO: 48000 Hz, 2 ch, s16le, 192.0 kbit/12.50% (ratio: 24000->192000) Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3) ========================================================================== Forced video codec: ffmpeg12mc Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family Cannot find codec 'mpegvideo_xvmc' in libavcodec... VDecoder init failed :( Cannot find codec matching selected -vo and video format 0x10000002. Read DOCS/HTML/en/codecs.html! ========================================================================== Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??... AO: [oss] 48000Hz 2ch s16le (2 bytes per sample) Building audio filter chain for 48000Hz/2ch/s16le -> 48000Hz/2ch/s16le... Video: no video Starting playback...
Same thing here, plays audio but no video.
# mplayer -vo xv VTS_01_1.VOB Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough VDec: vo config request - 720 x 576 (preferred colorspace: Mpeg PES) Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. Try adding the scale filter, e.g. -vf spp,scale instead of -vf spp. VDecoder init failed :( Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2-v0.4.0b Selected video codec: [mpeg12] vfm: libmpeg2 (MPEG-1 or 2 (libmpeg2)) ========================================================================== Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??... AO: [oss] 48000Hz 2ch s16le (2 bytes per sample) Building audio filter chain for 48000Hz/2ch/s16le -> 48000Hz/2ch/s16le... Starting playback... VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12) VDec: using Planar YV12 as output csp (no 0) Movie-Aspect is 1.78:1 - prescaling to correct movie aspect. VO: [xv] 720x576 => 1024x576 Planar YV12 X11 error: BadAccess (attempt to access private resource denied)
When X is running, this gives me an emtpy window frame to place with the mouse, but after clicking it crashes (see last line) with this message:
MPlayer interrupted by signal 6 in module: decode_video - MPlayer crashed. This shouldn't happen. It can be a bug in the MPlayer code _or_ in your drivers _or_ in your gcc version. If you think it's MPlayer's fault, please read DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and won't help unless you provide this information when reporting a possible bug.
If X isnt running it says:
vo: couldn't open the X11 display (:0.0)! Error opening/initializing the selected video_out (-vo) device.
Trying my old setup (with no acceleration) again:
# mplayer -vo svga -vf scale=640:480 dvb-s-sample.mpeg Failed to open /dev/rtc: No such file or directory (it should be readable by the user.) Playing dvb-s-sample.mpg. MPEG-PS file format detected. VIDEO: MPEG2 720x576 (aspect 2) 25.000 fps 15000.0 kbps (1875.0 kbyte/s) ========================================================================== Opening audio decoder: [mp3lib] MPEG layer-2, layer-3 AUDIO: 48000 Hz, 2 ch, s16le, 192.0 kbit/12.50% (ratio: 24000->192000) Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3) ========================================================================== [svgalib: allocated virtual console #7]
This does play, full screen, just as I want it... except of course very slowly and with 99% CPU. Let's try xine again:
# xine --video-driver xxmc --no-gui --no-logo 2005\,12\,26\ 14\,51\,18.mpg This is xine (X11 gui) - a free video player v0.99.3. (c) 2000-2004 The xine Team. Cannot open display
Hmm, X was not running, start it and try again:
# xine --video-driver xxmc --no-gui --no-logo 2005\,12\,26\ 14\,51\,18.mpg This is xine (X11 gui) - a free video player v0.99.3. (c) 2000-2004 The xine Team. X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 94 (X_CreateGlyphCursor) Value in failed request: 0x9a Serial number of failed request: 122 Current serial number in output stream: 142
Sigh. Running out of ides here... I think I'll stick to mplayer, at least i know that works (sort of).

