Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Ubuntu core #21

Open
rzr opened this issue Mar 10, 2021 · 9 comments
Open

Support Ubuntu core #21

rzr opened this issue Mar 10, 2021 · 9 comments

Comments

@rzr
Copy link
Collaborator

rzr commented Mar 10, 2021

Feel free to test current snap package at:

https://snapcraft.io/pinball

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

rzr added a commit that referenced this issue Mar 10, 2021
snap maybe be restarted to show up

This could be improved with GLES port to drop GLX dep
and then xwayland to use SDL2's wayland backend.

cmake trick might be fixed upstream too

Change-Id: Iced9c4f250254b78ce8ae12c295ecb21c0133c8f
Relate-to: #21
Signed-off-by: Philippe Coval <rzr@users.sf.net>
rzr added a commit to CrossStream/xwayland-kiosk-helper that referenced this issue Mar 10, 2021
I have observed that Ubuntu core-20 installs to
/usr/local so this should be updated

Relate-to: adoptware/pinball#21
Signed-off-by: Philippe Coval <rzr@users.sf.net>
rzr added a commit that referenced this issue Mar 10, 2021
snap maybe be restarted to show up

This could be improved with GLES port to drop GLX dep
and then xwayland to use SDL2's wayland backend.

cmake trick might be fixed upstream too

Change-Id: Iced9c4f250254b78ce8ae12c295ecb21c0133c8f
Relate-to: #21
Relate-to: https://github.com/scout208/x11kiosk/blob/master/snap/snapcraft.yaml
Relate-to: MirServer/xwayland-kiosk-helper#5
Signed-off-by: Philippe Coval <rzr@users.sf.net>
rzr added a commit that referenced this issue Mar 10, 2021
Title can be retrieved using xwininfo on Xorg

Resolution maybe be manually adjusted,

Full path are used to revent rentrance

Change-Id: Ibf5a71da0b6b5fe56ddcf4ed5c7811c6632c8500
Relate-to: #21
Signed-off-by: Philippe Coval <rzr@users.sf.net>
rzr added a commit that referenced this issue Mar 10, 2021
Title can be retrieved using xwininfo on Xorg

Resolution maybe be manually adjusted,

Full path are used to revent rentrance

Change-Id: Ibf5a71da0b6b5fe56ddcf4ed5c7811c6632c8500
Relate-to: #21
Signed-off-by: Philippe Coval <rzr@users.sf.net>
@rzr
Copy link
Collaborator Author

rzr commented Mar 11, 2021

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:

MirServer/xwayland-kiosk-helper#5

cc: @AlanGriffiths

@AlanGriffiths
Copy link

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

@rzr
Copy link
Collaborator Author

rzr commented Mar 15, 2021

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
Copy link

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 added a commit that referenced this issue Mar 16, 2021
Thanks-to: https://github.com/MirServer/mir-kiosk-neverputt/
Relate-to: #21
Signed-off-by: Philippe Coval <rzr@users.sf.net>
Change-Id: Icd6c76474da18ebd4d0d8724a6b75d07a7f48f3d
@rzr
Copy link
Collaborator Author

rzr commented Mar 21, 2021

Current snap works fine on qemu using wayland-launch

Menus are displaying fine on RPi3 (with this fullscreen option:
23fba2b)
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 #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:
canonical/mir#1643

rzr added a commit that referenced this issue Mar 31, 2021
Refactor a bit, add Period to optimize FPS division

It was also tested in Ubuntu-Core on Pi3 at 0.30 FPS
Using VC4 V3D 2.1 backend from GL 2.1 Mesa 20.2.6.

While Ubuntu classic on weston is way faster,
I'll may check again with Mir on next classic Release.

Relate-to: #21
Signed-off-by: Philippe Coval <rzr@users.sf.net>
Change-Id: I544a7407d0cec5eb3def99c1353a7eb27193de9f
rzr added a commit that referenced this issue Mar 31, 2021
Refactor a bit, add Period to optimize FPS division

It was also tested in Ubuntu-Core on Pi3 at 0.30 FPS
Using VC4 V3D 2.1 backend from GL 2.1 Mesa 20.2.6.

While Ubuntu classic on weston is way faster,
I'll may check again with Mir on next classic Release.

Relate-to: #21
Signed-off-by: Philippe Coval <rzr@users.sf.net>
Change-Id: I544a7407d0cec5eb3def99c1353a7eb27193de9f
rzr added a commit that referenced this issue Apr 2, 2021
Fix perf issue, resetTick before looping
The other one may be removed but I am not sure yet.

Tested on Pi3 it's about 12fps with ubuntu-core:

  PINBALL_SPEED=100 PINBALL_TABLE=professor sudo snap -R run pinball
  Renderer   : VC4 V3D 2.1 Version    : 2.1 Mesa 20.2.6

Signed-off-by: Philippe Coval <rzr@users.sf.net>
Relate-to: #21
Change-Id: I24174b4961dcb36c49dddfed834aca9f3a1439d2
@rzr
Copy link
Collaborator Author

rzr commented May 5, 2021

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 added a commit to adoptware/pinball-table-gnu that referenced this issue May 7, 2021
Pincab works on Ubuntu Core 10 on RPi4 (~23 FPS)

Few configuration steps:

