# VIA EPIA & Unichrome

## infiniteedge

http://gentoo-wiki.com/HOWTO_Unichrome

I found this article in gentoo-wiki and was looking for a bit of explanation that the original author couldn't include.

What is the DRI (x11-drm) package?  Is it a set of kernel modules?  If I'm using it I believe I shouldn't include DRM in my kernel at all (much the same as the alsa-driver package)?

It seems that the latest [masked] Xorg in portage is now xorg-x11-6.8.99.14.  Will using this masked package free me of some of the work in the "Patching Xorg" section?

Any other commentary would be greatly appreciated.  I am completely at home with all of my gentoo servers and am finally trying to set up a gentoo desktop.  Unichrome isn't making my first experiences with Xorg very happy ones  :Sad: .Last edited by infiniteedge on Wed Jul 20, 2005 3:37 pm; edited 1 time in total

----------

## keli

You are avare, that you can "just use" your Unichrome with the vesa driver in X.org? I don't want to be a party breaker, but Since I have Unichrome on my laptop (with only 128M Shared memory) I didn't really see an advantage that big from the Unichrome driver over vesa to be worth all that bother that was descibed in the gentoo wiki.

So I'm just waiting paciently, until Unchrome driver mature enough to be usable  :Razz: 

Yeah, I know, I'm lazy.  :Very Happy: 

----------

## infiniteedge

I can't get by with the vesa driver, I'm using my box for HDTV on MythTV.  Can anyone answer my questions?

----------

## infiniteedge

bump

----------

## infiniteedge

I seem to be encountering some success using the ~x86 vanilla-sources (currently 2.6.13-rc3) which already contain the Unichrome DRI.  The combination of the masked Xorg and ~x86 vanilla-sources has allowed me to gain (I think) a fully accelerated unichrome X without needing to go outside portage.  glxinfo still tells me I'm not using direct rendering, however I think some changes to my xorg.conf will fix that.  I will report back shortly.  This should be good news to gentoo unichrome users  :Smile: .

----------

## infiniteedge

