# Support for VIA EPIA M-Series

## cozmic

Anyone have experience with this hardware, like usb2/firewire/gfx and audio support using gentoo?

----------

## matt2413

^b as I'm interested in one of these too  :Smile: 

Matt

----------

## yngwin

The Dutch Linux Magazine recently had a review of the Epia M9000 and wrote that it's a nice board, that there are linux drivers, but VIA seems confused about open source. (They used Alan Cox' code for their V4L driver, but didn't publish the source code.) There also is a Linux support forum.

----------

## lazarusrat

The audio works fine for me with Alsa, though I'm just doing cheap-speaker stereo. Can't say anything about the 5.1 type stuff.

The video is a pain. There are four different drivers available from Via. Two require kernel modules, two don't. They're all binary. The two that require kernel modules supposedly have better performance for things like mplayer or watching DVDs. The others are pretty much just enough to give you X. For the kernel module ones, you've got to compile your kernel with gcc 2.9x and manually edit the symbols in the drivers so that they match your /proc/ksysms. For the other ("slim") drivers, good luck getting them to work under Gentoo. I've yet to see a successful report of anyone doing so.

I don't know about USB 2.0 or firewire. The board has 2 USB ports on the backplane, and headers for 2 more. I believe the headered ones are 2.0, while the ones on the backplane are not, but don't quote me on that. The backplane ones work fine, I've had a joypad, an HP printer, a digital camera, and a Zaurus cradle in them without any problems. I've never hooked the USB or firewire headers up to anything.

For video, you can also use the xfree vesa driver and get sucky performance and low resolutions.

Another forum to check out is http://linitx.org.

----------

## henke

See this  thread at the Via support forums for more info

I have an EPIA M6000. I'm not satisfied with the Linux support. 

Some people are having problems with usb 2.0. Last I heard the mantainer of the ehci module is not getting any documentation from Via so there is no telling when this will be fixed. (usb 1.1 seems to work fine.)

GCC can't optimize code for the Via processors since the required documentation has not been released to the developer community. 

