www.mellander.org
NFS-Root | CLE266 HW MPEG |

HOWTO use the hardware mpeg decoding capabilities using libcle266mpegdec and softdevice.



Document history:

20081125: Updated working hardware. ( Thanks to Torgeir Veimo ).
20071211: The HOWTO is reinstalled on a new server. Sorry for the long downtime.
20070108: viafb field-sync issue adressed by Mark Adams.
20070104: Softdevice CVS does not need patching anymore. ( Reported by Axel Uhl )
20061110: Release of version 0.5
20061010: DirectFB/DFB++ does not need patching anymore.
20060918: Added known working hardware ( EPIA M6000 ).
20060913: Added info about options for TV output.
20060911: Release of version 0.4
20060906: libcle266mpegdec is now available at Sourceforge
20060714: libcle266mpegdec-0.2 released.
20060711: First release.

Abstract:

The goal of this HOWTO is to make vdr + softdevice ( DirectFB ) with hardware mpeg decoding running on an EPIA MII 12000. The CLE266 exists in some other EPIA models and it shouldn't be any different than this install. I was writing this HOWTO when I setup my EPIA-MII 12000 so it's primary a way for me to remember how to do it on a Fedora Core 5 system. Please bare in mind that it might differ on some points from your own distro.

To get more info how the library actually works, read the threads on softdevice-devel mailing list.

Known working hardware:

EPIA MII 12000 ( cle266 )
EPIA M 10000 ( cle266 )
EPIA M 6000 Please note that softdevice must be configured with --disable-mmx2. Framedrops every 20-30sec are reported.
MSI MS-6723 ( cle266, vt1623 tv encoder )

Install:

We need the kernel tree later, so it's a good thing to start with a pretty new kernel. In fact the only thing I changed was the CPU type and the local version.


CONFIG_LOCALVERSION="-epia-1"
CONFIG_MVIAC3_2=y


# cd /usr/src/
# tar jxf /tmp/linux-2.6.17.3.tar.bz2
# ln -s linux-2.6.17.3/ linux
# cd linux
# make menuconfig
# make && make modules_install && make install

Reboot your machine and select the proper kernel.


# init 6


# uname -r
2.6.17.3-epia-1

Now to the actual install. Check out latest linux-viafb from DirectFB. Make and insert. Check with fbset -i that you have a working framebuffer.


# cd /usr/local/src
# cvs -d:pserver:anonymous@cvs.directfb.org:/cvs/directfb login
# cvs -d:pserver:anonymous@cvs.directfb.org:/cvs/directfb -z3 co -P linux-viafb
# cd linux-viafb/
# make
# make insert
# fbset -i
Frame buffer device information:
Name : UNICHROME
Address : 0xd8000000
Size : 33288192
Type : PACKED PIXELS
Visual : TRUECOLOR
XPanStep : 0
YPanStep : 1
YWrapStep : 0
LineLength : 2880
MMIO Address: 0xdc000000
MMIO Size : 16777216
Accelerator : Unknown (77)

# cd ..

Download and install ffmpeg, DirectFB and DFB++.


# svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
# cd ffmpeg/
# ./configure --enable-shared --enable-pp --enable-gpl
# make
# make install
# make install-libs
# cd ..

Install libcle266mpegdec, the library that provides the decoder access.
The library are now available here (Thanks to Rolf Ahrenberg)
Latest version on Sourceforge is 0.5


# tar zxf libcle266mpegdec-0.X.tar.gz
# mv libcle266mpegdec-0.X.tar.gz /root
# cd libcle266mpegdec-0.X/
# ./configure
# make
# make install
# cd ..

DirectFB and DFB++ cvs have framebuffer offset patches included from Oct 2006. No need to patch.


# cvs -d:pserver:anonymous@cvs.directfb.org:/cvs/directfb -z3 co -P DirectFB
# cd DirectFB/
# ./autogen.sh
# ./configure --with-gfxdrivers=cle266,unichrome
# make
# make install
# cd ..
# cvs -d:pserver:anonymous@cvs.directfb.org:/cvs/directfb -z3 co -P DFB++
# cd DFB++/
# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
# ./autogen.sh
# make
# make install
# cd ..

