Author Topic: OpenGL ES2 and Linux and pi - now with patches!  (Read 35465 times)

0 Members and 1 Guest are viewing this topic.

Re: OpenGL ES2 and Linux and pi - now with patches!
My R-Pi arrived, and I spent a good deal of the weekend figuring out which of my large collection of SD cards worked well in it.  It looks like the great majority of them are at least functional, but for the moment I'm setting up Gentoo mainly on an 8GB USB drive, so the SD card only holds boot components and a swap partition.  As should be expected, compiling stuff takes a while, but the FPU seems to be relatively competent which will definitely help.

So far the power meter I inserted under the PSU is consistently reading under 4 watts at the wall.  That's including the USB flash drive, but I haven't really exercised the 3D engine yet.

Once Gentoo is working properly, I should be able to explore what precisely I can do with the 3D accelerator and under what circumstances the sound output works.  The sound unfortunately doesn't seem to be a standard ALSA or OSS device, which might need to be corrected sharpish if OpenAL is going to work.  One thing is clear: we are independent of X11 for 3D work.

I also have two other ARM boxes which at least nominally support OpenGL ES 2, but the R-Pi is my primary target.  If it runs there, it should run quite easily on the others too.

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Re: OpenGL ES2 and Linux and pi - now with patches!
My R-Pi arrived, and I spent a good deal of the weekend figuring out which of my large collection of SD cards worked well in it.  It looks like the great majority of them are at least functional, but for the moment I'm setting up Gentoo mainly on an 8GB USB drive, so the SD card only holds boot components and a swap partition.  As should be expected, compiling stuff takes a while, but the FPU seems to be relatively competent which will definitely help.
cross-compiling might work here?

Quote
One thing is clear: we are independent of X11 for 3D work.
Oh? and how do you expect to make it run FSO then?