Via supplies official binary drivers for Debian, RedHat and SuSE. I'm using the vesa graphics driver and it's pretty bad. I don't have the time right now to fiddle around with the binary driver. Of course no documentation has been released. There is a group at Via that is working on a new driver that will supposedly be open sourced. Don't know when (if? Damn I'm paranoid  :Sad:  ) that will happen since there has been no info released for a while

To quote the Cluetrain Manifesto

 *Quote:*   

> Most corporations, on the other hand, only know how to talk in the soothing, humorless monotone of the mission statement, marketing brochure, and your-call-is-important-to-us busy signal. Same old tone, same old lies. No wonder networked markets have no respect for companies unable or unwilling to speak as they do.

 

That sums it up nicely I think. Via claims they support Linux but talk is cheap. 

What me bitter? Nah  :Twisted Evil: 

----------

## henke

It seems I spoke to soon...

There is now support for the CLE266 graphics chipset in xfree CVS!  :Very Happy: 

I still say Via has a communication problem since this hasn't been reported by anyone at Via yet

----------

## lazarusrat

Well, a step in the right direction at any rate.

henke, have you had a chance to try it out yet?

This appears to be the newest version of the "slim" driver (released 3/21, which is the modification date of all the files in the .zip attachment in bugzilla), with source included this time.

Guess I know what I'll be doing tonight if I have time.   :Smile: 

----------

## henke

Nope, havn't tried it yet. I have reported it to the gentoo bugzilla though and the "bug" has been assigned  :Smile: 

----------

## lazarusrat

I just got this driver up and running.   :Very Happy: 

I didn't even try the binary, I'm sure it's exactly the same as the one you can get off Via's FTP site.

To compile the driver, here's what I did:

1. Download the .zip file from http://bugs.xfree86.org/cgi-bin/bugzilla/showattachment.cgi?attach_id=80  (likely renaming the file to something.zip)

2. Unzip the file.

3. In CLEX40024a-2D_src/src is a ReleaseNote.txt. Read this file. Most of the instructions are right on for Gentoo, except that some directory names are different. Where the file says /usr/src, make it /var/tmp/portage/xfree-your-version/work

4. Begin an emerge xfree, and stop it when it gets to actually compiling the source. (If you're emerging a different version than what you've currently got installed, you should probably let the emerge finish, then do this step again to make sure the driver's version will match up with X. I don't actually know if that would be a problem or not.) This way the directory is there with the xfree source as it would be installed.

5. Copy the via-s3g directory to /var/tmp/portage/xfree-whatever-version/xc/programs/Xserver/hw/xfree86/drivers (instead of the /usr/src/programs... the ReleaseNote.txt mentions)

6. On step 7 in the instructions, I used crlf -u instead of dos2unix. There are a lot of utilities to convert DOS crlf to *nix cr, just use one. I'm not 100% sure this is even necessary, but it doesn't hurt.

7. When running the make install in step 8, there will be lots of errors about header files not being found. I'm sure there's a better way to do this, but I just copied the missing header files into the directory (/var/tmp/portage/xfree-version/xc/programs/Xserver/hw/xfree86/drivers/via-s3g).

8. Eventually, when all the missing files are taken care of, the thing will build and install itself, and you can set up your XF86Config with driver "via."

I don't have any mpegs or divxs or anything to watch to tell how that goes. Watching an avi in mplayer, my processor is at about 40-50%. This is with AGP aperture and video memory both set to 32M in the BIOS.

glxgears gives the following:

448 frames in 5.0 seconds = 89.600 FPS

344 frames in 5.0 seconds = 68.800 FPS

430 frames in 5.0 seconds = 86.000 FPS

344 frames in 5.0 seconds = 68.800 FPS

430 frames in 6.0 seconds = 71.667 FPS

430 frames in 5.0 seconds = 86.000 FPS

But if you got this board for its 3D performance, you need to do better research.   :Wink: 

X takes about the same time to start up as it did with my nVidia (TNT2 I think), and things just look crisper to me. I haven't had much time to play around to notice any other kind of performance things. Window redraws are maybe a little slower. I don't personally care about videos or 3D that much, so I'm happy so far.

Oh, all this is at 1600x1200.

----------

## ac999

great help, got it working.

For the include files, I've modified the Makefile and add "-I/usr/X11R6/include/X11/ -I$(SERVERSRC)/hw/xfree86 -I$(SERVERSRC)/hw/xfree86/os-support/bu

s" to the INCLUDES var.

----------

## Are`awn

Seems that xfree 4.3.0-r2 has been unmasked and is considered stabled.  So I upgraded.  To my surprise via epia-m castlerock  support is included in this version..   so I ran xf86cfg, and I get:

```
XFree86 detected your mouse at device /dev/mouse.

Please check your config if the mouse is still not

operational, as by default XFree86 tries to autodetect

the protocol.

Your XF86Config file is /root/XF86Config.new

To test the server, run 'XFree86 -xf86config /root/XF86Config.new'

XFree86 Version 4.3.0

Release Date: 27 February 2003

X Protocol Version 11, Revision 0, Release 6.6

Build Operating System: Linux 2.5.67-mm3 i686 [ELF]

Build Date: 22 April 2003

        Before reporting problems, check http://www.XFree86.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/XFree86.8.log", Time: Tue Apr 22 20:47:24 2003

(++) Using config file: "/root/XF86Config.new"

Using vt 7

Symbol pVia from module /usr/X11R6/lib/modules/drivers/via_drv.o is unresolved!

Symbol pVia from module /usr/X11R6/lib/modules/drivers/via_drv.o is unresolved!

Symbol pVia from module /usr/X11R6/lib/modules/drivers/via_drv.o is unresolved!

Symbol pVia from module /usr/X11R6/lib/modules/drivers/via_drv.o is unresolved!

Symbol pVia from module /usr/X11R6/lib/modules/drivers/via_drv.o is unresolved!

Symbol pVia from module /usr/X11R6/lib/modules/drivers/via_drv.o is unresolved!

Symbol pVia from module /usr/X11R6/lib/modules/drivers/via_drv.o is unresolved!

Symbol pVia from module /usr/X11R6/lib/modules/drivers/via_drv.o is unresolved!

Symbol pVia from module /usr/X11R6/lib/modules/drivers/via_drv.o is unresolved!

Symbol pVia from module /usr/X11R6/lib/modules/drivers/via_drv.o is unresolved!

Symbol pVia from module /usr/X11R6/lib/modules/drivers/via_drv.o is unresolved!

Symbol pVia from module /usr/X11R6/lib/modules/drivers/via_drv.o is unresolved!

   *** If unresolved symbols were reported above, they might not

   *** be the reason for the server aborting.

Fatal server error:

Caught signal 11.  Server aborting

When reporting a problem related to a server crash, please send

the full server output, not just the last messages.

This can be found in the log file "/var/log/XFree86.8.log".

Please report problems to xfree86@xfree86.org.

Cannot connect to X server.

```

Any ideas on how to get this to work right or what I am missing ?

EDIT: forget all this, seems that this is just an old driver that I got from via's site...  oh well....  Guess it was just too much to hope for...

----------

## lazarusrat

I upgraded to 4.3.0-r2 a couple days ago. If you build the driver from the CVS source (http://cvsweb.xfree86.org/cvsweb/xc/programs/Xserver/hw/xfree86/drivers/via/) it should work.

Did the same things I did in the post above, with the original version of the driver source (what I believe is marked 1.1 in CVS). Haven't had any problems.

----------

## ml

Hm. Care to help me out with this?

I checked out the driver from xfree86.org and placed it in /var/tmp/portage/(xfree-version)/xc/programs/Xserver/hw/xfree86/drivers/via/ .

So what do I do next? I'd really like to get this driver working..

----------

## lazarusrat

http://bugs.xfree86.org/cgi-bin/bugzilla/show_bug.cgi?id=154 has a zip file in the second post with the first versions of the source files. It also includes a Readme.txt with build instructions. There are two or three files outside the via directory in the X source that need minor edits, that are explained in that Readme.

Assuming there haven't been earth-shattering changes in the CVS version since the original, the basic step at this point is to run 'make install'

The problem is that it's not going to find all the header files it needs. I haven't tried ac999's solution (a few posts up) but I don't see why it wouldn't work. Edit the makefile and add those directories to the list in INCLUDES = something something.

If for some reason that doesn't work, running make install will spit out a whole lot of errors. Among those are some file missing errors. Just do 'find /var/tmp/portage/xfree/version/xc -iname 'filename.h' to find each of the missing files, and copy them into the directory with all the via files.

Lather, rinse, and repeat, and eventually via_drv.o will build and stick itself with your other drivers.

Then just edit your XF86Config and change the device driver to "via".

Edit: I should point out that I'm using the first version of the source available (the source from that zip file in the bugzilla post), and not the current CVS stuff.

----------

## ml

Thanks for the quick reply :)

I managed to build it myself, somehow.

I took a makefile from one of the other drivers, replaced all other_driver.c-files to via_driver-files.

It complains about 2 unresolved externals when launching X, but it seems to work.

I'll post results when I've emerged some fancy WM. :)

