Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: tlhingan on September 23, 2013, 09:41:48 PM

Title: [Debian R3 and R4] Installing Mali Binary Drivers
Post by: tlhingan on September 23, 2013, 09:41:48 PM
These instructions (http://linux-sunxi.org/Binary_drivers) are a bit wonky to follow for a n00b, so here's what is hopefully a simpler and more complete rewrite of those instructions.

edit /etc/modules to add
ump
mali
mali_drm


create a file in /etc/udev/rules.d/ called "50-mali.rules" containing
KERNEL=="mali", MODE="0660", GROUP="video"
KERNEL=="ump", MODE="0660", GROUP="video"


reboot
after loging in, type "lsmod" and make sure "mali" and "ump" are listed
then
apt-get install build-essential xorg-dev xutils-dev libdrm-dev x11proto-dri2-dev libltdl-dev libtool automake
git clone https://github.com/linux-sunxi/sunxi-mali.git
cd sunxi-mali
git clone https://github.com/robclark/libdri2
cd libdri2
./autogen.sh --prefix=/usr
make
make install
cd ..
git submodule init
git submodule update
make install
cd ..
git clone https://github.com/ssvb/xf86-video-sunxifb.git
cd xf86-video-sunxifb
autoreconf -vi
./configure --prefix=/usr
make
make install
cp xorg.conf /usr/share/X11/xorg.conf.d/99-sunxifb.conf
Title: Re: [Debian R3 and R4] Installing Mali Binary Drivers
Post by: tlhingan on September 23, 2013, 09:48:54 PM
I guess one could copy/paste the last block into a script file.
I'll try that next time I need to setup another image.
Title: Re: [Debian R3 and R4] Installing Mali Binary Drivers
Post by: exotic on September 25, 2013, 12:19:31 PM
After doing all this, startx say : no screens found!

Any help please.
Title: Re: [Debian R3 and R4] Installing Mali Binary Drivers
Post by: jeanyves on September 25, 2013, 02:32:04 PM
Quote from: tlhingan on September 23, 2013, 09:41:48 PM
These instructions (http://linux-sunxi.org/Binary_drivers) are a bit wonky to follow for a n00b, so here's what is hopefully a simpler and more complete rewrite of those instructions.

apt-get install build-essential xorg-dev xutils-dev libdrm-dev x11proto-dri2-dev libltdl-dev libtool automake
git clone https://github.com/linux-sunxi/sunxi-mali.git
cd sunxi-mali
git clone https://github.com/robclark/libdri2
cd libdri2
./autogen.sh
make
make install
cd ..
git submodule init
git submodule update
make install
cd ..
git clone https://github.com/ssvb/xf86-video-sunxifb.git
cd xf86-video-sunxifb.git
autoreconf -vi
./configure --prefix=/usr
make
make install
cp xorg.conf /usr/share/X11/xorg.conf.d/99-sunxifb.conf


You sould probably replace

cd xf86-video-sunxifb.git

with cd xf86-video-sunxifb



Title: Re: [Debian R3 and R4] Installing Mali Binary Drivers
Post by: exotic on September 25, 2013, 03:44:07 PM
Yes this is a mistake in the script, but is not the problem
Title: Re: [Debian R3 and R4] Installing Mali Binary Drivers
Post by: tlhingan on September 25, 2013, 07:29:42 PM
Quote from: jeanyves on September 25, 2013, 02:32:04 PM
You sould probably replace

cd xf86-video-sunxifb.git

with cd xf86-video-sunxifb
Yes!
Thanks for catching that!
Top post edited to reflect changes.
:)
Title: Re: [Debian R3 and R4] Installing Mali Binary Drivers
Post by: tlhingan on September 25, 2013, 07:33:11 PM
Quote from: exotic on September 25, 2013, 12:19:31 PM
After doing all this, startx say : no screens found!
Any help please.
Yes, there's a mistake in the provided configuration file.
Change the driver specified in 99-sunxifb.conf from "fbturbo" to "fbdev".
Top post edited to reflect changes.
Title: Re: [Debian R3 and R4] Installing Mali Binary Drivers
Post by: exotic on September 26, 2013, 06:52:41 PM
With modification in conf file startx is now OK.
I was thinking that installing mali driver will improve mplayer performance with HD video but in fact no.
Is this normal?
Title: Re: [Debian R3 and R4] Installing Mali Binary Drivers
Post by: progmetalbg on September 26, 2013, 07:29:10 PM
Quote
I was thinking that installing mali driver will improve mplayer performance with HD video but in fact no.
Is this normal?

Mali is the GPU driver.
AllWinner's multimedia (video & image) acceleration co-processor is called CedarX and its open source support in Linux is in alpha state at the moment (although I think it is well supported in Android via some binary blob).
http://linux-sunxi.org/CedarX (http://linux-sunxi.org/CedarX)
You can try changing mplayer renderer to gl or gl2 (OpenGL).
Title: Re: [Debian R3 and R4] Installing Mali Binary Drivers
Post by: tlhingan on September 30, 2013, 11:21:04 PM
Edited top post to include /usr prefix for the libdri2 autogen
Also added mali_drm as a module to load.
And this does work quite nicely as a script.
Title: Re: [Debian R3 and R4] Installing Mali Binary Drivers
Post by: neslekkim on October 01, 2013, 11:17:05 AM
Does this mean that these drivers are not installed on the image one can download on this site, or is this for those who create their own?
Title: Re: [Debian R3 and R4] Installing Mali Binary Drivers
Post by: Lurch on October 01, 2013, 01:11:07 PM
They are not on the downloadable image - not everyone needs them.
You can use this procedure to download and install them on the image you downloaded.
Title: Re: [Debian R3 and R4] Installing Mali Binary Drivers
Post by: neslekkim on October 01, 2013, 01:31:25 PM
*need* ? :)
It will give faster graphics i guess?, if I manage to get everything up,I want to use the a20 for mediastreaming, but heaps of debian stuff to learn first.
Title: Re: [Debian R3 and R4] Installing Mali Binary Drivers
Post by: tlhingan on October 01, 2013, 05:40:26 PM
Edited top post to remove the editing step of xorg.conf.
fbturbo now loads with this config.

