pelya / xserver-xsdl

XSDL - X.Org server ported to Android using SDL.
https://play.google.com/store/apps/details?id=x.org.server
Other
306 stars 55 forks source link

What about opengl support? #45

Open mittorn opened 9 years ago

mittorn commented 9 years ago

Lunixbochs pushed almost working implementaton of glshim proxy to unstable branch. So it is possible and easy to add opengl support now.

pelya commented 9 years ago

Still it requires huge amount of work to bind each glshim function to X server backend, also I don't know how to handle GLX requests from multiple windows, because we've got only one OpenGL context, but each X application should have separate OpenGL context.

On Fri, Jul 31, 2015 at 12:38 AM, mittorn notifications@github.com wrote:

Lunixbochs pushed almost working implementaton of glshim proxy to unstable branch. So it is possible and easy to add opengl support now.

— Reply to this email directly or view it on GitHub https://github.com/pelya/xserver-xsdl/issues/45.

mittorn commented 9 years ago

I mean only to add remote glshim server, but not implement AIGLX. glshim proxy will work parallel to xserver.

pelya commented 9 years ago

You seem to know more than me on that topic. How is it possible to run OpenGL server separately from X server?

Anyway, yoilu might wish to look into VirtualGL project (I did not try it), or proxy video through Xephyr (I succeeded running glxgears using it with awful speed) On Aug 3, 2015 10:44 PM, "mittorn" notifications@github.com wrote:

I mean only to add remote glshim server, but not implement AIGLX. glshim proxy will work parallel to xserver.

— Reply to this email directly or view it on GitHub https://github.com/pelya/xserver-xsdl/issues/45#issuecomment-127383796.

mittorn commented 9 years ago

glshims's proxy is interface similar to VirtualGL, but developed special for glshim. It was developed for ExaGear Desktop because x86 process cannot load GLES drivers. I'm planning to make server as separate android application (maybe as persistent overlay), but it is more effective to implement it in xserver itself, where you can get drawable parameters from xserver and set correct gl view size.

underdoeg commented 8 years ago

Out of curiosity. Did anyone ever get virtualGL to run with XServer xsdl?

RootLUG commented 6 years ago

Hello, If someone is still researching this then I just had a success with being able to run glxgears using gl4es to shim opengl (issue linked above) so it now looks very promising!

ankushlohiya001 commented 5 years ago

@RootLUG, pls help me to use opengl in xserver sdl

e-cl commented 5 years ago

Can i have instructions on how you did this?

pelya commented 5 years ago

OpenGL in XSDL is not possible right now

On Fri, 22 Mar 2019, 16:41 e-cl, notifications@github.com wrote:

Can i have instructions on how you did this?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pelya/xserver-xsdl/issues/45#issuecomment-475646796, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJewOhHmN5JsUeVQmSfhjmLT9LifFToks5vZOuOgaJpZM4FjF8J .

e-cl commented 5 years ago

@RootLUG, please could you advise on compiling and using gl4es with chroot on android as you already did that. What options should i use to build for proper device, i have mali t880 gpu. Thank you.

RootLUG commented 5 years ago

@ankushlohiya001 @e-cl Here are instructions, it's quite simple. It's important to note that I was compiling it on an intel CPU android tablet (Yoga Book), you will most likely have ARM which is different architecture but might still work if you use the instructions for raspberry pi. I used the "UserLAnd" app (pchroot) for the environment (Ubuntu). Afterwards just follow this instructions: https://github.com/ptitSeb/gl4es/blob/master/COMPILE.md ; you might need to install cmake, buildtools and some other libraries to be able to compile the shim. Originally I used the "-DBCMHOST=1" flag for raspberry but I noticed it also worked when compiled without specifying platform. Use it via LD_LIBRARY_PATH as described in docs/readme. You would probably also need to tweak the flags according to "Usage" docs for your device, for example I needed to force GLES 2.0 backend for it to work. Afterwards, I runned XSDL normally and tested it with glxgears. As you can see, the OpenGL is done via a completely separate software emulation from XSDL, which is why @pelya is mentioning this approach would not work to be integrated directly to XSDL. It's just a server receiving calls waht to draw, OpenGL is interpreted on the client itself.

For those that want to research OpenGL on android, I found other 2 approaches but wasn't able to get neither of them work (however it could work in principle:

Edit: a disclaimer that the info above might not be correct, my knowledge of OpenGL/Android/XServer is very limited and those are just notes when I was researching on how to get it working.

e-cl commented 5 years ago

@RootLUG Thank you for prompt responce. It may be offtopic to xsdl, but i don't know other way of contacting you. So i'll ask here. Yes, my goal is to use hardware gpu acceleration on linux running in chroot/proot on android. I saw your post somewhere about getting success with the same thing. The problem is my knowlege is very very limited. I have two arm devices, one with adreno gpu, othe with mali. On rooted one with adteno i use linux deploy, on non-rooted userland. I'm running ubuntu as guest. I did manage to compile gl4es, but it complained on libgles absrnse. I found one in mesa package, installed it, then i could run glxgears but in software mode judging by the low fps. So my question is how to get hardware gpu acceleration. Do i need some kind of drivers for guest ubuntu or do i just need libgles library from vendor or what else? I stumbled apon libhybris project, i'll try, the problem is i can't mount android /system in guest ubuntu for some reason. If you could advise a little. Thank you

mittorn commented 5 years ago

gl-streaming is not enough now. It supports small subset (smaller than webgl) I added support for client arrays, now it runs with gl4es, but it still not draw anything. Need verify shader state github.com/mittorn/gl-streaming gl4es does not seems to send any uniforms

mittorn commented 5 years ago

Other way is virgl, but it will not work correctly on most devices https://vk.com/video146179717_456239081

mittorn commented 5 years ago

https://vk.com/video_ext.php?oid=146179717&id=456239081&hash=ad7eceeb38d22559&__ref=vk.kate_mobile&api_hash=1553376932eb831ba4926a4703d1_GE2DMMJXHE3TCNY

PSzczepanski1996 commented 4 years ago

Sorry I will ask about, but that's crazy. X11 got builded/ported for iOS and it seems to have OpenGL support - https://maxleiter.com/X11/#contribute

I don't quite understand how he ran Mesa on it. Is it something helpful for Android boyz?

pelya commented 4 years ago

Mesa is a software renderer. You could install it in Debian with package libgl1-mesa-swx11, but it got removed from Debian 10.

On Sat, 25 Jan 2020, 13:22 Hoshi Yamazaki, notifications@github.com wrote:

Sorry I will ask about, but that's crazy. X11 got builded/ported for iOS and it seems to have OpenGL support - https://maxleiter.com/X11/#contribute

I don't quite understand how he ran Mesa on it. Is it something helpful for Android boyz?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pelya/xserver-xsdl/issues/45?email_source=notifications&email_token=AABF5QEL7R6N5SGJIYRCPSLQ7QOGFA5CNFSM4BMML4E2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ42PUQ#issuecomment-578398162, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABF5QCEO3WLR6TNRWV2X4TQ7QOGFANCNFSM4BMML4EQ .

SUFandom commented 1 year ago

@ankushlohiya001 @e-cl Here are instructions, it's quite simple. It's important to note that I was compiling it on an intel CPU android tablet (Yoga Book), you will most likely have ARM which is different architecture but might still work if you use the instructions for raspberry pi. I used the "UserLAnd" app (pchroot) for the environment (Ubuntu). Afterwards just follow this instructions: https://github.com/ptitSeb/gl4es/blob/master/COMPILE.md ; you might need to install cmake, buildtools and some other libraries to be able to compile the shim. Originally I used the "-DBCMHOST=1" flag for raspberry but I noticed it also worked when compiled without specifying platform. Use it via LD_LIBRARY_PATH as described in docs/readme. You would probably also need to tweak the flags according to "Usage" docs for your device, for example I needed to force GLES 2.0 backend for it to work. Afterwards, I runned XSDL normally and tested it with glxgears. As you can see, the OpenGL is done via a completely separate software emulation from XSDL, which is why @pelya is mentioning this approach would not work to be integrated directly to XSDL. It's just a server receiving calls waht to draw, OpenGL is interpreted on the client itself.

For those that want to research OpenGL on android, I found other 2 approaches but wasn't able to get neither of them work (however it could work in principle:

  • https://github.com/shodruky-rhyammer/gl-streaming which is a project for streaming the OpenGL over network to another host and sending results back to client
  • https://github.com/libhybris/libhybris -> This project is a layer to translate glibc calls to bionic and vice versa. OpenGL calls on normal PC vs android are completely different so layer like this is needed or software emulation to get OpenGL working. Libhybris is normally used to get Linux os or other OS working on android devices by bridging the calls to propertiary bionic drivers. In those cases the main os is something like Linux and android is running inside as container, what you guys want is complete opposite, main os android and other os inside the container/pchroot. I think it might be possible to do it also the other way around via libhybris but I'm not an expert in that and anyway, it would probably be completely out of scope of XSDL due to how it works (separate project).

Edit: a disclaimer that the info above might not be correct, my knowledge of OpenGL/Android/XServer is very limited and those are just notes when I was researching on how to get it working.

I think I would rather create my own server with this support, after I learned how to work with some apps and sruff