Also, if anyone wants the via_drv.o I built, tell me where to upload it and I'll do so ASAP.

----------

## seemant

HI All,

I've added the VIA driver to xfree-4.3.0-r3

Please test and use bugzilla to report.

----------

## henke

Thanks Seemant  :Smile: 

I havn't gotten any problems with the new driver yet.

----------

## JohnBurton

The latest X driver seems to work but I can't get the sound to work. How have people got the sound to work on this board?

----------

## fuzzyfelt

Has anyone had this problem?

Using the latest Xfree ebuild (xfree-4.3.0-r3), everything's great except that when I try and play a DVD with mplayer or xine X crashes with very little error messages.

```

GetModeLine - scrn: 0 clock: 94500

GetModeLine - hdsp: 1024 hbeg: 1072 hend: 1168 httl: 1376

              vdsp: 768 vbeg: 769 vend: 772 vttl: 808 flags: 5

                                                                                

                                                                                

        This should not happen!

        An unresolved function was called!

                                                                                

Fatal server error:

```

This is about all thats interesting. Any ideas? 

I'm checking out the xfree cvs, ready to build that. Is this wise?

----------

## spiridon

Hi,

i filed a bug: Bug 22880

----------

## lazarusrat

Can't get through to bugzilla right now.

When I had the via_drv.o that I'd built off the original XFree CVS, mplayer worked just fine. Upgrading to xfree-4.3.0-r3 did indeed start causing these errors. I had a back-up of that original driver, and reinstalled it yesterday. Mplayer works again.

So, if mplayer is important enough to you, you can follow my instructions above using the first version of the drivers available in CVS (1.1), and it should work again.

And, honestly, I'm just assuming that http://bugs.xfree86.org/cgi-bin/bugzilla/showattachment.cgi?attach_id=80 is the same as CVS 1.1.

I'll add this to the bug report as soon as I can get through.

EDIT:

Just noticed that one of the files in CVS was changed two days ago (the rest have been the same for two months), so maybe this fixes some things? Don't have Gentoo in front of me right now, does anyone know if xfree-4.3.0-r3 pulls the latest CVS or if it's using a particular version?

----------

## fuzzyfelt

Hi,

 I'm pretty sure xfree-4.3.0-r3 uses a particular version. 

Also I tried to build from CSV at the weekend but the build was nackered elsewhere.

So I downloaded a snapshot from xfree86, can't remember which one, and that built ok. 

Mplayer works too!

----------

## Kento

[20:51:05] <seemant> actually if someone in here can do me a favour and mention on that thread that spyderous put xfree-4.3.99 into portage and people with via-epia stuffs in it, which will be removed from 4.3.0-r3

