This repository has been archived by the owner. It is now read-only.

Make plasma mobile work with software OpenGL #987

Closed
ollieparanoid opened this Issue Dec 8, 2017 · 12 comments

Comments

Projects
None yet
3 participants
@ollieparanoid
Member

ollieparanoid commented Dec 8, 2017

@bhush9, you suggested that it should be possible to run plasma mobile with software OpenGL. I can't make it work yet, do you have any idea?

framebuffer

What I did:

  • Installed postmarketos-ui-plasma-mobile on the i9100 (sd card)
  • Booted into it, changed /etc/profile.d/start_plasma.sh manually, then rebooted:
# ck-launch-session kwin_wayland --drm --xwayland -- plasma-phone 2>&1 | logger -t "$(whoami):plasma-mobile"
ck-launch-session kwin_wayland --framebuffer --xwayland -- plasma-phone 2>&1 | logger -t "$(whoami):plasma-mobile"

Upon the boot, postmarktOS stays at the splash screen, and the log says:

localhost:~$ logread | grep plasma
Jan  1 01:59:59 localhost user.notice user:plasma-mobile: kglobalaccel-runtime: Failed to register service org.kde.kglobalaccel
Jan  1 01:59:59 localhost user.notice user:plasma-mobile: Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.Disconnected", "Not connected to D-Bus server")
Jan  1 01:59:59 localhost user.notice user:plasma-mobile: Failed to connect to the kglobalaccel daemon QDBusError("org.freedesktop.DBus.Error.Disconnected", "Not connected to D-Bus server")
Jan  1 01:59:59 localhost user.notice user:plasma-mobile: Failed to connect to the kglobalaccel daemon QDBusError("org.freedesktop.DBus.Error.Disconnected", "Not connected to D-Bus server")
Jan  1 01:59:59 localhost user.notice user:plasma-mobile: Failed to connect to the kglobalaccel daemon QDBusError("org.freedesktop.DBus.Error.Disconnected", "Not connected to D-Bus server")
Jan  1 01:59:59 localhost user.notice user:plasma-mobile: kwin_core: Failed to initialize compositing, compositing disabled
Jan  1 01:59:59 localhost user.notice user:plasma-mobile: kwin_core: The used windowing system requires compositing
Jan  1 01:59:59 localhost user.notice user:plasma-mobile: kwin_core: We are going to quit KWin now as it is broken
Jan  1 01:59:59 localhost user.notice user:plasma-mobile: Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.Disconnected", "Not connected to D-Bus server")

swrast

What I did:

  • Installed postmarketos-ui-plasma-mobile on the i9100 (sd card)
  • Added mesa-dri-swrast + dependencies

Upon the boot, postmarktOS stays at the splash screen, and the log says:

localhost:~$ logread | grep plasma
Jan  1 01:59:59 localhost user.notice user:plasma-mobile: kglobalaccel-runtime: Failed to register service org.kde.kglobalaccel
Jan  1 01:59:59 localhost user.notice user:plasma-mobile: Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.Disconnected", "Not connected to D-Bus server")
Jan  1 01:59:59 localhost user.notice user:plasma-mobile: Failed to connect to the kglobalaccel daemon QDBusError("org.freedesktop.DBus.Error.Disconnected", "Not connected to D-Bus server")
Jan  1 01:59:59 localhost user.notice user:plasma-mobile: Failed to connect to the kglobalaccel daemon QDBusError("org.freedesktop.DBus.Error.Disconnected", "Not connected to D-Bus server")
Jan  1 01:59:59 localhost user.notice user:plasma-mobile: Failed to connect to the kglobalaccel daemon QDBusError("org.freedesktop.DBus.Error.Disconnected", "Not connected to D-Bus server")
@ollieparanoid

This comment has been minimized.

Show comment
Hide comment
@ollieparanoid

ollieparanoid Dec 8, 2017

Member

This is basically a tutorial on how to debug kwin wayland issues systematically:
https://blog.martin-graesslin.com/blog/2016/07/why-does-kwin_wayland-not-start/

also bshah wrote this:

ollieparanoid: I just read your github issue.. will comment on it, essentially you are missing debugging rules so debug output you have is not showing actual error