To make a scrip file out of the code:
Title: Re: [Debian R3 and R4] Installing Mali Binary Drivers
Post by: woodward on December 04, 2013, 01:46:36 AM
Thank you so much for these instructions. They executed without error, but I don't see a difference in performance. I am testing with glxgears "apt-get install mesa-utils" (I know not the best benchmark, but it is easy to get). I ran glxgears with and without the mali module from a terminal in lightdm and from ssh with "Xorg" then "glxgears -display :0". The frames per second were around 40.

I am testing with the debian-release5 image from olimex. Also, my display is the 10" lcd from olimex if that matters.

Are you guys seeing a speed up with the binary drivers? I certainly may have messed something up during my install. Thank you
Title: Re: [Debian R3 and R4] Installing Mali Binary Drivers
Post by: denjell on December 16, 2013, 02:54:27 PM
I just wrote up a how-to to get the CedarX (VPU) working. I now have h264-1080p video running without frame dropping and perfect audio sync in mplayer. :)

https://www.olimex.com/forum/index.php?topic=2291.msg10079 (https://www.olimex.com/forum/index.php?topic=2291.msg10079)
Title: Re: [Debian R3 and R4] Installing Mali Binary Drivers
Post by: sanzoghenzo on February 11, 2014, 03:49:24 PM
Quote from: woodward on December 04, 2013, 01:46:36 AM
Thank you so much for these instructions. They executed without error, but I don't see a difference in performance. I am testing with glxgears "apt-get install mesa-utils" (I know not the best benchmark, but it is easy to get). I ran glxgears with and without the mali module from a terminal in lightdm and from ssh with "Xorg" then "glxgears -display :0". The frames per second were around 40.

I am testing with the debian-release5 image from olimex. Also, my display is the 10" lcd from olimex if that matters.

Are you guys seeing a speed up with the binary drivers? I certainly may have messed something up during my install. Thank you
I'm trying to get decent speed on emulated arcade games, so it's not entirely related to gpu driver, but acceleration should give some boost. Using metal slug on advancemame ad benchmark, I didn't notice any improvement. using open box instead of xfce and starting only advancemenu+advancemame was the only thing that increased (still poor) performances.

I tried to start glxgears, too, and have the same results, maximum 40fps or so. I wonder if it's the maximum capability of this GPU or if the driver is poorly implemented...