Is it forbidden to run SDL apps from X11 on the Pi?

(I think this deserves its own thread because it’s quite important IMHO.)

So yesterday, Gabriel Jacobo made the following remark: “…and also, don’t be running X11 on the RPi
when you try your apps.” Is this really true? There is no word about it in the README. It only says:
“Works without X11” but not “ONLY works without X11”…

I’ve tried to run my apps from X11 and they work but there is the problem that all mouse clicks are
forwarded to the desktop below my fullscreen display which could potentially have disastrous consequences
because the user could accidentally mess up his whole system because clicks go through to the desktop
without the user realizing this, e.g. it could happen that files are deleted or moved, programs started,
etc. A lot of damage is imaginable here.

So it looks like it would be wise to run SDL apps without X11. On the other hand, from a user’s point
of view, it is quite ugly if SDL apps aren’t usable from X11. For normal users it’s a real hassle to
be forced to log out of X11 and start SDL apps from a barebones console.

Is there no way to make SDL apps cooperate nicely with X11? If there isn’t, I think it should really
be mentioned in the README that running SDL apps from X11 can have disastrous consequences because
mouse clicks are forwarded to the desktop without the user noticing because the whole display is
filled by the SDL app…–
Best regards,
Andreas Falkenhahn mailto:@Andreas_Falkenhahn

I made the RPi backend, it’s designed to run without X11, since X11
consumes resources which were scarse on the original hardware, and working
under the assumption that given SDL already supports X11 if you wanted to
run apps under X11 you could just use the X11 video backend (which in
practice may or may not work, I’ve never tried).

The RPi backend accesses the hardware drivers and kernel services directly,
so I never expected it to play well with another app that does the same
thing (namely, X11). Is it impossible to achieve? No idea. If you care
about this, I encourage you to try it out, document what you find out and
submit a patch for the README so the community can benefit from your
experience.

Gabriel.

2016-09-14 11:02 GMT-03:00 Andreas Falkenhahn :> (I think this deserves its own thread because it’s quite important IMHO.)

So yesterday, Gabriel Jacobo made the following remark: “…and also,
don’t be running X11 on the RPi
when you try your apps.” Is this really true? There is no word about it in
the README. It only says:
“Works without X11” but not “ONLY works without X11”…

I’ve tried to run my apps from X11 and they work but there is the problem
that all mouse clicks are
forwarded to the desktop below my fullscreen display which could
potentially have disastrous consequences
because the user could accidentally mess up his whole system because
clicks go through to the desktop
without the user realizing this, e.g. it could happen that files are
deleted or moved, programs started,
etc. A lot of damage is imaginable here.

So it looks like it would be wise to run SDL apps without X11. On the
other hand, from a user’s point
of view, it is quite ugly if SDL apps aren’t usable from X11. For normal
users it’s a real hassle to
be forced to log out of X11 and start SDL apps from a barebones console.

Is there no way to make SDL apps cooperate nicely with X11? If there
isn’t, I think it should really
be mentioned in the README that running SDL apps from X11 can have
disastrous consequences because
mouse clicks are forwarded to the desktop without the user noticing
because the whole display is
filled by the SDL app…


Best regards,
Andreas Falkenhahn mailto:andreas at falkenhahn.com


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.

I made the RPi backend, it’s designed to run without X11, since X11
consumes resources which were scarse on the original hardware, and
working under the assumption that given SDL already supports X11 if
you wanted to run apps under X11 you could just use the X11 video
backend (which in practice may or may not work, I’ve never tried).

Well, it’ll probably only work with the software renderer which is
most likely too slow on the Pi. That’s why your backend is the only
really useful one because it supports GPU acceleration.

The RPi backend accesses the hardware drivers and kernel services
directly, so I never expected it to play well with another app that
does the same thing (namely, X11).

Good to know. Still, I’m wondering why you didn’t mention this in
the README? I mean, 99.9% of the users will want to run SDL on
X11 I’d estimate. And this can potentially be fatal because the
X11 desktop lives on underneath SDL’s framebuffer and it will receive
every input event originally designated for SDL.

