pez-globo / pufferfish-software

All software for the Pufferfish ventilator.
Apache License 2.0
0 stars 1 forks source link

Kiosk mode #64

Closed ethanjli closed 4 years ago

ethanjli commented 4 years ago

We will need to figure out a way to run the web browser (Firefox ESR 68.9.0) in kiosk mode, so that the browser starts in full-screen mode with a URL of our choosing. We will also need to figure out how we might prevent the user from exiting kiosk mode, as well as how to disable the panels (but in a way that we can re-enable them during development).

Ideally we would also be able to disable various UI elements we might not want (e.g. right-click context menu, swipe gestures for going backwards/forwards if the browser naturally picks up those swipe gestures, etc.). It'd also be great if we could minimize the number of extensions loaded, including any extensions which come with Firefox by default - maybe some of these configurations would be saved in a user profile which we could copy onto the filesystem from our deploy script?

Additionally, if Firefox crashes, we want to suppress any "bug reporting" pop-up windows.

ethanjli commented 4 years ago

It turns out that Firefox ESR does not have kiosk mode, so we'll need to find another alternative to Firefox ESR. Here are some options to try out on the Raspberry Pi, in order of increasing estimated difficulty:

ethanjli commented 4 years ago

Because I needed to reinstall Firefox ESR on my Raspberry Pi, I decided to install a few other browsers in the package manager so I (re-)tested the following browsers:

So I think we can rule out trying to install any other "standard" web browsers.

ethanjli commented 4 years ago

I just did some quick experiments:

I once again reviewed the CPU usage pattern in Chromium, and it looks like CPU usage is only unacceptably high after there are a lot of points to replot on the screen (i.e. the waveform is at the right end of the plot). This suggests that it may be possible to optimize plotting in a way I had previously thought of (essentially splitting the waveform into smaller separate-but-overlapping segments, so that only the newest segment needs to be redrawn); and it may be acceptable to redraw at a lower framerate but add a segment of points on each redraw, instead of redrawing upon every new point. With these optimizations, it should be possible to support 2 live plots smoothly in Google Chrome, but I think only experimentation will let us determine whether we can support 3 live plots smoothly in Google Chrome which would be needed for the V2 UI design.

ethanjli commented 4 years ago

According to this forum post, Firefox 71 is available on Ubuntu for the Raspberry Pi: https://www.raspberrypi.org/forums/viewtopic.php?p=1602724#p1602724 . If it turns out that there is no way we can get Chromium to have acceptable performance, this could be a reasonable backup option - but switching to Ubuntu might be a very drastic change from the perspective of OS/deployment configuration so I think that is the last resort.

ethanjli commented 4 years ago

I tried the Modern Kiosk extensions for Firefox very briefly. It does make a Kiosk mode, but it doesn't/can't autostart in kiosk mode, so it's a no-go.