That's me, the sad little IRC-to-forums relayer...too bad I'm not automated  :Very Happy: 

----------

## second_exodous

Has anything changed since?  I run the xfree setup and can't seem to find the driver in the list of 17 possible.  What driver do I select, there isn't a CLE266 in the list.  On my main system I have a geforce 3 and had to edit the XF86Config, do I need to do that here?  What do I exactly change in it?

Thanx,

Stan

----------

## lazarusrat

Things are generally slowly floating toward better support, but there have been no real developments if you want "out-of-the box" solutions for Gentoo.

The name of the xfree driver is "via." Select "vesa" or something and then in the Device section of XF86Config change Driver to "via" instead.

----------

## second_exodous

Cool, worked.  How about TV out and audio?  Anyone got these working?

Well, I'm off to emerge kde, it's going as i'm typing(i'm on my ibook right now) oh boy.  600 mhz is hardly enough to install source, but it made my main computer work so much better than it did with redhat and mandrake.

Thanx,

Stan

----------

## lazarusrat

TV Out I can't help you with. The folks at http://linitx.org or http://forums.viaarena.com might be more help there.

For sound, if you use a recent -ac kernel, the OSS drivers are in there and work fairly well. If you want to go Alsa, have a look at https://forums.gentoo.org/viewtopic.php?t=62555. Either way, you'll need a software mixer if you want more than one thing going at once. Such as artsd, which should be in there with your KDE emerge.

----------

## rippleatwpi

I just emerged the latest alsa-9.x packages - ac3 passthrough and spdif output work out of the box on my epia M-10k.  After loading the modules, I ran alsamixer and unmuted the iec958 output device, and gave pcm and master some volume.

To get AC3 passthrough all I have to do is an 'mplayer -ao alsa9:iec958 -ac hwac3 movie.avi'

PCM minus the AC3 is just 'mplayer -ao alsa9:iec958 movie.avi'

I'll comment on TV out after I have emerged the latest xfree-4.3.99.x.  So far I got it working trivially with xfree's vesa driver, however lacking xv output, mplayer turned dvd and avi playback into a slideshow.  hopefully the 'via' driver will improve things...

----------

## yslee925

hi,

My EPIA model is V10K. I followed the ac3 hints by rippleatwpi. However, I got bad luck. The spdif out won't work. The error message is as follow:

```

 $ mplayer -vo xvidix -ao alsa9:iec958 -ac hwac3 -v 2 dolby-city.vob

... <cutted> ...

==========================================================================

Forced audio codec: hwac3

Opening audio decoder: [hwac3] AC3/DTS pass-through SP/DIF

dec_audio: Allocating 8192 bytes for input buffer

dec_audio: Allocating 16384 + 65536 = 81920 bytes for output buffer

No accelerated IMDCT transform found

hwac3: switched to AC3, 448000 bps, 48000 Hz

AUDIO: 48000 Hz, 2 ch, 16 bit (0x400), ratio: 56000->192000 (448.0 kbit)

Selected audio codec: [hwac3] afm:hwac3 (AC3 through SPDIF)

==========================================================================

... <cutted>

==========================================================================

Checking audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/2ch/8bit...

[libaf] Adding filter dummy 

[dummy] Was reinitialized, rate=48000Hz, nch = 2, format = 0x00000020 and bps = 2

AF_pre: af format: 2 bps, 2 ch, 48000 hz, big endian AC3 

AF_pre: 48000Hz 2ch AC3

alsa-init: requested format: 48000 Hz, 2 channels, AC3

alsa-init: compiled for ALSA-0.9.2

alsa-spdif-init: playing AC3, 2 channels

alsa-init: soundcard set to iec958:AES0=0x2,AES1=0x82,AES2=0x0,AES3=0x2

ALSA lib pcm.c:1785:(snd_pcm_open_conf) Invalid type for PCM iec958:AES0=0x2,AES1=0x82,AES2=0x0,AES3=0x2 definition (id: iec958, value: cards.pcm.iec958)

alsa-init: playback open error: Invalid argument

Could not open/initialize audio device -> no sound.

Uninit audio filters...

[libaf] Removing filter dummy 

uninit audio: hwac3

Audio: no sound

```

The City trailer from http://www.cinenow.com/us/vobtrailer.php3 The weird thing is that it is supposed to be 5.1 channes while I got only 2 ch from my log.

