adoptware / pinball

Emilia Pinball : A Libre pinball simulator for GNU Linux
https://purl.org/rzr/pinball
GNU General Public License v2.0
29 stars 15 forks source link

Support Ubuntu core #21

Open rzr opened 3 years ago

rzr commented 3 years ago

Feel free to test current snap package at:

https://snapcraft.io/pinball

I suspect some issues with audio or startup, testers feedback welcome.

rzr commented 3 years ago

If you want to test on virtual machine as explained at: https://discourse.ubuntu.com/t/getting-started/19737

Then just run:

snap install --candidate mir-kiosk ; snap info mir-kiosk
snap install --edge pinball ; snap info pinball
snap list
Name       Version                     Rev    Tracking          Publisher   Notes
core20     20201210                    904    latest/stable     canonical✓  base
mir-kiosk  2.3.2-snap117               6525   latest/candidate  canonical✓  -
pc         20-0.4                      115    20/stable         canonical✓  gadget
pc-kernel  5.4.0-66.74.1               722    20/stable         canonical✓  kernel
pinball    0.3.20201218+git69.24d3ecd  20     latest/edge       rzr         -
snapd      2.49                        11107  latest/stable     canonical✓  snapd

It works using software rendering:

Mar 11 10:19:24 ubuntu pinball.daemon[2609]: Vendor     : Mesa/X.org
Mar 11 10:19:24 ubuntu pinball.daemon[2609]: Renderer   : llvmpipe (LLVM 11.0.0, 128 bits)
Mar 11 10:19:24 ubuntu pinball.daemon[2609]: Version    : 3.1 Mesa 20.2.6

Some warnings should be investigated, though

sudo journalctl -u snap.pinball.daemon
Mar 11 10:19:22 ubuntu pinball.daemon[2604]: _XSERVTransSocketCreateListener: failed to bind listener
Mar 11 10:19:22 ubuntu pinball.daemon[2604]: Failed to initialize glamor, falling back to sw
Mar 11 10:19:25 ubuntu pinball.daemon[2609]: ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
Mar 11 10:19:24 ubuntu pinball.daemon[2618]: >                   X11 cannot support keycodes above 255.

I also tried on RPi3 but there is a rendering issue/freeze in table modes (I suspect something odd in offscreen swap rendering)

Vendor     : Broadcom
Renderer   : VC4 V3D 2.1
Version    : 2.1 Mesa 20.2.6

Note to self, sed line may be removed once this change is merged:

https://github.com/MirServer/xwayland-kiosk-helper/pull/5

cc: @AlanGriffiths

AlanGriffiths commented 3 years ago

Have you considered using stage-snaps: [mir-kiosk-x11] as described in https://ubuntu.com/tutorials/x11-kiosk?

rzr commented 3 years ago

Thanks @AlanGriffiths

Yes this works too but I wish window to be displayed fullscreen this is the reason I kept using i3 hack from

https://github.com/MirServer/xwayland-kiosk-helper/blob/master/xwayland-preload/xwayland-kiosk-launch

May this launcher be merged into:

https://github.com/MirServer/mir-kiosk-x11-snap/tree/main/env-setup/hacks

Anyway I didn't want to use X11 in the first place but wayland since this project is using SDL2 and it is working fine on ubuntu classic see this video clip on RPi3 :

https://youtu.be/4Ja4TNmBSFc?t=46

But for some reason using wayland launcher for Mir does not display anything, while log did not look suspicious, any hints welcome? (Is Mir stack supporting legacy opengl or only GLES ?)

If interested to replicate this issue I'll open a ticket and push a branch.

AlanGriffiths commented 3 years ago

Anyway I didn't want to use X11 in the first place but wayland since this project is using SDL2 and it is working fine on ubuntu classic see this video clip on RPi3 :

Yes, SDL2/Wayland works on mir-kiosk/Ubuntu Core/RPi3. See, for example, mir-kiosk-neverputt,

But for some reason using wayland launcher for Mir does not display anything, while log did not look suspicious, any hints welcome?

https://ubuntu.com/tutorials/wayland-kiosk

(Is Mir stack supporting legacy opengl or only GLES ?)

Mir is irrelevant here. The kernel graphics stack on Ubuntu Core is the same as on Ubuntu Classic. But you do need to include the Mesa userspace libraries in your snap as described in the above tutorial.

If interested to replicate this issue I'll open a ticket and push a branch.

From what you said, it seems likely the issue is in your snap.

rzr commented 3 years ago

Current snap works fine on qemu using wayland-launch

Menus are displaying fine on RPi3 (with this fullscreen option: https://github.com/adoptware/pinball/commit/23fba2b1947ac35ac1c5a4d6ed5edf14547efa7c) but play mode might suffer some locking or double buffer issues, I didn't investigate yet. But I noticed that while playing the table can be refreshed if paused and resumed (hit Esc, select play).

Note that the ubuntu classic image is working as expected on Pi3 but it uses weston compositor not Mir. it can be downloaded from https://github.com/adoptware/pinball/issues/16 Soon or later I'll trace the rendering part to compare with real x86_64 machine.

For portrait display I am tracking this Mir feature: https://github.com/MirServer/mir/pull/1643

rzr commented 3 years ago

Some updates on Pi4, it work pretty fast on default config (landscape view) it's about 40 fps with prof table. for the record:

rzr@ubuntu:~$ snap list
Name       Version                      Rev    Tracking          Publisher   Notes
core20     20210319                     974    latest/candidate  canonical✓  base
mir-kiosk  2.3.2-snap117                6526   latest/stable     canonical✓  -
pi         20-1                         89     20/candidate      canonical✓  gadget
pi-kernel  5.4.0-1029.32                249    20/candidate      canonical✓  kernel
pinball    0.3.20201218+git101.800be65  94     latest/beta       rzr         -
snapd      2.50                         11843  latest/candidate  canonical✓  snapd

rzr@ubuntu:~$ sudo snap logs -nall pinball
2021-05-05T13:57:25Z pinball.daemon[942]: Vendor     : Broadcom
2021-05-05T13:57:25Z pinball.daemon[942]: Renderer   : V3D 4.2
2021-05-05T13:57:25Z pinball.daemon[942]: Version    : 2.1 Mesa 20.2.6

I may try again with pi3 to understand is GPU is powerful enough

rzr commented 3 years ago

Hi, Some updates about this effort

I built a demo image (on worst table) for amd64 (it works with virtual box):

curl -O https://bashupload.com/ZLYFb/cfep0.gz#./file/pinball-table-hurd-core20-amd64-pc.img.gz

It's super easy to rebuild using this helper makefile: https://github.com/rzr/pinball-table-hurd/tree/master/snap/image

More investigations should be done for Pi3 or Pi4 (I need a UART cable to troubleshoot):

https://forum.snapcraft.io/t/built-uc20-rasperry-pi-image-hangs-on-boot/23891/19?u=rzr

BTW, I'll present those works at next LibreGraphicsMeeting 2021:

Packaging status

Last but not least, I proposed this as an appliance:

https://discourse.ubuntu.com/t/propose-new-appliance-emilia-pinball-pincab-profile/22214

Feedback welcome here or on fediverse: https://mastodon.social/@rzr/106210478055984663#lgm2021

Cc: @Rhys-Davies, @sil2100, @dbungert

AlanGriffiths commented 3 years ago

For portrait display I am tracking this Mir feature

I'm not sure what you mean. That PR landed last year, long before you decided to "track" it.

rzr commented 3 years ago

Yes I confirm portrait works in mir, Thanks @AlanGriffiths for that. I've been using it in "gnu" image, I'll push changes soon.