Is it impossible to achieve? No
idea. If you care about this, I encourage you to try it out,
document what you find out and submit a patch for the README so the
community can benefit from your experience.

Well, I don’t know anything at all about programming the hardware
drivers and kernel services of the Pi directly so it’s hard for me
to tell which potential issues could arise from using X11 and
your backend at the same time. I think you should be in a much
better position to judge this because you wrote it :slight_smile:

However, if the only real issue is the problem that X11 lives on
underneath the SDL display, I think this could be solved by opening
a fullscreen X11 shielding window which simply makes it impossible
to access the X11 desktop below. Then you’d have the following
setup:

a) Framebuffer managed by RPI backend --> on top of -->
b) fullscreen SDL shielding window (using _NET_WM_STATE_FULLSCREEN)
to make sure no input ever reaches the X11 desktop --> on top of -->
c) X11 desktop

This could solve the problem of input events designated for SDL to
reach the X11 desktop but I’m not sure whether there are any other
issues. Currently, I haven’t found any and it works quite nicely
on top of X11 but as I said, I don’t know what’s going on under
the hood, that’s where you’re the expert here :)On 14.09.2016 at 16:16 Gabriel Jacobo wrote:


Best regards,
Andreas Falkenhahn mailto:@Andreas_Falkenhahn

Is there no way to make SDL apps cooperate nicely with X11? If there isn’t,
I think it should really
be mentioned in the README that running SDL apps from X11 can have
disastrous consequences because
mouse clicks are forwarded to the desktop without the user noticing because
the whole display is
filled by the SDL app…

As I mentioned earlier in the other thread, if this really is
important for you, you should try the official experimental OpenGL
driver for Pi.

That driver is designed to address all the issues you are concerned
about. (Caveat: it doesn’t address the memory consumption requirements
that Gabriel was concerned about.)

Since nobody else has tried it yet and reported back, we’d all be
interested in hearing the details of how it works.

-Eric

Is there no way to make SDL apps cooperate nicely with X11? If there isn’t,
I think it should really
be mentioned in the README that running SDL apps from X11 can have
disastrous consequences because
mouse clicks are forwarded to the desktop without the user noticing because
the whole display is
filled by the SDL app…

As I mentioned earlier in the other thread, if this really is
important for you

Hmm, isn’t it important for you too? I mean, what do you tell your Blurrr
users? Something like: “Blurrr supports the Pi but it only works without
X11”? … not too convincing :wink:

you should try the official experimental OpenGL
driver for Pi.
https://www.raspberrypi.org/blog/another-new-raspbian-release/

Well, I think it’s clear that we’ll get proper OpenGL support on the Pi
sooner or later but still, I’m wondering whether the existing RPI backend
can’t be modified to prevent input being routed through to X11. If this
could be done without going to great pains, why not do it? But as I said,
I’m not the one to judge/assess the feasability because I have no idea
what’s going on under the hood.

Since nobody else has tried it yet and reported back, we’d all be
interested in hearing the details of how it works.

To tell you the truth, I’m not very keen on trying out experimental
things on Linux because I still consider myself a Linux beginner and
I think chances are high that I’ll end up with a messed up system
after those tests and the only way out is a reinstall…On 15.09.2016 at 00:37 Eric Wing wrote:


Best regards,
Andreas Falkenhahn mailto:@Andreas_Falkenhahn

The simple answer is that what you want is not possible without the
experimental driver. That’s why they have been developing the driver
and made a big deal about it, and why I keep pointing you to it.

As for making games, X11 in the background is a big tradeoff due to
the memory consumption. Most games run exclusively and do not benefit
from X11. Trading off constrained resources on the Pi is not a
decision to be taken lightly. As an example, there have been plenty of
websites I’ve visited that get my browser process killed because they
consume too much RAM. This is with nothing else open and a single tab.