(not trying to sound condescending, but my experience with linux in that area is sketchy at best, so i'd like some clarification, if possible)
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: OpenGL ES2 and Linux and pi - now with patches!
thats one of the advantages to using a compiler. a majority of the code is basic math and logic, which should work right of the bat. some of it api interfaces, which likely use the same interfaces as the x86 linux builds and therefore is covered. i figure most of the work, aside from substitutions for libraries that dont work on arm, will be finding areas of code which can be optimized for arm architecture, and address those until the game engine is stable and runs with decent performance. its not something id attempt, im not that good of a programmer.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline qazwsx

  • POST DRUNK GET TITLE
  • 29
    • Minecraft
Re: OpenGL ES2 and Linux and pi - now with patches!
Recieved an email from farnell yesterday, mine has been shipped.
<Achillion> I mean, it's not like he's shoving the brain-goo in a usb slot and praying to kurzweil to bring the singularity

<dsockwell> idk about you guys but the reason i follow God's law is so I can get my rocks off in the afterlife

 
Re: OpenGL ES2 and Linux and pi - now with patches!
There will be a few things that need to be changed, the biggest amount of work being (as previously mentioned) replacing all the GL calls that were obsolete 10 years ago and therefore don't exist in OpenGL ES, and updating the rest so that they all use shaders by default.  All without breaking compatibility with old desktop cards that don't support shaders at all.

Normal FSO opens an X11 window as part of obtaining a GL context to render to.  The 3D stuff on the R-Pi doesn't work that way - you get a framebuffer surface from somewhere else, and then obtain a GLES context on that using EGL.  At least one of the other machines will require an X11 window to pass to EGL as "normal".  The practical upshot is that on the R-Pi you will be starting FSO from the text console, without an X11 server hogging half the RAM and VRAM before you've even started to load models and textures.  This affects only a very small bit of code related to game startup.

The sound being non-standard is a concern, but if need be I can plug in an external USB soundcard which will be visible to ALSA and thence OpenAL in the normal way.  Linux is sufficiently flexible that way.  If I need to do that, I can raise hell with some people to get the internal sound wired up properly, which will help all the other R-Pi users (approaching 100k now, I think).

Compiling is slow mostly, I think, because the ARM11 core only decodes and issues one instruction per cycle.  Most modern CPUs deal with two or three instructions per cycle if the stars are aligned right, and they have corresponding numbers of ALUs to absorb that flow.  For floating-point-heavy stuff (ie. most of the heavy work when running a game) this doesn't matter so much because there is usually only one FPU pipeline, so as long as the FPU and GPU are competent - and I think they are - we should get good game performance.

 

Offline ShivanSpS

  • 210
Re: OpenGL ES2 and Linux and pi - now with patches!
I was about to suggest to just forget about R-PI and its ARM11 cpu and think about AllWinner A10 cpu board, those things just kicked out VIA 8650 as a cheap solution, there is a huge number of cheap tablets running these, and a lot of TVBox are coming, it comes with a minimum of 512MB ram, its ARMv7 (A8) 1 to 1.5ghz, Mali-400 gpu (a bit weaker than R-PI one), native SATA and a 2160P/3D high bitrate and multi format video decoder, not important for FS2(maybe for cutscenes), but is a great indication that those things will be invading TVBox market soon.

And one mayor point is, A10 load u-boot from external SDCard as Primary Boot, so basicly you insert a SDcard loaded with a Linux in ANY A10 device and thats it, its running Linux in less than 30seconds....
This is when i tested it in my Novo 7 Aurora tablet -> http://i.imgur.com/ovTLH.png its as easy as it sounds. and these of another user http://i.imgur.com/6pH5a.jpg
Devices with A10 are a bit expensive than R-PI, there is the Mele A1000 and MK802 TVBoxes.

BUT X11 lacks GPU hardware/OpenGL ES support at this moment(as well the video decoder), but its coming, as well XBMC. But its something to have in consideration... R-PI is not the only choice.
http://www.j1nx.nl/multimedia/openelec-xbmc-mele-a1000-update/
« Last Edit: June 20, 2012, 10:06:43 pm by ShivanSpS »

 
Re: OpenGL ES2 and Linux and pi - now with patches!
If it runs on R-Pi, it'll run quite easily on almost anything else.  Also, I actually have one now.  That's why I'm using it as a target.

 

Offline ShivanSpS

  • 210
Re: OpenGL ES2 and Linux and pi - now with patches!
Last night i was VERY BORED and i was playing with Lubuntu on my A10 tablet testing Java SE Embedded, etc, and i decided to compile FSO on it just for the fun of it, but THIS was unexpected...



Why is even working? I still dont have X11 running on the Mali gpu, and even if was, its OpenGL ES, there is a full opengl running on software there, somehow.
« Last Edit: July 01, 2012, 05:22:08 am by ShivanSpS »

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: OpenGL ES2 and Linux and pi - now with patches!
^^thats pretty impressive.

hey how much did you all have to pay shipping on your pis (to us)? i got the money for mine, though it seems i have to sit on a waiting list for some time before im even allowed to attempt ordering anything.
« Last Edit: July 01, 2012, 05:39:34 am by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Re: OpenGL ES2 and Linux and pi - now with patches!
Shivansps, ever heard of the mesa drivers?
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 
Re: OpenGL ES2 and Linux and pi - now with patches!
Yes indeed, you're looking at the Mesa software rasteriser there.  It's not fast by any stretch of the imagination, it's just there so that OpenGL apps (generally *not* games) will always work.

Try running glxinfo | less.

 

Offline Tomo

  • 28
Re: OpenGL ES2 and Linux and pi - now with patches!
hey how much did you all have to pay shipping on your pis (to us)? i got the money for mine, though it seems i have to sit on a waiting list for some time before im even allowed to attempt ordering anything.
UK-based here, but Farnell (CPC, Element14) were offering their price inclusive of shipping when I registered on launch day, turned out to be £30 inc VAT & P&P.

Was able to order back in May, and it's finally en-route to me as I post this!

They are starting to catch up with demand, it'll take a while though - IIRC the original batch was 10,000 but they had orders for 100,000 in the first few hours.
The manufacturing ramp-up has been quite extraordinary.

(Can't help but think somebody high-up at Broadcom owes Eben and co one heck of a bar bill.)

 

Offline ShivanSpS

  • 210
Re: OpenGL ES2 and Linux and pi - now with patches!
Yeah its there...
Code: [Select]
miniand@miniand:/lib$ dpkg --get-selections | grep mesa
libegl1-mesa                                    install
libegl1-mesa-drivers                            install
libgl1-mesa-dev                                 install
libgl1-mesa-dri                                 install
libgl1-mesa-glx                                 install
libglapi-mesa                                   install
libgles2-mesa                                   install
libglu1-mesa                                    install
libglu1-mesa-dev                                install
libopenvg1-mesa                                 install
mesa-common-dev                                 install

It should have come with libbsd-dev.
Thats what it says glxinfo too after ive installed the mesa-tools...

Im suprised it can even hit 4fps with a software renderer on something weak as a Cortex A8... i think A10 processors will have no problems running FS2 at all, and R-PI has a much better GPU.

BTW, what about the insane number of "deprecated conversion from string constant to 'char*'" while compiling?
« Last Edit: July 01, 2012, 05:11:31 pm by ShivanSpS »

 
Re: OpenGL ES2 and Linux and pi - now with patches!
I got the impression that 4fps is as low as the FSO frame counter will read - so probably you aren't really getting that much.  At those levels you should be able to count frames manually, though.  It's sensible to have a limit somewhere in that region, so that overloading your machine doesn't permanently lock up your game.

I have another game which puts the low limit as high as 14fps.  Below that framerate it does not run in realtime.  This is rather problematic for a train simulator, where low fps is tolerable (train controls take a second or so to respond anyway) but running at variable speeds is not (due to judging braking distances to stop accurately in platforms).  This is not helped by the inefficient rendering engine (I think it might actually be *worse* than stock FSO if you can believe it) and the increasingly detailed objects and scenery involved.  Framerates are usually similar to Crysis on the same hardware, and without the quality.

 

Offline jg18

  • A very happy zod
  • 210
  • can do more than spellcheck
Re: OpenGL ES2 and Linux and pi - now with patches!
BTW, what about the insane number of "deprecated conversion from string constant to 'char*'" while compiling?

See here, but basically, you can ignore them. The SCP is working on ensuring that they don't appear in the future.

 

Offline ShivanSpS

  • 210
Re: OpenGL ES2 and Linux and pi - now with patches!
It starts at 2fps and them moves to 4fps and it gets stuck there, so you may be right.
Is such a shame that something with potent gpu, like R-PI to have a ARM11 cpu... with that gpu it may even display full mediavps at 1080P, i dont think that Mali-400 will be able to handle anything more than stock vps...

But well, we'll see once its done.
And as long i have this tablet i can run FS2 tests on his ARMv7 cpu once we get the code update :P

EDIT: jg18:
Thanks, i see, i trought it was the ARM compiler giving trouble.
« Last Edit: July 01, 2012, 07:23:55 pm by ShivanSpS »

 
Re: OpenGL ES2 and Linux and pi - now with patches!
Well, I did find that the Pentium-3 laptop I tried was very much limited by it's GPU - a Rage128.  Actually, it seemed to be mostly limited by the relative lack of VRAM for the textures.  This is with retail binaries and data - the Rage128 drivers for WinXP didn't seem to support OpenGL, so I couldn't run FSO at all.

The ARM11's FPU is relatively powerful compared to the rest of the CPU - it can be used very much like a Cray-1, firing off vectors of operations to complete in sequence and in parallel - and seems to be on par with the Pentium 3 at the same clock speed (assuming an ordinary compiler rather than hand optimisation).  Indeed, if the compiler doesn't use the SSE versions of the FP instructions, the P3 gets a significant penalty to multiply and add throughputs because x87 instructions always run at extended precision.  The ARM11 can pipeline independent single-precision multiply-adds at one per cycle, which is on par with many relatively modern CPUs (Bulldozer and PPC970 can do better without SIMD, Sandy Bridge can't).  It seems that ARM decided that if you were bothering to fit an FPU, you probably really needed it!

The ARM11 is also more closely coupled to the memory than a Pentium-3.  Remember that in those days, Intel still attached the memory via the separate Northbridge chip, which introduced a lot of latency compared to an on-die memory controller as used today.  The Northbridge in the laptop is the ubiquitous i440BX, which has fairly poor latency.  The ARM11 has to share memory access with the GPU, but the latency should still generally be lower than a northbridge design would be.

So the main handicaps that the ARM11 has compared to the P3 is the decode/issue bandwidth of one instruction per cycle, versus up to three for Intel, and the lack of wide SIMD support.  It remains to be seen how important that is in practice - I suspect it really isn't very important.

 

Offline ShivanSpS

  • 210
Re: OpenGL ES2 and Linux and pi - now with patches!
But i trought it where GPU limited because of using old OpenGL code. Fixing GPU programing will likely cause CPU usage to increase, overall it will be always better, but im sure that will be CPU limited on R-PI, and memory... well, i dont know if the amount of shared ram will be enoght for mediavps...
Im angry about it because this is something ive be telling in the R-PI forum since i found out about that thing, 128/256mb was a poor choice of ram, ARM11 a bad choice for cpu also its video decode is not good enoght to be a good choice for HTPC, they say its for "programing" ARM11 for programing, yeah ok, with those compiling times...

But anyway, if its slow, i can always test on a A10, Mali-400 will be the bottleneck here for sure :P But with 1GB of ram, there is a nice margin to play with, even with X11 running, even wxlauncher works ok.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: OpenGL ES2 and Linux and pi - now with patches!
Quote
Im angry about it because this is something ive be telling in the R-PI forum since i found out about that thing, 128/256mb was a poor choice of ram, ARM11 a bad choice for cpu also its video decode is not good enoght to be a good choice for HTPC, they say its for "programing" ARM11 for programing, yeah ok, with those compiling times...

And what, in your infinite wisdom, would have been a better choice, given the R-Pi budget constraints?
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline ShivanSpS

  • 210
Re: OpenGL ES2 and Linux and pi - now with patches!
The next bcm processor that is ARMv7 and minimum 512mb ram, 10 bucks more or less is still cheap. (as BCM its the only choice for them)
Have you see the number of people complaining about the lack of instruccion sets? compiling times, or that the XBMC UI is slow? even using hardware GLES.
Its cheap, but it was too late and too little, its powerfull gpu is its only streght, but its like having a HD7950 with a Pentium 3 and 200mb of ram... GPGPU is the only good thing that it may come out of it, and R-PI gpu does not support it because its not using programable shaders, and its code locked too...

Im not saying is too bad, it is a good iniciative, but it seems like a wasted opportunity. I hope they step up cpu and ram in the next model...
« Last Edit: July 02, 2012, 02:39:25 am by ShivanSpS »