```
sudo snap install mir-kiosk
cat <<EOF | sudo tee /var/snap/mir-kiosk/current/miral-kiosk.display
layouts:
  default:
    cards:
    - card-id: 0
      HDMI-A-1:
        mode: 1024x768@60.0
        orientation: left

package=pinball-table-gnu
sudo snap install --devmode ${package}
sudo snap connections ${package} | grep -- '-' | grep -v ' :' | cut -f1 -d' ' \
| while read plug ; do sudo snap connect ${package}:$plug  ; done ;
sudo snap set ${package} daemon=true
```

For the record:

```sudo snap list
Name               Version                     Rev    Tracking         Publisher   Notes
core18             20210309                    2002   latest/stable    canonical✓  base
core20             20210319                    974    latest/stable    canonical✓  base
lxd                4.13                        20319  latest/stable/…  canonical✓  -
mir-kiosk          2.3.2-snap117               6526   latest/stable    canonical✓  -
pinball-table-gnu  0.0.20200601+git13.5d54821  x2     -                -           devmode
snapd              2.49.2                      11584  latest/stable    canonical✓  snapd
```

Relate-to: adoptware/pinball#21
Signed-off-by: Philippe Coval <rzr@users.sf.net>
Change-Id: Iacce3cd83c9a8f1f6d4f88ae0990f610db1ce785
rzr added a commit to adoptware/pinball-table-gnu that referenced this issue May 7, 2021
Pincab works on Ubuntu Core 10 on RPi4 (~23 FPS)

Few configuration steps:

```
sudo snap install mir-kiosk
cat <<EOF | sudo tee /var/snap/mir-kiosk/current/miral-kiosk.display
layouts:
  default:
    cards:
    - card-id: 0
      HDMI-A-1:
        mode: 1024x768@60.0
        orientation: left

package=pinball-table-gnu
sudo snap install --devmode ${package}
sudo snap connections ${package} | grep -- '-' | grep -v ' :' | cut -f1 -d' ' \
| while read plug ; do sudo snap connect ${package}:$plug  ; done ;
sudo snap set ${package} daemon=true
```

For the record:

```sudo snap list
Name               Version                     Rev    Tracking         Publisher   Notes
core18             20210309                    2002   latest/stable    canonical✓  base
core20             20210319                    974    latest/stable    canonical✓  base
lxd                4.13                        20319  latest/stable/…  canonical✓  -
mir-kiosk          2.3.2-snap117               6526   latest/stable    canonical✓  -
pinball-table-gnu  0.0.20200601+git13.5d54821  x2     -                -           devmode
snapd              2.49.2                      11584  latest/stable    canonical✓  snapd
```

Relate-to: adoptware/pinball#21
Signed-off-by: Philippe Coval <rzr@users.sf.net>
Change-Id: Iacce3cd83c9a8f1f6d4f88ae0990f610db1ce785
rzr added a commit to adoptware/pinball-table-gnu that referenced this issue May 7, 2021
Pincab works on Ubuntu Core 10 on RPi4 (~23 FPS)

Few configuration steps:

```
sudo snap install mir-kiosk
cat <<EOF | sudo tee /var/snap/mir-kiosk/current/miral-kiosk.display
layouts:
  default:
    cards:
    - card-id: 0
      HDMI-A-1:
        mode: 1024x768@60.0
        orientation: left

package=pinball-table-gnu
sudo snap install --devmode ${package}
sudo snap connections ${package} | grep -- '-' | grep -v ' :' | cut -f1 -d' ' \
| while read plug ; do sudo snap connect ${package}:$plug  ; done ;
sudo snap set ${package} daemon=true
```

For the record:

```sudo snap list
Name               Version                     Rev    Tracking         Publisher   Notes
core18             20210309                    2002   latest/stable    canonical✓  base
core20             20210319                    974    latest/stable    canonical✓  base
lxd                4.13                        20319  latest/stable/…  canonical✓  -
mir-kiosk          2.3.2-snap117               6526   latest/stable    canonical✓  -
pinball-table-gnu  0.0.20200601+git13.5d54821  x2     -                -           devmode
snapd              2.49.2                      11584  latest/stable    canonical✓  snapd
```

Relate-to: adoptware/pinball#21
Signed-off-by: Philippe Coval <rzr@users.sf.net>
Change-Id: Iacce3cd83c9a8f1f6d4f88ae0990f610db1ce785
rzr added a commit to adoptware/pinball-table-hurd that referenced this issue May 10, 2021
To build and boot Ubuntu-Core on virtualbox

Relate-to: https://discourse.ubuntu.com/t/propose-new-appliance-emilia-pinball-pincab-profile/22214
Relate-to: adoptware/pinball#21
Signed-off-by: Philippe Coval <rzr@users.sf.net>
Change-Id: I13143c69a46aa306992233e72370677dbe2b03a7
@rzr
Copy link
Collaborator Author

rzr commented May 10, 2021

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
Copy link

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
Copy link
Collaborator Author

rzr commented May 10, 2021

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

rzr added a commit to adoptware/pinball-table-gnu that referenced this issue May 20, 2021
Display should be rotated manualy using:

sudo snap set mir-kiosk display-config=...

I an wondering how can this be done in images
without duplicating gadget snap.

Audio is also enabled

Relate-to: adoptware/pinball#21
Signed-off-by: Philippe Coval <rzr@users.sf.net>
Change-Id: Ib61e5084b80169c545fee3aab6b3b56b34a90092
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants