3

I've tried to access my Raspberry Pi(running Raspbian) using SSH with -X flag. On my host machine(Ubuntu 14.04 x64), I can run graphic programs like browser, however, when I want to execute the sample program of OpenGL ES with EGL from /opt/vc/src/hello_pi/hello_triangle, it cannot display the window. I tried to use HDMI with Raspberry Pi and run it on itself, it works.

Could anyone tell me why? Is EGL here using X11 to get the native window or not?

4
  • I don't have a solution for you, although I believe there is one; the problem may be that while you can forward openGL applications, you can't do it if the source is using hardware acceleration, e.g.: unix.stackexchange.com/questions/149705/optirun-and-ssh-x
    – goldilocks
    Commented Mar 10, 2015 at 15:20
  • Also: superuser.com/questions/196838/…
    – goldilocks
    Commented Mar 10, 2015 at 15:22
  • Thanks Goldilocks. I guess it might be the EGLGetDisplay failed since there's no monitor connecting with it directly, but not try yet. I'll update after this trial later tonight.
    – Han
    Commented Mar 10, 2015 at 15:27
  • There is a Mesa libGLES -- Mesa is the non-hardware accelerated OGL. I'm sure the pi doesn't use it by default though. It just uses mesa for non-ES stuff, I think.
    – goldilocks
    Commented Mar 10, 2015 at 15:43

1 Answer 1

4

ssh's -X sets the DISPLAY environment variable such that all X requests are sent to the host. EGL has no X11 wire protocol, so EGL can't be forwarded to your host's X Server. For EGL, you'd need to run the application on an X Server on the Pi, then use something like lightpipe to scrape the pixels on the Pi's X Server and forward them to your host. It'll be terribly slow, because reading pixels back is hard.

If you were running a GLX application instead it might work (though GLX is fairly crippled relative to direct rendering). Note that this may not do what you were expecting -- it seems like you want to be using the Pi's hardware rendering and just see its output, which is not how X11 forwarding works and a lightpipe-like application is the solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.