@bhush9: another idea, is there anything preventing us from running plasma mobile with X11 instead of wayland? As workaround for devices where we don't have accelerated GL yet.

Member

ollieparanoid commented Dec 8, 2017

This is basically a tutorial on how to debug kwin wayland issues systematically:
https://blog.martin-graesslin.com/blog/2016/07/why-does-kwin_wayland-not-start/

also bshah wrote this:

ollieparanoid: I just read your github issue.. will comment on it, essentially you are missing debugging rules so debug output you have is not showing actual error

@bhush9: another idea, is there anything preventing us from running plasma mobile with X11 instead of wayland? As workaround for devices where we don't have accelerated GL yet.

@zhuowei

This comment has been minimized.

Show comment
Hide comment
@zhuowei

zhuowei Dec 9, 2017

Collaborator

The last time I tested Plasma, I followed https://wiki.postmarketos.org/index.php?title=Plasma_Mobile&oldid=478 on the commit 81609a3, and it booted to this on my unaccelerated device. (yes, I did actually take photos)

Would following the instructions on the older Wiki page help get kwin running?

Collaborator

zhuowei commented Dec 9, 2017

The last time I tested Plasma, I followed https://wiki.postmarketos.org/index.php?title=Plasma_Mobile&oldid=478 on the commit 81609a3, and it booted to this on my unaccelerated device. (yes, I did actually take photos)

Would following the instructions on the older Wiki page help get kwin running?

@bhush9

This comment has been minimized.

Show comment
Hide comment
@bhush9

bhush9 Dec 9, 2017

Collaborator

Oooh.. which device was this?

Collaborator

bhush9 commented Dec 9, 2017

Oooh.. which device was this?

@zhuowei

This comment has been minimized.

Show comment
Hide comment
@zhuowei

zhuowei Dec 9, 2017

Collaborator

@bhush9 Nexus 6P. It wasn't usable at the time (touches are responded to after about 20 seconds!), and it was missing a lot of things, but at least it was displaying. I'm trying to get it back to this state to see what's causing the regression.

Collaborator

zhuowei commented Dec 9, 2017

@bhush9 Nexus 6P. It wasn't usable at the time (touches are responded to after about 20 seconds!), and it was missing a lot of things, but at least it was displaying. I'm trying to get it back to this state to see what's causing the regression.

@bhush9

This comment has been minimized.

Show comment
Hide comment
@bhush9

bhush9 Dec 9, 2017

Collaborator

I think it confirms the investigation of @NotKit that armhf is broken, and just arm64 works ootb..

Collaborator

bhush9 commented Dec 9, 2017

I think it confirms the investigation of @NotKit that armhf is broken, and just arm64 works ootb..

@zhuowei

This comment has been minimized.

Show comment
Hide comment
@zhuowei

zhuowei Dec 9, 2017

Collaborator

@bhush9 On the latest master branch, I'm also getting a blank screen, so I'm not sure if the architecture makes a difference.

Collaborator

zhuowei commented Dec 9, 2017

@bhush9 On the latest master branch, I'm also getting a blank screen, so I'm not sure if the architecture makes a difference.

@bhush9

This comment has been minimized.

Show comment
Hide comment
@bhush9

bhush9 Dec 9, 2017

Collaborator

@zhuowei do you have output of logread?

Collaborator

bhush9 commented Dec 9, 2017

@zhuowei do you have output of logread?

@zhuowei

This comment has been minimized.

Show comment
Hide comment
@zhuowei

zhuowei Dec 11, 2017

Collaborator

@ollieparanoid As a stopgap measure, I got kwin to run inside Weston on my Nexus 6P, since Weston can run with software acceleration.

image_kwin_in_weston

To do so:

Install weston, weston-shell-desktop, weston-backend-fbdev, mesa-dri-swrast

Get a root shell, setup a XDG_RUNTIME_DIR, Run

weston -S host-weston -B fbdev-backend.so --tty=1 --no-config &

And then setup dbus:

export $(dbus-launch)

Then finally start kwin:
KSCREEN_BACKEND=QScreen QT_QPA_PLATFORM=wayland KWIN_COMPOSE=Q WAYLAND_DISPLAY=host-weston kwin_wayland --xwayland --width 1440 --height 2048 -- plasma-phone