Create a directfbrc.


# more /etc/directfbrc
fbdev=/dev/fb0
mode=720x576
depth=32
pixelformat=ARGB
disable-module=cle266
no-vt

The actual vdr and softdevice install.


# wget ftp://ftp.cadsoft.de/vdr/vdr-1.4.1.tar.bz2
# mv vdr-1.4.1.tar.bz2 /root
# tar jxf /root/vdr-1.4.1.tar.bz2
# cd vdr-1.4.1/PLUGINS/src/
# mv * /tmp
# cvs -d:pserver:anonymous@cvs.softdevice.berlios.de:/cvsroot/softdevice login
# cvs -d:pserver:anonymous@cvs.softdevice.berlios.de:/cvsroot/softdevice co softdevice
# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Please notice! If you're running a M6000 you must configure softdevice with --diasable-mmx2!
# ./configure --disable-mmx2

# ./configure
Checking for ffmpeg... Ok.
Checking for DirectFB and DFB++... Enabled video-dfb.
Checking for vidix... Not found.
Checking for libcle266mpegdec ... Enabled cle266 hardware decoding.
Checking for Xv... Enabled video-xv.
Checking for Xinerama... Enabled Xinerama.
# cd /usr/local/src/vdr-1.4.1/
# make
# make plugins

To start vdr with softdevice and the hardware support, the following options are available:


viatv     TV-out enable.
cle266    Enable Via hardware decoding support.

It's possible to use both TV-out and HW-support at the same time aswell.
For this you use "-vo dfb:cle266:viatv"

# cd /usr/local/src/vdr-1.4.1
# ./vdr -P"softdevice -vo dfb:cle266"


If you have problem with field parity when using TV-out, Mark Adams has made two patches for viafb/dfb.
Search the softdevice mailing list for latest info concerning this matter.
Latest info can be found here

Mark Adams recently wrote:

I've just committed the extension to viafb itself and also put the
DirectFB patch in with it. I haven't put the DirectFB patch into
DirectFB itself because I don't want to make DirectFB dependant on
that version of viafb -- people are using various different ones.
Someone could, if they felt like it, modify the patch so that it
detects whether the required ioctl is available and then enable its
use automatically but I don't have the time at present.


Conclusion:

How good does it work? Well I tested by running it with and without hardware support and this is what I got:

Without hardware support,

# ./vdr -P"softdevice -vo dfb:"
# vmstat 1
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
0 0 128 276208 11248 146056 0 0 0 0 535 709 71 3 26 0
0 0 128 276208 11248 146056 0 0 0 0 546 681 72 3 25 0
0 0 128 276208 11248 146056 0 0 0 0 540 693 71 3 26 0
0 0 128 276208 11248 146056 0 0 0 0 555 706 66 6 28 0
0 0 128 276208 11248 146056 0 0 0 0 529 687 70 3 27 0

With hardware support,

# ./vdr -P"softdevice -vo dfb:cle266"
# vmstat 1
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
0 0 128 279928 11036 146056 0 0 0 0 533 716 26 4 70 0
0 0 128 279928 11036 146056 0 0 0 0 548 719 29 3 68 0
0 0 128 279928 11036 146056 0 0 0 0 535 720 30 4 66 0
0 0 128 279928 11036 146056 0 0 0 0 550 727 28 3 69 0
0 0 128 279928 11036 146056 0 0 0 0 527 699 30 4 66 0

With hardware support we can see a decrease from about 70% load down to 30% which is quite nice.

Special thanks go to:

Laz for putting the libcle266mpegdec together.
Rolf Ahrenberg for maintaining libcle266mpegdec package.
Stefan Lucke and Martin Wache for the softdevice plugin.


If you have any suggestions to make this HOWTO better, or if there's any errors within it. Please contact me at per (at) mellander dot org.

2014-09-02 23:06:48