-EricOn 9/15/16, Andreas Falkenhahn wrote:

On 15.09.2016 at 00:37 Eric Wing wrote:

Is there no way to make SDL apps cooperate nicely with X11? If there
isn’t,
I think it should really
be mentioned in the README that running SDL apps from X11 can have
disastrous consequences because
mouse clicks are forwarded to the desktop without the user noticing
because
the whole display is
filled by the SDL app…

As I mentioned earlier in the other thread, if this really is
important for you

Hmm, isn’t it important for you too? I mean, what do you tell your Blurrr
users? Something like: “Blurrr supports the Pi but it only works without
X11”? … not too convincing :wink:

you should try the official experimental OpenGL
driver for Pi.
https://www.raspberrypi.org/blog/another-new-raspbian-release/

Well, I think it’s clear that we’ll get proper OpenGL support on the Pi
sooner or later but still, I’m wondering whether the existing RPI backend
can’t be modified to prevent input being routed through to X11. If this
could be done without going to great pains, why not do it? But as I said,
I’m not the one to judge/assess the feasability because I have no idea
what’s going on under the hood.

Since nobody else has tried it yet and reported back, we’d all be
interested in hearing the details of how it works.

To tell you the truth, I’m not very keen on trying out experimental
things on Linux because I still consider myself a Linux beginner and
I think chances are high that I’ll end up with a messed up system
after those tests and the only way out is a reinstall…

Is there no way to make SDL apps cooperate nicely with X11? If there
isn’t,
I think it should really
be mentioned in the README that running SDL apps from X11 can have
disastrous consequences because
mouse clicks are forwarded to the desktop without the user noticing
because
the whole display is
filled by the SDL app…

As I mentioned earlier in the other thread, if this really is
important for you

Hmm, isn’t it important for you too? I mean, what do you tell your Blurrr
users? Something like: “Blurrr supports the Pi but it only works without
X11”? … not too convincing :wink:

you should try the official experimental OpenGL
driver for Pi.
https://www.raspberrypi.org/blog/another-new-raspbian-release/

Well, I think it’s clear that we’ll get proper OpenGL support on the Pi
sooner or later but still, I’m wondering whether the existing RPI backend
can’t be modified to prevent input being routed through to X11. If this
could be done without going to great pains, why not do it? But as I said,
I’m not the one to judge/assess the feasability because I have no idea
what’s going on under the hood.

Since nobody else has tried it yet and reported back, we’d all be
interested in hearing the details of how it works.

To tell you the truth, I’m not very keen on trying out experimental
things on Linux because I still consider myself a Linux beginner and
I think chances are high that I’ll end up with a messed up system
after those tests and the only way out is a reinstall…

The simple answer is that what you want is not possible without the
experimental driver. That’s why they have been developing the driver
and made a big deal about it, and why I keep pointing you to it.

As for making games, X11 in the background is a big tradeoff due to
the memory consumption. Most games run exclusively and do not benefit
from X11. Trading off constrained resources on the Pi is not a
decision to be taken lightly.

Ok, but such information should really go into the README for the Pi.
Currently, it sounds like the Pi backend can be run on top of X11.
There is no word on that the backend was specifically designed to run
without X11. It’s mentioned that it “works without X11” but this sounds
more like a feature, not like a constraint…On 15.09.2016 at 22:57 Eric Wing wrote:

On 9/15/16, Andreas Falkenhahn <@Andreas_Falkenhahn> wrote:

On 15.09.2016 at 00:37 Eric Wing wrote:


Best regards,
Andreas Falkenhahn mailto:@Andreas_Falkenhahn

Andreas Falkenhahn wrote:

Ok, but such information should really go into the README for the Pi.
Currently, it sounds like the Pi backend can be run on top of X11.
There is no word on that the backend was specifically designed to run
without X11. It’s mentioned that it “works without X11” but this sounds
more like a feature, not like a constraint…

I totally agree.

Richard.