So in summary, a script like this should work:\

export XDG_RUNTIME_DIR=/tmp/runtime-root
mkdir /tmp/runtime-root
chmod 700 /tmp/runtime-root
weston -S host-weston -B fbdev-backend.so --tty=1 --no-config &
export $(dbus-launch)
sleep 1
WAYLAND_DISPLAY=host-weston kwin_wayland --xwayland --width 1440 --height 2048 -- plasma-phone
Collaborator

zhuowei commented Dec 11, 2017

@ollieparanoid As a stopgap measure, I got kwin to run inside Weston on my Nexus 6P, since Weston can run with software acceleration.

image_kwin_in_weston

To do so:

Install weston, weston-shell-desktop, weston-backend-fbdev, mesa-dri-swrast

Get a root shell, setup a XDG_RUNTIME_DIR, Run

weston -S host-weston -B fbdev-backend.so --tty=1 --no-config &

And then setup dbus:

export $(dbus-launch)

Then finally start kwin:
KSCREEN_BACKEND=QScreen QT_QPA_PLATFORM=wayland KWIN_COMPOSE=Q WAYLAND_DISPLAY=host-weston kwin_wayland --xwayland --width 1440 --height 2048 -- plasma-phone

So in summary, a script like this should work:\

export XDG_RUNTIME_DIR=/tmp/runtime-root
mkdir /tmp/runtime-root
chmod 700 /tmp/runtime-root
weston -S host-weston -B fbdev-backend.so --tty=1 --no-config &
export $(dbus-launch)
sleep 1
WAYLAND_DISPLAY=host-weston kwin_wayland --xwayland --width 1440 --height 2048 -- plasma-phone
@ollieparanoid

This comment has been minimized.

Show comment
Hide comment
@ollieparanoid

ollieparanoid Dec 11, 2017

Member

Creative method! How is the performance?

Member

ollieparanoid commented Dec 11, 2017

Creative method! How is the performance?

@zhuowei

This comment has been minimized.

Show comment
Hide comment
@zhuowei

zhuowei Dec 11, 2017

Collaborator

@ollieparanoid quite slow - takes a second for the settings app to respond - but faster than when I had it running on fbdev in the older version.

Collaborator

zhuowei commented Dec 11, 2017

@ollieparanoid quite slow - takes a second for the settings app to respond - but faster than when I had it running on fbdev in the older version.

@ollieparanoid

This comment has been minimized.

Show comment
Hide comment
@ollieparanoid

ollieparanoid Dec 16, 2017

Member

Summary of what we know now:

  • Almost all devices (except mainlined ones) use a framebuffer driver for graphics output
  • kwin_weston is based on QtWayland, and its framebuffer driver doesn't work with any OpenGL (LuneOS UI has the same issue)
    • We can work around this Xzibit-style by running kwin inside weston (see photo above)
  • Running kwin inside X11 should also work (because Hildon works with framebuffer + mesa-dri-swrast, too) (but we prefer Wayland over X11, and we have devices where Weston works, but X11 does not).

So to move this forward, we could check if /dev/dri is present, and if it is not, use the "kwin_wayland on weston" approach instead of directly starting kwin_wayland.

It can all be done by modifying postmarketos-ui-plasma-mobile.

Member

ollieparanoid commented Dec 16, 2017

Summary of what we know now:

  • Almost all devices (except mainlined ones) use a framebuffer driver for graphics output
  • kwin_weston is based on QtWayland, and its framebuffer driver doesn't work with any OpenGL (LuneOS UI has the same issue)
    • We can work around this Xzibit-style by running kwin inside weston (see photo above)
  • Running kwin inside X11 should also work (because Hildon works with framebuffer + mesa-dri-swrast, too) (but we prefer Wayland over X11, and we have devices where Weston works, but X11 does not).

So to move this forward, we could check if /dev/dri is present, and if it is not, use the "kwin_wayland on weston" approach instead of directly starting kwin_wayland.

It can all be done by modifying postmarketos-ui-plasma-mobile.

@ollieparanoid

This comment has been minimized.

Show comment
Hide comment
@ollieparanoid
Member

ollieparanoid commented Jan 4, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.