```

alsa-driver-0.9.8

mplayer-1.0_pre2

Portage 2.0.49-r15 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r8, 2.4.22-openmosix)

=================================================================

System uname: 2.4.22-openmosix i686 VIA C3 Ezra

Gentoo Base System version 1.4.3.11

distcc 2.11.2 i586-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]

ccache version 2.3 [enabled]

ACCEPT_KEYWORDS="x86 ~x86"

AUTOCLEAN="yes"

CFLAGS="-march=i586 -m3dnow -mmmx -O2 -pipe -fomit-frame-pointer"

CHOST="i586-pc-linux-gnu"

COMPILER="gcc3"

CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/config"

CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"

CXXFLAGS="-march=i586 -m3dnow -mmmx -O2 -pipe -fomit-frame-pointer"

DISTDIR="/usr/portage/distfiles"

FEATURES="sandbox ccache autoaddcvs distcc"

GENTOO_MIRRORS="http://mirrors.tds.net/gentoo/ ftp://sunsite.ualberta.ca/pub/unix/Linux/gentoo/ http://gentoo.oregonstate.edu/ http://distro.ibiblio.org/pub/Linux/distributions/gentoo http://csociety-ftp.ecn.purdue.edu/pub/gentoo/"

MAKEOPTS="-j5"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY=""

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="x86 apm avi crypt cups foomaticdb kde libg++ libwww mad mikmod mpeg ncurses nls pdflib png quicktime spell xml2 xmms zlib gdbm berkdb slang readline ggi sdl gpm tcpd pam ssl perl python imlib qt motif opengl mozilla X gtk gtk2 gnome oss alsa -sse 3dnow mmx jpeg svga oggvorbis aalib xv truetype dvd gif esd encode samba lirc arts java"

```

any idea?

----------

## lazyleopard

Has the "via" driver been dropped from "xfree-4.3.0-r3" ?  I'm getting:

(EE) Failed to load module "via" (module does not exist, 0)

in my log...

Edit: Found an answer in this thread, and I'm now running an 

```
emerge /usr/portage/x11-base/xfree/xfree-4.3.99.15.ebuild
```

----------

## vedic-Ai

Hi,

I have a problem running xfree-4.3.99.16 on my Epia ME8000 board.

When I run "XFree86 -configure"  I gen an error message:

```
        via

(EE) Failed to load module "via" (once-only module, 136083937)
```

I checked the unpacked source and "drivers/via" is present and seems up-to-date. It is also  installed in "/usr/X11R6/lib/modules/drivers/" under the name via_drv.o (is this OK?). So I tried to insmod it... no success (/usr/X11R6/lib/modules/drivers/via_drv.o: couldn't find the kernel version the module was compiled for).

Any idea why this might be happening?

I also noticed that agpgart module does not load:

```
iFoto linux # modprobe agpgart

/lib/modules/2.4.20-gentoo-r6/kernel/drivers/char/agp/agpgart.o: init_module: No such device

Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters.

      You may find more information in syslog or the output from dmesg

/lib/modules/2.4.20-gentoo-r6/kernel/drivers/char/agp/agpgart.o: insmod /lib/modules/2.4.20-gentoo-r6/kernel/drivers/char/agp/agpgart.o failed

/lib/modules/2.4.20-gentoo-r6/kernel/drivers/char/agp/agpgart.o: insmod agpgart failed
```

Can it be that this is related to my xfree via driver not loading?

Here is my "lsmod":

```
Module                  Size  Used by    Tainted: GF

ohci1394               16488   0  (unused)

ieee1394               32236   0  [ohci1394]

via-rhine              12752   1

mii                     2352   0  [via-rhine]

usb-storage            60600   0  (unused)

hid                    13620   0  (unused)

uhci                   24384   0  (unused)

ehci-hcd               14336   0  (unused)

usbcore                58912   1  [usb-storage hid uhci ehci-hcd]
```

Any hint on how to proceed would be appreciated. Thanks!

----------

## Rroet

make sure you you have the epia patch in your kernel and you're not running agpart. Better use the kernel module "via" and "via_v4l_drv"

I haven't tested with the cle266vgaio module just yet, just because I don't know what it does.

further more, on my M10000 the 4.3.99.16 ran just fine. Don't try to install the VIA-DRM drivers ontop of it. It will brake your video output when you start playing files with mplayer or mythtv.

mplayer / mythtv use xv as standard video out afaik, and that gives you  a nice colored static image with a load of pink in between.

just use the plain xfree86 support in 4.3.99.16 or (as I'm compiling right now) 4.3.99.901 .

for good instructions for gentoo check: http://blade5.bvu.edu/ and http://epia.repvik.org/

the latter is a forum created out of the mythtv mailinglist to have a good central point for mythtv on gentoo and epia discussions.

----------