All I had to do to get glxinfo to tell me Direct Rendering was enabled with the above setup was follow these steps from the Unichrome 3D-HOWTO (http://sourceforge.net/docman/display_doc.php?docid=26963&group_id=102048):

c. Let's backup some files first.  Jump into /usr/X11/lib and copy libGL.so.1.2 into some safe place in your home directory.  Now, untar your opensource 3D driver package, `cause it's magic time!  Replace libGL.so.1.2 with the one in the package.  Then jump into /usr/X11/lib/modules/dri and copy over the unichrome_dri.so file.  You may want to create a symlink to unichrome_dri.so called via_dri.so, although I'm not sure this is necessary.  We are now done with tough stuff!

In my particular version of Xorg, libGL.so.1.2 did not exist (I instead had libGL.so.1.3).  Simply moving the 1.2 file into place worked fine.

----------

## kevin_barsby

Hi,

I'm trying to get a similar sounding config up and running, which version of xorg are you running? Also which implementation of opengl?

Thanks

Kevin

----------

## infiniteedge

As I said in an earlier post, I'm using whatever version of Xorg is currently masked in portage.  Unmask it by adding it to your /etc/portage/package.unmask .  It's 6.8.99.xx something; the bits are from the Xorg CVS.  I'm using whatever opengl came with it, I did nothing special to get opengl, so whatever Gentoo defaults to.

----------

## kevin_barsby

I've tried both 6.8.99.14 and 6.8.99.15 ebuilds both give the following error on starting X:

```

(WW) ****INVALID MEM ALLOCATION**** b: 0xd8000000 e: 0xdc000000 correcting

(EE) VIA(0): [XvMC] XvMCScreenInit failed. Disabling XvMC.

Symbol PictureTransformPoint3d from module /usr/X11R6/lib/modules/libfb.a is unresolved!

Symbol PictureTransformPoint3d from module /usr/X11R6/lib/modules/libfb.a is unresolved!

Symbol PictureTransformPoint3d from module /usr/X11R6/lib/modules/libfb.a is unresolved!

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

```

Trying the above solution with 6.8.2-r2 almost worked (I got Direct rendering= Yes from glxinfo) but it crashes the system (not just X) when you kill off X (didn't try anything else)

Might try the full CVS route again (X was failing to build last time I tried).

Any more thoughts welcome

----------

## adsmith

By the way, I have hacked ebuilds of xorg-x11-6.8.2  and mplayer-1.0_pre6-r6 which fully support unichrome.  I found them online; I don't remember where, but I can provide them to whomever would like them.

I'm glad to here that support is working its way into the official portage tree.  So many people have unichromes, and I've found that a properly accelerated unichrome is capable of a few hundred fps in glxgears -- plenty for everything but high-res gaming.

EDIT: the hacked xorg ebuild also provides the appropriate kernel module.Last edited by adsmith on Fri Aug 05, 2005 2:52 pm; edited 1 time in total

----------

## the_mgt

Hi there!

I am author of aforementioned howto. That howto is the essence of what made my Epia MII 6000 board running with the mpeg2-hw-acc. It is needed because the board is to slow to do it in software.

The DRM has to be excluded from the kernel and installed seperatly, that's right.

Since nobody told me, that everything is working fine with him and my scripts/howto, i don't know if that way works on all unichrome boards. It is working here, i have a nice multimedia station with freevo running now.

I am usually around at the forum on www.epiawiki.org

Here are some scripts i wrote, so you won't have to do the steps manually:

 drm-script

 xorg-script

 mplayer-ebuild

Last time, i tried out the latest masked ebuild, it didn't work and b0rked my dvb-t card configuration.

The xorg-patches always have to fit with the drm modules used. Last time i tried, the -mm kernel had too old drm, but i heard it is working now.Last edited by the_mgt on Sat Aug 06, 2005 2:09 pm; edited 1 time in total

----------

## alidaf

I've tried every incarnation of these scripts and I just can't get it to work.  Every time I try 'make' after cvs'ing the xfree86 drivers I get the following error:

ISO C forbids data definition with no type or storage class.

I had mythtv up and running from scratch with Fedora Core 3 within a few hours but I've been struggling with Gentoo for over two months now and can't get beyond Unichrome.

Regards

Darren

----------

## adsmith

here are a couple ebuilds.  The xorg ebuild "just worked", and the mplayer ebuild mostly so (still can't get xvmc to fully work on my machine, but no big deal, since I've never really gotten it to work anywhere):

xorg:

http://tock.no-ip.org/~abe/unichrome/xorg-x11-6.8.2-r3002.ebuild

mplayer:

http://tock.no-ip.org/~abe/unichrome/mplayer-1.0_pre6-r6.ebuild

obviously, set package.use, package.mask and package.keywords appropriately

----------

## the_mgt

@alidaf: the concept of the scripts is, that you dont have to enter anything manually.....

"chmod 755 <scriptname>" them and execute them with ./scriptname, if you are in the directory where the script is.

I have been struggeling for over half a year, when i first tried to get it working...  :Evil or Very Mad: 

Are you sure you went through this steps before starting "make":

```

rm -rf via 

ln -s  xfree86  via 

make Makefiles 

cd via
```

I used all of the scripts here on my epia board and they work. They are basically doing the same as the unichrome howto on unichrome.sf.net describes.

@adsmith: my mplayer script always works with my other scripts together and i tested it on another board, too. I've been able to get it working on two different mainboards now. (USEFLAGS= xvmc unichrome)

Since nobody complained in this  thread, I guess they are working... But nobody send a verification note either, so i don't know for sure....  :Sad: 

----------

## alidaf

Hi there the_mgt.  I've noticed your name flying around a lot and take you to be an expert, which, unfortunately I am not.  I went through the scripts manually because I thought it would be a useful way to become familiar with Gentoo.

In direct response to your query, I definitely did those steps.

Anyway, thanks for your help.  I'm sure there is nothing wrong with the scripts but a prerequisite maybe.  I followed the gento guidelines for a stage 1 install, which took forever.  I've lost track of what I have but I'm pretty sure the drm install went ok when I did it.  I wouldn't be surprised if I've broken it now though!  :Confused: 

----------

## the_mgt

hi!

I wouldn't call myself an expert, but i have lots of experience with these epia things.

Going to the steps manually can be very ennerving, i spend whole weekends just failing everytime, because i forgot something or things like that.

Stage 1 can be a pain in the a**! Took me two month or so, the first time i tried gentoo...

You can definetly use a stage3, which is lot faster and not so complicated. We did that on the board of a friend of mine. You just need to make a kernel, use my drm script and compile xorg (try the "minimal" useflag, that should save time. add it to your useflags in make.conf) with the script. Try first without changing the cflags and cxxflags in make.conf. That should be all....

If i have time later this evening, i will post my make.conf settings and other stuff on the howto on gentoo-wiki.

I was surprised, that i am the first one posting a howto there and that nobody added any stuff since....

I wish you luck with your board, since they are a real charm when working properly!

I use it with freevo and an ir-remote control, it's all very nice.

I have no experience with mythtv, but it should be even more easy than freevo, since mythtv has unichrome support buildin.

----------

## alidaf

the_mgt, 

I think one problem is that there are a lot of slightly different ideas on how to do the same thing. The biggest reason for the differences seems to be version control.  Things appear to be developing so fast, the documentation just hasn't caught up yet.  

For instance, I think you were the first person to state that a patched kernel is not necessary, yet the howto on epiawiki is still geared towards patched kernels and its one thing I just cannot follow.  I started using the guide at MagicItx because the guide at epiawiki is just too confusing but I fell over at the Unichrome section, and its where I've been falling over with every other guide since.  I think I may start from scratch, collate all of your recent posts and use your scripts.  At least I'll know that I'm operating from the same hymn sheet as you.  I don't think I can face another stage 1 though!

Keep up the good work.

----------

## the_mgt

Exactly that was my problem too! 1001 different ways!

But in the and, all u need is this thread, i hope: http://www.epiawiki.org/wiki/tiki-view_forum_thread.php?comments_parentId=634&topics_threshold=0&topics_offset=13&topics_sort_mode=commentDate_desc&topics_find=&forumId=2

After the stage 3 tarball installation, there is not much to do, just a kernel and all the user progs you like.

We did use a normal gentoo-sources-kernel, didn't use the drm in the kernel but the ones from my script and all is fine. Since my scripts both install the latest versions from sourceforge CVS, there shouldn't be any versioning problems, because they fit together and are managed by the same people, i guess.

I was able to install a working freevo mediasystem over ssh on my friends board with a stage3 install, so i guess it should work for you, too.

Later more, have to go now.

----------

## dan224

Would someone please help clarify this?

I have an SP13000, using kernel 2.6.13-rc6 and xorg 6.8.99.15

I've compiled my kernel so that the via drm is incorperated - but all of the guides mention loading via drm as a module. 

Shouldn't the dri just work in it's present state? glxinfo reports that it's turned off. 

I've tried the guide here: http://sourceforge.net/docman/display_doc.php?docid=26963&group_id=102048, but was confused as to which steps I needed to take, exactly.

Thanks!Last edited by dan224 on Thu Aug 11, 2005 6:43 pm; edited 1 time in total

----------

## adsmith

did you enable DRI in your xorg.conf?

----------

## dan224

Yes, I did.

This is from my Xorg.0.log:

```
(II) VIA(0): vgaHWGetIOBase: hwp->IOBase is 0x03d0, hwp->PIOOffset is 0x0000

(II) VIA(0): 3D Engine has been initialized.

drmOpenDevice: node name is /dev/dri/card0

drmOpenDevice: open result is -1, (No such device)

drmOpenDevice: open result is -1, (No such device)

drmOpenDevice: Open failed

drmOpenDevice: node name is /dev/dri/card0

drmOpenDevice: open result is -1, (No such device)

drmOpenDevice: open result is -1, (No such device)

drmOpenDevice: Open failed

[drm] failed to load kernel module "via"

(II) VIA(0): [drm] drmOpen failed

(EE) VIA(0): [dri] DRIScreenInit failed.  Disabling DRI.

```

...how do I get a card0 in /dev/dri?

----------

## the_mgt

You said you "incorporated" your drm in the kernel, so you didn't build it as module?

Have you tried building it as module? Does it work then?

Do you use the drm from your kernel or from sourceforge?

And did you notice, that your log says:

```
[drm] failed to load kernel module "via"
```

Maybe you forgot something in the kernel.....

You can disable the drm in your kernel and use this drm-script to try if it works with the drm from sourceforge.

And with that SP13000, is it KN400 or CLE266? I think the newer unichrome chips aren't that well supported.

----------

## dan224

I haven't tried building it as a module. Is that my best bet?

I used the drm from my kernel.

How do I disable it?

Yes, CN400.

----------

## the_mgt

Yes, most of the unichrome stuff works best as module and is known for causing trouble if build-in.

You do disable it, if you don't build it at all in the kernel. If you use menuconfig, leave "<>" blank.

After that you could try an ebuild or my script for dri from cvs. (Posted somewhere above in this thread)

Have a look at http://unichrome.sf.net for compatibility questions, they are the ones who develope the unichrome drivers. http://dri.sf.net has some information, too.

The CN400 is not very supported still. But VIA themself decided to go Open Source... Have a look at http://viaarena,com. Look for the Linux Forum there.

----------

## brumbrum

The latest stable unichrome-drivers are not found on http://unichrome.sf.net. If you want the latest working drivers, check http://myth.ivor.org.

I had big problems using the old drivers in unichrome.sf.net, but downloading the drivers from myth.ivor.org fixed everything. Just emerge xorg, but look out so you dont remove the work-directory, then compile the drivers from myth.ivor.org following the readme-file, and point the xmkmf to the work-dir of xorg. Then compile the drm-modules to your kernel... then restart X using the via-driver instead of vesa-driver!

----------

## Tuomaz

How do I tell portage to keep my xorg-x11 workdir?

Is the workdir supposed to be in /var/tmp/portage/ ?

/Tuomaz

----------

## adsmith

FEATURES="keepwork"

man make.conf

----------

## infiniteedge

there is a FEATURES flag, something like "keepwork".  look in the portage docs.

EDIT: damn you beat me to it

----------

## the_mgt

Do you want to keep your workdir because you want to patch yourself?

ebuild /full/path/to/ebuild compile downloads, unpacks and compiles the sources.

After that, you can apply the unichrome patches, and when done with them, just ebuild /full/path merge.

That is what i am doing, and basically what my xorg script does. Not really nice, but it works and i don't not have enough experience to build it into an ebuild. But i read there are some around.

EDIT: adsmith is right, i meant the ebuild command. sorry, i was absentminded  :Wink: Last edited by the_mgt on Mon Aug 22, 2005 11:10 pm; edited 1 time in total

----------

## adsmith

the_mgt, you mean the ebuild command, nto the emerge command.

----------

## StarDragon

 *keli wrote:*   

> You are avare, that you can "just use" your Unichrome with the vesa driver in X.org? I don't want to be a party breaker, but Since I have Unichrome on my laptop (with only 128M Shared memory) I didn't really see an advantage that big from the Unichrome driver over vesa to be worth all that bother that was descibed in the gentoo wiki.
> 
> So I'm just waiting paciently, until Unchrome driver mature enough to be usable 
> 
> Yeah, I know, I'm lazy. 

 

And how exactly did you do that?

----------

## the_mgt

Try to just load it in the xorg.conf. I think it works for normal x use, but not for movie players.

----------

## StarDragon

Cool, that works. Although I haven't tried playing movies on mplayer yet, I guess I'll keep this one as a fallback plan.

----------

## the_mgt

When i try to make "make DRM_MODULES="via"", it fails with the following error:

```

CC [M]  /usr/src/drm-unichrome/drm/linux-core/drm_sysfs.o

/usr/src/drm-unichrome/drm/linux-core/drm_sysfs.c:130: warning: implicit declaration of function `__ATTR'

/usr/src/drm-unichrome/drm/linux-core/drm_sysfs.c:130: error: `dri_library_name' undeclared here (not in a function)

/usr/src/drm-unichrome/drm/linux-core/drm_sysfs.c:130: warning: missing braces around initializer

/usr/src/drm-unichrome/drm/linux-core/drm_sysfs.c:130: warning: (near initialization for `class_device_attrs[0]')

/usr/src/drm-unichrome/drm/linux-core/drm_sysfs.c:130: error: initializer element is not constant

/usr/src/drm-unichrome/drm/linux-core/drm_sysfs.c:130: error: (near initialization for `class_device_attrs[0].attr.name')

/usr/src/drm-unichrome/drm/linux-core/drm_sysfs.c:131: error: initializer element is not constant

/usr/src/drm-unichrome/drm/linux-core/drm_sysfs.c:131: error: (near initialization for `class_device_attrs[0].attr')

/usr/src/drm-unichrome/drm/linux-core/drm_sysfs.c:131: error: initializer element is not constant

/usr/src/drm-unichrome/drm/linux-core/drm_sysfs.c:131: error: (near initialization for `class_device_attrs[0]') 

make[2]: *** [/usr/src/drm-unichrome/drm/linux-core/drm_sysfs.o] Error 1 

make[1]: *** [_module_/usr/src/drm-unichrome/drm/linux-core] Error 2

make[1]: Leaving directory `/usr/src/linux-2.6.7-epia1'

make: *** [modules] Error 2

```

I use an MII6000 with 2.6.7-epia1 kernel and changed so many things since last drm build, that i don't have a clue where to begin searching. I changed to NPTL, prelinking and udev, removed PAM recently.

But the error messages states something about the kernel dir, so i made "make mrproper", set up a fresh kernel config with the standard options and retried, but it failed again with the same error.... 

Maybe it is time to change to a newer kernel, i try to  boot latest gentoo-sources, and if lirc and dvbt work, i will use them instead, and burry my long-loved -epia1 kernel :'|

EDIT: I don't get this error with the 2.6.12-r6 kernel and i used latest x11-drm from portage. Thanks to the devs! Lirc works fine, too. Next is dvb, but i guess, thats thats a small problem! I'll change 2.6.7-epia1's status to retired.

Maybe i'll give the latest xorg ebuild a try this week (can't wait to b0rk everything again...)

----------

## vishnoo

Hi

I have a via unichrome and I'm happy to have the drm in the kernel 2.6.13.

The direct rendering is working using xorg-x11-6.8.99.15 and everything has became simple and almost "just works".

But (there's a `but`) i have some little problems :

1) when i startx (manually) i see a worrying message :

```
(WW) ****INVALID MEM ALLOCATION**** b: 0xe4000000 e: 0xe8000000 correcting
```

But even with that it works so just that is ok (opengl, mplayer,... everything goes fine...)

2) the really problem is when i start another X on a second display ("startx -- :1") : there is the same message+the direct rendering doesn't work for this display :

```
(WW) ****INVALID MEM ALLOCATION**** b: 0xe4000000 e: 0xe8000000 correcting

(EE) VIA(0): [dri] DRIScreenInit failed.  Disabling DRI.
```

so no more DRI  :Sad: 

3) worse : when i switch between displays and come back on the display 1 (ctrl-alt-f7 ; ctrl-alt-f8 ) the X server opened on :1 crashes :

```

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

   *** be the reason for the server aborting.

Backtrace:

0: X(xf86SigHandler+0x81) [0x8087c81]

Fatal server error:

Caught signal 11.  Server aborting

```

(But the first server on display 0 (the one for which dri works) keeps working fine)

So that's embarrassing ...

Anyone has the same problem ? some solution ?

----------

## the_mgt

hehe, i think thats a question for the unichrome mail list. Most people are very happy if they get drm on one display working with unichrome, i guess  :Wink: . (I am, its my mediacenter connected to TV). Since the drivers are still under construction, you can ask the constructors directly. Check if this isn't already reported as a bug.

----------

## vishnoo

Thanks : i'll ask

 *Quote:*   

> 
> 
> Most people are very happy if they get drm on one display working with unichrome, i guess . 
> 
> 

 

Yes, but it used to work without problems some months ago barely (using the dri et the libGLU from the unichrome project page with a normal xorg) ... ^_^'

Until some day, and then and i couldn't manage to get it work until a few days ago x11-drm and masked xorg...

Here, i don't know if it comes from X or from the dri... and mainly i d'like to know if other people have this problem or not  :Smile: 

----------

## tHeoo

I joined the number of those who try to build a media center with a via c3 and 

cle266. I'm not on epia. Too expensive for me. I bought a pcchips m789 

motherboard, having samuel2 at 800mhz onboard, but being marketeered as 

2000+. Fortunately, I knew beforehand that this was a joke. I've copied over 

a pre-built gentoo system (with appropriate cflags) with kernel 

2.6.12-suspend2-r5 to the harddisk. GCC is 3.4.4 with nptl. I used the latest 

~x86 x11-drm ebuild to add drm.ko and via.ko to the kernel.

The problem is as usual: get the via xxmc working. Standard stable xorg 

6.8.2-r2 works, but has only xv, enough to do me the joy of running a divx 

video at about 95% cpu load without much hampering.

I've tried the latest xorg snapshot in portage, that is 6.8.99.15. It has 

everything necessary to get the xxmc working but it freezes the system (at 

least in so far as making the usb keyboard unusable) so that I need to reboot 

the system from an ssh login. Xlog shows a backtrace with libfb.so and 

libxaa.so. It looks very much like this (from an email on freedesktop by 

Donnie Berkholz):

```
Backtrace:

0: /usr/X11R6/bin/X [0x808ed9b]

1: /usr/X11R6/bin/X(xf86SigHandler+0xae) [0x808ed5b]

2: [0xffffe420]

3: /usr/lib/modules/libfb.so [0xb7811d21]

4: /usr/lib/modules/libfb.so(fbCompositeGeneral+0x6f8) [0xb78124c7]

5: /usr/lib/modules/libfb.so(fbComposite+0xd26) [0xb7823fb4]

6: /usr/lib/modules/libxaa.so(XAAComposite+0x3bb) [0xb77cedb2]

7: /usr/X11R6/bin/X [0x81b0df3]

8: /usr/X11R6/bin/X(CompositePicture+0x10b) [0x81cb589]

9: /usr/X11R6/bin/X [0x81cd53f]

10: /usr/X11R6/bin/X [0x81d0453]

11: /usr/X11R6/bin/X(Dispatch+0x205) [0x80d613a]

12: /usr/X11R6/bin/X(main+0x5d0) [0x80ee2b0]

13: /lib/libc.so.6(__libc_start_main+0xf7) [0xb7e51fc7]
```

Composite won't have been in my log, as I don't load it.

I thought the cause might be the dlloader, testified by the .so module names 

in the backtrace, so I fabriqued a new ebuild for snapshot 99.16 on the basis 

of the ebuild for 99.14, which still has the dlloader use flag. No luck 

either. The system freezes again, dropping the following backtrace:

```
Backtrace:

0: X(xf86SigHandler+0x9e) [0x808233d]

1: [0xffffe420]

2: [0x84a1253]

3: [0x82c1133]

4: X [0x812c559]

5: X(ProcCopyArea+0x1c3) [0x80ae954]

6: X(Dispatch+0x171) [0x80b2141]

7: X(main+0x485) [0x80bbcd7]

8: /lib/libc.so.6(__libc_start_main+0x8e) [0xb7e2c34e]

9: X [0x806f9d1]
```

Finally, I tried the 30 seconds README from myth.ivor.org with xorg 6.8.2. The 

drm modules compiled correctly for the latest version 081505. Trying to build 

libxvmc, I got an error after doing xfmkmf /usr/src/xc, which is quite 

natural, because there is no such directory on my system. the files were 

in /usr/local/src/unichrome-081505.

Any clues? Any people getting similar freezes?

----------

## Tuomaz

When I try to emerge the mplayer ebuild found in this thread at http://www.epiawiki.org/wiki/tiki-download_file.php?fileId=17 i get this:

```

 * Cannot find $EPATCH_SOURCE!  Value for $EPATCH_SOURCE is:

 *

 *   /usr/local/portage/media-video/mplayer/files/mplayer-1.0_pre6-ppc64.patch

 *   ( mplayer-1.0_pre6-ppc64.patch )

```

why?

----------

## the_mgt

I don't know! But i stumbled across such things very often! Either you try to google and get it off their cache, or you write me a private message, and i try to send you my version of that file.

Try this here first: https://svn.uludag.org.tr/paketler/trunk/media-video/mplayer/files/mplayer-1.0_pre6-ppc64.patch[/url]

----------

## timeout

 *vishnoo wrote:*   

> Hi
> 
> I have a via unichrome and I'm happy to have the drm in the kernel 2.6.13.
> 
> The direct rendering is working using xorg-x11-6.8.99.15 and everything has became simple and almost "just works".
> ...

 

I had a similar problem, but X crashed somehow with same error messages?

Can you tell me which kernel you used? And how you install xorg-x11.

I have been trying to get my Epia SP 1300 works for about one week, still get no luck.

----------

## the_mgt

This thread is full of links to howtos and install scripts, just read the first page.

Or start here: http://gentoo-wiki.com/HOWTO_Unichrome

1. Any new Kernel

2. x11-drm from portage

3. very latest masked xorg-ebuild or my xorg-6.8.2 script

That should be all.

----------

## infiniteedge

I'm getting a crashing bug with Xorg 6.8.99.15 + x11-drm 20050807.  I'm largely using http://gentoo-wiki.com/HOWTO_Unichrome and http://www.gentoo.org/doc/en/dri-howto.xml.  I have a Via EPIA CL10000 w/ kernel 2.6.13 without DRM compiled in.

The Xorg.0.log looks like this where the crash occurs:

```
(II) VIA(0): [drm] Trying to enable AGP fast writes.

(II) VIA(0): [drm] drmAgpEnabled succeeded

(II) VIA(0): [drm] agpAddr = 0xe0000000

(II) VIA(0): [drm] agpBase = (nil)

(II) VIA(0): [drm] agpAddr = 0xe0000000

(II) VIA(0): [drm] agpSize = 0x01e00000

(II) VIA(0): [drm] agp physical addr = 0x00000000

(II) VIA(0): [dri] use agp.

(II) VIA(0): [drm] FBFreeStart= 0x00400000 FBFreeEnd= 0x01fbe000 FBSize= 0x01bbe000

(II) VIA(0): [dri] frame buffer initialized.

(II) VIA(0): X context handle = 0x1

(II) VIA(0): [drm] installed DRM signal handler

(II) VIA(0): [DRI] installation complete

(II) VIA(0): [dri] kernel data initialized.

(II) VIA(0): [drm] Initialized AGP ring-buffer, size 0x200000 at AGP offset 0x1e00000.

(II) VIA(0): direct rendering enabled

(II) VIA(0): Benchmarking video copy. Less is better.

(--) VIA(0): Timed   libc YUV420 copy... 3633089. Throughput: 163.7 MiB/s.

(--) VIA(0): Timed kernel YUV420 copy... 3602913. Throughput: 165.1 MiB/s.

(--) VIA(0): Timed    SSE YUV420 copy... 2109218. Throughput: 282.0 MiB/s.

(--) VIA(0): Timed    MMX YUV420 copy... 2382813. Throughput: 249.6 MiB/s.

(--) VIA(0): Ditch 3DNow! YUV420 copy... Not supported by CPU.

(--) VIA(0): Timed   MMX2 YUV420 copy... 1722933. Throughput: 345.2 MiB/s.

(--) VIA(0): Using MMX2 YUV42X copy for video.

(II) VIA(0): [XvMC] Registering viaXvMC.

(II) VIA(0): [XvMC] Initialized XvMC extension.

(==) RandR enabled

(II) Setting vga for screen 0.

(II) Initializing built-in extension MIT-SHM

(II) Initializing built-in extension XInputExtension

(II) Initializing built-in extension XTEST

(II) Initializing built-in extension XKEYBOARD

(II) Initializing built-in extension LBX

(II) Initializing built-in extension XC-APPGROUP

(II) Initializing built-in extension SECURITY

(II) Initializing built-in extension XINERAMA

(II) Initializing built-in extension XFIXES

(II) Initializing built-in extension XFree86-Bigfont

(II) Initializing built-in extension RENDER

(II) Initializing built-in extension RANDR

(II) Initializing built-in extension COMPOSITE

(II) Initializing built-in extension DAMAGE

(II) Initializing built-in extension XEVIE

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

   *** be the reason for the server aborting.

Backtrace:

0: X(xf86SigHandler+0x9e) [0x8082227]

Fatal server error:

Caught signal 11.  Server aborting

Please consult the The X.Org Foundation support

         at http://wiki.X.Org

 for help.

Please also check the log file at "/var/log/Xorg.0.log" for additional information.

(II) VIA(0): [drm] Cleaning up DMA ring-buffer.
```

It looks like an error with the via drm driver, maybe with the XEVIE extension.  I know nothing about this, maybe someone could enlighten me? My xorg.conf looks like this:

```
Section "ServerLayout"

        Identifier     "X.org Configured"

        Screen      0  "Screen0" 0 0

        InputDevice    "Mouse0" "CorePointer"

        InputDevice    "Keyboard0" "CoreKeyboard"

EndSection

Section "Files"

        RgbPath      "/usr/lib/X11/rgb"

        ModulePath   "/usr/lib/modules"

        FontPath     "/usr/share/fonts/misc/"

        FontPath     "/usr/share/fonts/TTF/"

        FontPath     "/usr/share/fonts/Type1/"

        FontPath     "/usr/share/fonts/CID/"

        FontPath     "/usr/share/fonts/75dpi/"

        FontPath     "/usr/share/fonts/100dpi/"

EndSection

Section "Module"

        Load  "record"

        Load  "extmod"

        Load  "dbe"

        Load  "dri"

        Load  "glx"

        Load  "xtrap"

        Load  "freetype"

        Load  "type1"

EndSection

Section "InputDevice"

        Identifier  "Keyboard0"

        Driver      "kbd"

        Option  "XkbModel"      "pc105"

        Option  "XkbLayout"     "us"

EndSection

Section "InputDevice"

        Identifier  "Mouse0"

        Driver      "mouse"

        Option      "Protocol" "auto"

        Option      "Device" "/dev/input/mice"

        Option "Emulate3Buttons" "yes"

        Option "ZAxisMapping" "4 5"

EndSection

Section "Monitor"

        Identifier   "Monitor0"

        VendorName   "Samsung"

        ModelName    "915N"

        HorizSync       30-81

        VertRefresh     56-75

EndSection

Section "Monitor"

        Identifier "Monitor1"

        VendorName "Samsung"

        ModelName  "153T"

        HorizSync   30-60

        VertRefresh 56-75

EndSection

Section "dri"

        Mode 0666

EndSection

Section "Device"

        ### Available Driver options are:-

        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",

        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"

        ### [arg]: arg optional

        #Option     "VBEModes"                  # [<bool>]

        #Option     "NoAccel"                   # [<bool>]

        #Option     "HWCursor"                  # [<bool>]

        #Option     "SWCursor"                  # [<bool>]

        #Option     "ShadowFB"                  # [<bool>]

        #Option     "Rotate"                    # [<str>]

        #Option     "VideoRAM"                  # <i>

        #Option     "ActiveDevice"              # [<str>]

        #Option     "LCDDualEdge"               # [<bool>]

        #Option     "BusWidth"                  # [<str>]

        #Option     "Center"                    # [<bool>]

        #Option     "PanelSize"                 # [<str>]

        #Option     "ForcePanel"                # [<bool>]

        #Option     "TVDotCrawl"                # [<bool>]

        #Option     "TVDeflicker"               # <i>

        #Option     "TVType"                    # [<str>]

        #Option     "TVOutput"                  # [<str>]

        #Option     "DisableVQ"                 # [<bool>]

        #Option     "DRIXINERAMA"               # [<bool>]

        Option     "DisableIRQ"                 # [<bool>]

        Option     "EnableAGPDMA"               # [<bool>]

        #Option     "NoAGPFor2D"                # [<bool>]

        Identifier  "Card0"

        Driver      "via"

        VendorName  "VIA"

        BoardName   "Unichrome (CLE266)"

        BusID       "PCI:1:0:0"

EndSection

Section "Screen"

        Identifier "Screen0"

        Device     "Card0"

        Monitor    "Monitor0"

        SubSection "Display"

                Viewport   0 0

                Depth     16

                Modes "1024x768"

        EndSubSection

        SubSection "Display"

                Viewport   0 0

                Depth     24

                Modes "1024x768"

        EndSubSection

EndSection
```

My emerge info looks like this:

```
Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r1, 2.6.13-nodrm i686)

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

System uname: 2.6.13-nodrm i686 VIA Nehemiah

Gentoo Base System version 1.6.13

ccache version 2.4 [enabled]

dev-lang/python:     2.3.5

sys-apps/sandbox:    1.2.12

sys-devel/autoconf:  2.13, 2.59-r6

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6

sys-devel/binutils:  2.15.92.0.2-r10

sys-devel/libtool:   1.5.18-r1

virtual/os-headers:  2.6.11-r2

ACCEPT_KEYWORDS="x86"

AUTOCLEAN="yes"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-march=c3-2 -Os -msse -mmmx -mfpmath=sse -pipe -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"

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

CXXFLAGS="-march=c3-2 -Os -msse -mmmx -mfpmath=sse -pipe -fomit-frame-pointer"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig ccache distlocks sandbox sfperms strict"

GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://gentoo.mirrors.pair.com/ http://mirror.datapipe.net/gentoo http://lug.mtu.edu/gentoo"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

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

USE="x86 X aac alsa apm avi berkdb bitmap-fonts bzlib cdr cle266 crypt curl directfb dvd eds emboss encode esd ethereal exif fam ffmpeg flac foomaticdb fortran gd gdbm gif gnome gpm gstreamer gtk gtk2 hal howl imlib innodb java jpeg libg++ libwww mad mikmod mmx motif mozilla mp3 mpeg mysql ncurses nls nptl nptlonly offensive ogg oggvorbis opengl pam pcre pdflib perl png python qt quicktime readline ruby samba sdl speex spell sse ssl svga theora tiff truetype truetype-fonts type1-fonts unichrome usb v4l vorbis win32codecs xine xml2 xmms xv xvid xvmc zlib video_cards_via userland_GNU kernel_linux elibc_glibc"

Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTDIR_OVERLAY

```

My xorg-x11 was configured with these use flags:

```
[ebuild   R   ] x11-base/xorg-x11-6.8.99.15  -3dfx +bitmap-fonts -cjk -debug -doc -font-server +insecure-drivers -ipv6 -minimal +nls -nocxx +opengl +pam -sdk -static +truetype-fonts +type1-fonts (-uclibc) -xprint +xv 0 kB
```

----------

## StarDragon

I have followed every guide available on this issue, and now I'm really stuck when I do 

```
startx
```

 the system simply comes back saying that it could not find a screen with a proper setup. I have read in the xorg FAQ that this is mainly due to the driver has anyone been able to get across this issue?

----------

## infiniteedge

you should probably check my previous post and look at the xorg.conf.  Look up the specs for your monitor at the manufacturer's website.

----------

## StarDragon

Sucess! It works like a charm, even the got the direct 3d stuff to work.   :Cool: 

----------

## infiniteedge

grrrrr now how come mine doesn't work?

----------

## alidaf

Tuomaz

You need to copy over some patches from your default portage:

presuming you have PORTDIR_OVERLAY="/usr/local/portage" in make.conf

cp /usr/portage/media-video/mplayer/files /usr/local/portage/media-video/mplayer/files

for some reason I had to use the -r switch and drop the /files from the end of the destination, but basically you want to the contents of the /usr/portage...files to end up in /usr/local/portage...files.

then

ebuild <ebuild-name> digest

emerge =mplayer-1.0_pre6-r6

For some reason I also had a problem with the patch not being in the correct bzip2 format so I converted it in windows using lzarc, copied it back and tried again - it worked.

Hope it works for you.

----------

## Mr SA

Just a quick post from a newbie...

... to hold out some hope to those in the depths of despair going through it for the first time.

I have managed to get all the Unichrome (Pro) drivers up and running on an Epia SP13000 and I have avoided using non-stable portage packages as much as possible.

I have xorg-x11-6.8.2-r4 running on the Unichrome accelerated DRI driver.  I get 920+ fps out of glxgears.

I have xine using '-V xxmc' for mpeg2 decoding.  I can view a DVD or a DVD full quality .vob at 1% cpu or less.  That's right.  1%  Torsmo often reports 0% while the movie is running but more often 1%.  I have to be doing other things on the box for it to hit >2%.

I have all my sounds when media playing getting passed through to the S/PDIF output with full 5.1 sound (and THX where encoded) getting decoded by my AV processor.  My first tests with 5% CPU usage were all because ALSA was burning some cycles unnecessarily for my setup.

Last night I did a full "update deep" merge and replugged in the two or three non-portage interventions.  The most painful bit is building xorg-x11 using "keepwork" to allow the Unichrome stuff to be built later.

I used the snapshot Unichrome stuff from http://myth.ivor.org/unichrome

I had to get the libXvMCW wrapper package from the Unichrome sourceforge page, which required some fiddling to get it to build.

So that is a full, trouble-free CN400 Unichrome Pro up and running and working (obviously no mpeg4/divx in hardware yet).  All of it has been built from scratch and is readily repeatable.  I will try and put together a step by step guide because I've had to cobble together from descriptions for not necessarily up-to-date portage and for predominantly CLE266 boards.  Descriptions dedicated to the CN400 are few and far between.

----------

## infiniteedge

yes please do

----------

## the_mgt

@Mr SA:

Hi!

Nice to hear. Are you aware of the unichrome howto on gentoo-wiki.org? http://www.gentoo-wiki.org/HOWTO_Unichrome

Maybe you could add your description there. Also i am interested in your version of patching xorg. I used to patch xorg-6.8.2-rx with the stuff from sourceforge cvs, but that seems to be ineffective on the newer chips.

Also, i am getting familiar with ebuilds, maybe i am able to put a unchrome section in the official stable xorg ebuild, if you are interested. I am struggling with a drm-cvs ebuild atm.

greetz

----------

## zefrer

Hello, also having an SP13000 and struggling with getting dri and mpeg acceleration to work I would love you very very much if you could describe how you got yours working   :Laughing: 

So far I've tried about 5-6 different Xorg and driver builds, still no luck  :Crying or Very sad: 

Trying again atm with xorg 6.8.99.15-r2 and http://myth.ivor.org/unichrome/Latest.tar.bz2

Am I on the right track here or should I wait (anxiously) for your description?

----------

## the_mgt

Hehe.

Did you try ~x86 masked x11-drm.ebuid from portage?

Did you read this howto?  http://www.gentoo-wiki.org/HOWTO_Unichrome

It has a drm section. Then there is http://www.epiawiki.org .

I did installs on a M6000 and MII6000, but non of the newer ones.

ps: i am lazy, could you paste the link to a howto for the ivor branch you are using?  :Very Happy: 

----------

## zefrer

Yeah read the howto and the stuff about the drm the problem is that it's for the cle266 chipset and I have a cn400(unichrome pro) which needs ivors stuff. Basically he's got a drm, a via driver and a libxvmc library in that tar. You do:

```

    cd drm/linux-core

    make LINUXDIR=/usr/src/linux DRM_MODULES=via

    cp *.ko /lib/modules/`uname -r'/kernel/drivers/char/drm/

    depmod -ae

```

For the drm, modprobe via and dmesg should report a Unichrome Pro chip afterwards(it does here)

Then

```

cd libxvmc

xmkmf /var/tmp/portage/xorg-x11-6.8.99.15-r2/work/xc/

make

make install

cd unichrome

xmkmf /var/tmp/portage/xorg-x11-6.8.99.15-r2/work/xc/

make

make install

```

And that should be it   :Question: 

I'll let you know if it magically starts working XD

----------

## the_mgt

Hmm, that looks easy!

The xorg patching, you do that after "ebuild xorg-package compile" and before the "ebuild ... merge"?

Did anybody build an ebuild for that? If not, i may try.

----------

## zefrer

Yeah thats right 'ebuild xorg-package compile' patch then merge and I've just verified that it does work   :Very Happy:   :Shocked: 

```

byakko ~ # glxinfo | grep direct

__driCreateNewScreen - succeeded

direct rendering: Yes

and 

(--) VIA(0): Using SSE YUV42X copy for video.

(II) VIA(0): [XvMC] Registering viaXvMCPro.

(II) VIA(0): [XvMC] Initialized XvMC extension.

```

But(always a but isn't there?   :Crying or Very sad:  ) Mplayer and Xine dont work with Xvmc output. Mplayer says could not initialise -vo device and or -vf filter and Xine locks up my system when I try to use Xvmc output. 

I also used the Mplayer ebuild you provided that is patched for Unichrome(the 0.5 one from Sourceforge)

Note that  /etc/X11/XvMCConfig is set to libviaXvMCPro.so

Any ideas?

----------

## the_mgt

Hmm, drm is broken here, but videoplayback is fine.

No, i don't have any ideas. Don't know about that pro stuff...

While configuring, my mplayer ebuild should check for xvmce support. Lookout for that line, if it says no there, xvmc is not properly installed. If it says yes, i would say it is a bug or something...

----------

## Mr SA

Does xine lock-up the whole machine with a green screen on the media-player window?  I had one brief attempt with the patched mplayer and then gave up because it broke my rules for being close enough to being included in portage, but I have xine working using -V xxmc.

I found I had to recompile the libXvMCW.so library.  This was the biggest fiddle I faced because when downloaded in a tarball it isn't very Gentoo-friendly.  You can fix two out of the three problems with command line parameters to 'configure'.  configure x_libraries=/...  x_includes=/...

Run 'configure --help' to get reference of the options available.

I ran 'configure' with no parameters and looked at the items it failed on.  I was then able to find the unreferenced files on my install and give the correct x_libraries and x_includes entries to configure. 

The last fiddle I applied was a direct edit in one of the source files to include a header that wasn't getting referenced properly - after two months of trying I was getting a bit impatient at that stage.

----------

## Mr SA

>> Can you paste a link to the HowTo for the Ivor branch...

I got a long way just on the very brief README that Ivor includes - and yes, I was amazed.

The missing bits ref Ivor's work are:

libXvMCW.so

unichrome-3d download from sourceforge (/usr/lib/X11/modules/dri/unichrome_dri... and /usr/lib/X11/libGL.so.1.2 replacements)

----------

## the_mgt

Yeah, lixvmcW is hell!

On the unichromepage, the "simple" howto says, in order to check hw acc, you should download and compile the mp2player. Do not even think about that It simply does not work. This little bugger needed the Wrapper lib, so i installed that, which took me nearly a day or so. Since this was so painful and i deleted the mp2player and never touched it again. (Besides, the sample video they provide on their homepage is not really suitabe for testing purposes. But they wrote great software, thats what counts  :Wink:  )

So this was the only time i installed the wrapper, back in february or earlier, it seems to survive somehow on my system, because xine always works fine (most of the time i use mplayer). I think, the source directory of the wrapper could be somewhere on my harddisk, i could check if i changed the Makefile or something. But somehow i remember a loooooong ./configure line with an oodleplex of pathes to libs and stuff....

It would be worth an ebuild. Anybody took notes, when he/she installed it?

----------

## zefrer

I'm close to having MPlayer fully working, Xine is now working with the xxmc output mpeg2 plays at around 6-7% CPU usage.

 I'll post a complete writeup of what is required once everything is working but yeah Mr Sa you're right, Xine did lockup the machine with a green screen and I did have to configure the wrapper manually with both --libraries and --includes (includes fixes the missing XvMC.h file as well for me, it's in the X11 include directory)

 I wish these were included in portage   :Wink: 

----------

## Mr SA

Your 6-7% on xine is all gettign burnt up running alsa.  If you are able to output to a surround sound processor over the S/PDIF, you can get cpu to drop to 0%-1%.

To do this you need to make some changes in ~/.xine/config

 *Quote:*   

> 
> 
> audio.device.alsa_default_device:iec958
> 
> audio.device.alsa_front_device:iec958
> ...

 

I spent some time getting this far with the audio, but there are still some interesting quirks.  xine is translating digital audio to AC3 (with/without THX).  Even a DTS source arrives at the A/V processor as Dolby Digital AC3.  mplayer (which I have working on -vo xv) correctly passes through DTS sources over S/PDIF.

In the greater scheme of things this is very minor.

----------

## zefrer

A little out of topic but do you also have problems with the alsa snd_via82xx driver? I have to rmmod and modprobe it everytime it's restarted otherwise it doesn't downmix properly and plays everything at 48khz which results in very weird and nasty sound coming out the speakers.(hissing etc)

 Might try OSS later or see if that behaves better, I'm not too fond of alsa personally.

 For MPlayer, try the patch on Ivor's site http://myth.ivor.org/unichrome/mplayer-uni.diff on CVS MPlayer and compile it manually with 

```

./configure --enable-xvmc

```

 and run it with 

```
mplayer -vo xvmc -vc ffmpeg12mc
```

 It *should* work   :Question:   :Exclamation: 

----------

## Mr SA

have you got something like this in /etc/modules.d/alsa

 *Quote:*   

> 
> 
> alias snd-card-0 snd-via82xx
> 
> options snd-via82xx dxs_support=3 
> ...

 

have you got something like this in your ~/.asoundrc:

 *Quote:*   

> 
> 
> pcm.snd-via82xx {
> 
> 	type	hw
> ...

 

----------

## Shiryou

 *Quote:*   

> (WW) ****INVALID MEM ALLOCATION**** b: 0xe4000000 e: 0xe8000000 correcting 
> 
> (EE) VIA(0): [dri] DRIScreenInit failed.  Disabling DRI.

 

I get this on my EPIA SP1300. Still trying to get the darn thing working right. the so called SMART 5.1 isnt working either yet. But i guess thats another story. GLX gears is being a pain too!  :Sad: 

----------

## B.marc

 *Shiryou wrote:*   

>  *Quote:*   (WW) ****INVALID MEM ALLOCATION**** b: 0xe4000000 e: 0xe8000000 correcting 
> 
> (EE) VIA(0): [dri] DRIScreenInit failed.  Disabling DRI. 

 

For me it is the same problem. I'm using gentoo-sources (linux-2.6.13-gentoo-r5) with drm compiled as module and xorg-x11-6.8.99.15-r4. When I look into /var/log/Xorg.0.log I see this

```
(WW) ****INVALID MEM ALLOCATION**** b: 0xe0000000 e: 0xe4000000 correcting^G
```

and this

```
...

(II) VIA(0): 3D Engine has been initialized.

drmOpenDevice: node name is /dev/dri/card0

drmOpenDevice: open result is -1, (No such device)

drmOpenDevice: open result is -1, (No such device)

drmOpenDevice: Open failed

drmOpenDevice: node name is /dev/dri/card0

drmOpenDevice: open result is -1, (No such device)

drmOpenDevice: open result is -1, (No such device)

drmOpenDevice: Open failed

drmOpenByBusid: Searching for BusID PCI:1:0:0

drmOpenDevice: node name is /dev/dri/card0

drmOpenDevice: open result is -1, (No such device)

drmOpenDevice: open result is -1, (No such device)

drmOpenDevice: Open failed

drmOpenByBusid: drmOpenMinor returns -1023

drmOpenDevice: node name is /dev/dri/card1

drmOpenDevice: open result is -1, (No such device)

drmOpenDevice: open result is -1, (No such device)

drmOpenDevice: Open failed

drmOpenByBusid: drmOpenMinor returns -1023

...

```

This goes on until card 254, then again from 0 to 254 and the this message:

```
...

drmOpenDevice: node name is /dev/dri/card254

drmOpenDevice: open result is -1, (No such device)

drmOpenDevice: open result is -1, (No such device)

drmOpenDevice: Open failed

(II) VIA(0): [drm] drmOpen failed

(EE) VIA(0): [dri] DRIScreenInit failed.  Disabling DRI.

```

When I check /dev/dri it is empty! Could this be a problem of udev? When I call lsmod, I get this:

```
...

via                    37216  0 

drm                    59892  1 via

via_agp                 7616  1 

agpgart                29256  2 drm,via_agp
```

It looks like, as if all necessary modules are loaded. I created my first test xorg.cong with

```
Xorg -configure
```

I had to fix the mouse setting, but otherwise it looks OK to me. I can post it, if it helps.

Any ideas what is wrong? I hope it is something simple and not "the unichrome drivers are hot and sota, though errors can occur...".

Marc

p.s.: I have a epia sp 8000E. I want to run mythtv on it.

----------

## Shiryou

Can someone tell me all the steps for setting up 5.1 on such cards? This has always been a pet hate for me big-time!

Lets see, im using the SMART capability (I hope) since i've plugged in my rear and center speakers to the mic and line. On its own it doesnt do that much. I suspect the reason is, im playing MP3's and video which is essentially just a stereo sound. Im guessing, from what i've seen, i need to use .asoundrc to duplicate the sound with an optional lowpass filter. 

Annoyingly, in my alsamixer, I have LFE, Surround and all these mixers. Its just how do i get to use them i wonder? Im thinking its asoundrc isnt it? I need to send the sound both ways. Does anyone have an asoundrc that works? I tried the one off the alsa page with little success.

Cheers

----------

## adsmith

there's a surround config program with tests built into alsa: speaker-test

----------

## B.marc

 *B.marc wrote:*   

>  *Shiryou wrote:*    *Quote:*   (WW) ****INVALID MEM ALLOCATION**** b: 0xe4000000 e: 0xe8000000 correcting 
> 
> (EE) VIA(0): [dri] DRIScreenInit failed.  Disabling DRI.  
> 
> For me it is the same problem. I'm using gentoo-sources (linux-2.6.13-gentoo-r5) with drm compiled as module and xorg-x11-6.8.99.15-r4. When I look into /var/log/Xorg.0.log I see this
> ...

 

Forgot one more importent error message at the end of the log:

```
Backtrace:

0: X(xf86SigHandler+0x9e) [0x8082313]
```

What does this mean?

Marc

----------

## B.marc

OK, I compiled the kernel without drm and used  x11-drm instead. Still xorg-x11 does not work.

I have now a card in /dev/dri and when I look trough the log I do not find any line beginning with (EE). But at the end I still have the message:

```
Backtrace:

0: X(xf86SigHandler+0x9e) [0x8082313]

Fatal server error:

Caught signal 11.  Server aborting
```

Still no clue what this error is about. Also the warning about the invalid mem allocation is still there.

I will try to use the stable xorg-x11 version and patch it as described in http://gentoo-wiki.com/Unichrome. Perhaps this will work.

Marc

----------

## Shiryou

Out of curiosity, what glxgears speeds are people getting? Im using the drm from the Kernel 2.6.13 and they seem the same as the x11-drm i emerged not so long ago. Just curious i guess. Probably not going to make much difference on a non 3d card i guess.

----------

## the_mgt

I get very low framerates in glxgears, since drm isn't working on my config at all.... (but xvmc and xxmc do work fine)

Anybody around who tried the modular X stuff? Does it work out of the box?

I own my MII6000E for two years now, and i am sick of doing everything by hand. But i can't upgrade the whole box atm, because of dependency trouble starting with xorg which wants to upgrade to 7.something now, which is needed by tk which is needed by python (why does python depend on something depending on xorg?!?!).

Does modular xorg work out of the box, as the last 6.99 ebuilds?

----------

## eero

 *B.marc wrote:*   

> OK, I compiled the kernel without drm and used  x11-drm instead. Still xorg-x11 does not work.
> 
> I have now a card in /dev/dri and when I look trough the log I do not find any line beginning with (EE). But at the end I still have the message:
> 
> ```
> ...

 

What is your gcc version? How about CFLAGS? My Epia ME6000 used to work fine (what comes to XvMC, never bothered with dri) with gcc-3.3.6, xorg-x11-6.8.99.15-r4 and latest x11-drm. I decided to migrate to gcc-3.4.4 and after compiling xorg with --fomit-frame-pointer in CFLAGS I'm getting similar backtrace-message. I tried to take --fomit-frame-pointer away from CFLAGS and now I'm getting a bit more verbose backtrace:

```

Backtrace:

0: /usr/bin/X(xf86SigHandler+0x9e) [0x808245d]

1: [0xffffe420]

2: /usr/lib/modules/libxaa.so [0xb7ace8c7]

3: /usr/lib/modules/libxaa.so(XAACopyArea+0x1e1) [0xb7acf9cd]

4: /usr/bin/X [0x812d6eb]

5: /usr/bin/X(ProcCopyArea+0x1c3) [0x80aea8a]

6: /usr/bin/X(Dispatch+0x168) [0x80b2269]

7: /usr/bin/X(main+0x485) [0x80bbdfb]

8: /lib/libc.so.6(__libc_start_main+0xcf) [0xb7e58f3f]

```

There's also that warning about invalid mem allocation:

```

.....

(II) Primary Device is: PCI 01:00:0

(--) Assigning device section with no busID to primary device

(--) Chipset CLE266 found

(!!) VIA Technologies does not support or endorse this driver in any way.

(!!) For support please contact the driver maintainer or your X vendor.

(II) resource ranges after xf86ClaimFixedResources() call:

        [0] -1  0       0xffe00000 - 0xffffffff (0x200000) MX[B](B)

        [1] -1  0       0x00100000 - 0x3fffffff (0x3ff00000) MX[B]E(B)

--- SNIPS ---

       [23] -1 0       0x0000d400 - 0x0000d420 (0x21) IX[B]

        [24] -1 0       0x0000d000 - 0x0000d080 (0x81) IX[B]

(WW) ****INVALID MEM ALLOCATION**** b: 0xd8000000 e: 0xdc000000 correcting

(II) window:

        [0] -1  0       0xd8000000 - 0xdbffffff (0x4000000) MX[B]

.....

```

I'm compiling xorg with gcc-3.3.6 right now...

 *Quote:*   

> I will try to use the stable xorg-x11 version and patch it as described in http://gentoo-wiki.com/Unichrome. Perhaps this will work.

 

Let me know how it worked out.

----------

## eero

 *eero wrote:*   

> 
> 
> I'm compiling xorg with gcc-3.3.6 right now...
> 
> 

 

And behold: it works! The warning about invalid mem allocation is still there thou...

----------

## jazernorth

Hey,

Got an update and a question.

Your code:

```
#########################################################This part isntalls the XvMC library

cd /var/tmp/portage/xorg-x11-6.8.2-r2/work/xc/lib/XvMC/

make Makefiles

make

cd /var/tmp/portage/xorg-x11-6.8.2-r2/work/xc/lib/XvMC/hw/

cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/unichrome co libxvmc

ln -s libxvmc via

```

What I changed it to:

```
#########################################################This part isntalls the XvMC library

cd /var/tmp/portage/xorg-x11-6.8.99.15-r4/work/xc/lib/XvMC/

make Makefiles

make

cd /var/tmp/portage/xorg-x11-6.8.99.15-r4/work/xc/lib/XvMC/hw/

cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/unichrome co libxvmc

rm -Rf /var/tmp/portage/xorg-x11-6.8.99.15-r4/work/xc/lib/XvMC/hw/via

mv libxvmc via

#ln -s libxvmc via

```

I used the newer version because 6.8.2-r6 was no longer in Gentoo portage.

After I made that change, it compiled without any errors.

When I load X, I get a message 

```
(II) Loading extension XFree86-DRI

(EE) VIA(0): [dri] VIADRIScreenInit failed because of a version mismatch.

[dri] libDRI version is 5.0.0 but version 4.0.x is needed.

[dri] Disabling DRI.

```

How do I fix that, as it is not allowing XvMC to load.

Thanks.

JazerNorth

----------

## arnolde

Has anyone tried the new drivers from VIA yet? (Released 15.12.2005)

http://www.viaarena.com/Driver/p4m800ce-p4m800pro-cn-clexf40063-kernel-src_20051215.zip

```
   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.

[...]

Requirements:

xorg-x11-6.8.2-31.src.rpm

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
```

I guess I'll start getting my hands dirty...

----------

## _ping

Hi guys

I have the following Problem:

All Modules load succsesfully only the via module dosn`t.

This is the dmesg error message

```
via: Unknown symbol pci_pretty_name
```

what must I do

----------

## arnolde

Please also see https://forums.gentoo.org/viewtopic-t-418445-start-0-postdays-0-postorder-asc-highlight-.html since that is also discussing Unichrome Pro (CN400) related problems.

@_ping: This is just in gerneral, I'm sorry that won't answer your question either.

----------

## Sade

 *vishnoo wrote:*   

> Hi
> 
> I have a via unichrome and I'm happy to have the drm in the kernel 2.6.13.
> 
> The direct rendering is working using xorg-x11-6.8.99.15 and everything has became simple and almost "just works".
> ...

 

i get the exact same error, but x never starts.

i have the epia-pd it a cle266 based board.

i use the kernel 2.6.15-gentoo-r1 with the drm and agp stuf as amodule. and none of the other drivers.

and xorg-x11 6.99.15-r4

when i use xorg-x11 6.8.2 x starts normaly but dri doesn't work 

glxgears reports 60-80fps

still trying to get the unichrome drivers from the wiki to work, but i have this problem with cvs,

it reports not able to write to /tmp/serv****

----------

## Sade

a small update:

i've got 105 fps with the new xorg-x11-7 modular X (in stead of 70fps with 6.99).

i've used this howto: http://www.gentoo.org/proj/en/desktop/x/x11/modular-x-howto.xml

the install worked without a glitch, but i still don't have working dri. that's be the next step.

----------

## kurppa

With the current state of the Unichrome-drivers I wouldn't recommend the Epia's to anyone using gentoo and wanting a stable system. I haven't found a way to get Xorg 6.8.* working with SP13000 dispite all the available instructions.

Progress:

Following Gentoo Wiki Unichrome HOWTO:

 *Quote:*   

>  5.1. Emerging masked version - full
> 
> The current masked version of xorg-x11 has all the necessary drivers. This version is a snapshot of the soon-to-be-released xorg-x11 6.9 / 7.0.
> 
> Code: Emerge complete masked version
> ...

 

Well the SP13000 has the CN400 chipset so I go to the next section:

 *Quote:*   

>  6 Unichrome Pro A (CN400 Chipset)
> 
> In order to get hardware MPEG2 properly working on a CN400 chipset (for example the VIA EPIA SP13000), some extra steps are needed. For X-Windows 6.8 the Openchrome drivers need to be compiled for the CN400 to work properly. If you are running X-Windows 7 using the xf86-via-drivers you can skip the next section.
> 
> 6.1. Openchrome for X-Windows 6.8
> ...

 

Compile fails with http://www.openchrome.org/snapshots/unichrome/Latest.tar.bz2

 *Quote:*   

> via_accel.c: In function `viaInitExa':
> 
> via_accel.c:1273: error: structure has no member named `pixmapOffsetAlign'
> 
> via_accel.c:1274: error: structure has no member named `pixmapPitchAlign'
> ...

 

Using http://openchrome.org/snapshots/unichrome/unichrome-20051109.tar.bz2 instead, compile succeeds.

X doesn't start:

```
(WW) ****INVALID MEM ALLOCATION**** b: 0xe8000000 e: 0xec000000 correcting

Fulfilled via DRI at 13107200

Freed 13107200 (pool 2)

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

   *** be the reason for the server aborting.

Backtrace:

0: X(xf86SigHandler+0x9e) [0x80822c3]
```

----------

## orv

The exa API in Xorg is a moving target, so breakages will happen. Firstly try to use the svn version of the openchrome driver rather than the old snapshot.

----------

## kurppa

 *orv wrote:*   

> The exa API in Xorg is a moving target, so breakages will happen. Firstly try to use the svn version of the openchrome driver rather than the old snapshot.

 

The libxvmc-part of the SVN-version failed to compile. 

Seems that the problem starting Xorg was not connected to the unichrome driver. I had -Os in my make.conf and changing it to -O2 and re-emerging Xorg solved that problem. So far I haven't had time to test if X and unichrome now really work.

----------

## kurppa

I finally got X to work, but the image quality with 1600x1200 is really really bad.

I was supposed to use this board as my new desktop machine but the image quality makes it impossible. I'm going to continue using my old Athlon XP/Radeon 9200 machine.

I really don't know what the EPIAs are good for? Maybe an MPD box/firewall/router etc?

----------

## flysideways

kurppa,

Your SP1300 experience is not isolated. http://forums.viaarena.com/messageview.aspx?catid=32&threadid=68137&enterthread=y

I also have one and don't know what to do with it. I thought it'd be great for a low powered browsing machine for the family but the bad video makes it unusable for that. I used it as a pvr for a while but commercial flagging didn't work very well with such a slow processor. I may end up trying it as a mythtv frontend, not sure though.

Right now I am getting ready to use it to play with directfb since the unichrome is supposed to be well supported.

Ultimately, I suppose the real solution is a pci video card. I have found a few that even come with low profile brackets so it could be used in a small case but I really don't like spending more on what was a rather expensive board to begin with.

I hadn't bought via for about 4 years due to a previous experience and for some reason let the advertised specs seduce me on this board. Via actually answers the phone, so I guess it's time to start pestering them.

----------

## jmp_

Hi,

If you experience problems like BLACK SCREEN using "via" driver with Xorg you should try to enable VBEModes "true" in xorg.conf, that works for me. I've tried a lot of things, drivers... configs, and the only way to run Xorg without the vesa driver with my S3 unichrome card (by now) is using this option.

So I have some problems while loading XWindow sytem... selectwm2 and Gnome "welcome message" appears in a corner :S ... so after loading the gnome menu, etc. are in the correct way. Any comments about this ? [ SOLVED: by just setting HorizSync and VertRefresh in xorg.conf .]

 *Quote:*   

> 
> 
> Option "VBEModes" "boolean"
> 
>     The driver will set modes using BIOS similar to the way the vesa driver does. This is the default behaviour for Unichrome Pro in panel mode, which is otherwise not supported. Use this option only when the driver does not support your particular hardware.
> ...

 

I'm using a S3 Unichrome Pro VGA Adapter with a recent modular Xorg under Gentoo with GCC 4.1 (--fstack-protector-all) and a hardened 2.6.15 Kernel in a notebook with AMD Mobile 3000+ processor and 512MB RAM. 

He he, I saw a lot of people with the same problems, I think this card really SUCKS, you only should buy laptops or motherboards with nVidia or ATI chipsets... using Linux.

see u! greetings.

----------

## StarF

Hi

I am tryingt to set up a Via Epia -m 1000 board, with Unichrome support, in order to use it as a media box with freevo.

How ever i am having some problems, i cant seem to get X to work proberly, or get the unichrome support? isent there a easy install guide awaiable?

i tryed to follow the Wiki that is linked in this guide, but it fails here. I head there is unichrome support in the new vanilia sources is that right?

----------

