Linux on the Pinephone

I’m not even sure where to begin to troubleshoot. I am trying to use Retroarch on the Pine64 pinephone. Right now I am running Manjaro with KDE+Plasma Mobile, running the flatpak version of Retroarch, but the issue persists on other versions of linux like Mobian.

Trying to launch Retroarch on this device initially works, and I can even navigate the menus for a few seconds if I have a controller plugged in. After a few seconds though, Retroarch will start flickering uncontrollably and become unresponsive to the point I have to reboot the device to close Retroarch.

Does anyone here have tips on how to troubleshoot this? I’d be happy to do research and provide error logs and such.

First thing I would do is try switching the menu to RGUI.

It looks like this issue but it is with glui menu driver.

Which menu driver do you use ? Do you reproduce the issue with rgui menu driver ?

Just now got a chance to do some more digging.

Using the Ozone menu driver, the screen flickers and becomes completely unresponsive. RGUI loses the graphical stutter, but will freeze and then close after several seconds when I try to Load Content. GLUI also freezes just trying to navigate the menu.

Thank you for the feedback.

I am wondering if it is not related to gpu driver. You are running lima driver ?

Is it possible to get the output of glxinfo -B ?

Also retroarch log if possible.

On this video it seems to work running Phosh. Did you try to use another DE for your test ?

Sorry it takes so long to get back to you. daily life is hectic lately, but I might have some useful info now.

-here is the output of glxinfo -B:

name of display: :1
display: :1 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: lima (0x13b5)
Device: Mali400 (0xffffffff)
Version: 21.1.4
Accelerated: yes
Video Memory: 0MB
Unified memory: yes
Preferred profile: compat (0x2)
Max core profile version: 0.0
Max compat profile version: 2.1
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 2.0
OpenGL vendor string: lima
OpenGL renderer string: Mali400
OpenGL version string: 2.1 Mesa 21.1.4
OpenGL shading language version string: 1.20

OpenGL ES profile version string: OpenGL ES 2.0 Mesa 21.1.4 OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16

I was also able to get the log output from it crashing. It crashes from a segfault error, but here is the log:

[INFO] RetroArch 1.9.6 (Git 4a6dc36b1c)
[INFO] === Build =======================================
[INFO] Capabilities:  ASIMD
[INFO] Built: Jul  5 2021
[INFO] Version: 1.9.6
[INFO] Git: 4a6dc36b1c
[INFO] =================================================
[INFO] [Input]: Found input driver: "x".
[INFO] [Environ]: SET_PIXEL_FORMAT: RGB565.
[INFO] Version of libretro API: 1
[INFO] Compiled against API: 1
[INFO] [Audio]: Set audio input rate to: 48000.00 Hz.
[INFO] [Video]: Video @ 960x720
[INFO] [EGL] Found EGL client version >= 1.5, trying eglGetPlatformDisplay
[INFO] [EGL]: EGL version: 1.4
[INFO] [GL]: Found GL context: wayland
[INFO] [GL]: Detecting screen resolution 0x0.
[INFO] [EGL]: Current context: 0xaaaad5d1acf0.
[INFO] [GL]: Vendor: lima, Renderer: Mali400.
[INFO] [GL]: Version: OpenGL ES 2.0 Mesa 21.1.4.
[INFO] [GL]: Using resolution 720x306
[INFO] [GL]: Default shader backend found: glsl.
[INFO] [Shader driver]: Using GLSL shader backend.
[WARN] [GL]: Stock GLSL shaders will be used.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GL]: Using 4 textures.
[INFO] [GL]: Loaded 1 program(s).
[INFO] [Joypad]: Found joypad driver: "udev".
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Wayland]: Enabling idle inhibitor
[INFO] [Video]: Found display server: null
[INFO] [PulseAudio]: Requested 24576 bytes buffer, got 18432.
[INFO] [Display]: Found display driver: "gl".
[ERROR] [Font]: Failed to create rendering backend: freetype.
[ERROR] [Font]: Failed to create rendering backend: stb-unicode.
[INFO] [Font]: Using font rendering backend: bitmap.
[ERROR] [Font]: Failed to create rendering backend: freetype.
[ERROR] [Font]: Failed to create rendering backend: stb-unicode.
[INFO] [Font]: Using font rendering backend: bitmap.
[ERROR] [Font]: Failed to create rendering backend: freetype.
[ERROR] [Font]: Failed to create rendering backend: stb-unicode.
[INFO] [Font]: Using font rendering backend: bitmap.
ALSA lib seq_hw.c:466:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory
[ERROR] [MIDI]: snd_seq_open failed with error -2.
[ERROR] [MIDI]: Initialization failed.
[INFO] [SRAM]: SRAM will not be saved.
[INFO] [Playlist]: Loading history file: [/home/minstrel/.config/retroarch/content_history.lpl].
[INFO] [Playlist]: Loading history file: [/home/minstrel/.config/retroarch/content_music_history.lpl].
[INFO] [Playlist]: Loading history file: [/home/minstrel/.config/retroarch/content_video_history.lpl].
[INFO] [Playlist]: Loading history file: [/home/minstrel/.config/retroarch/content_image_history.lpl].
[INFO] [Playlist]: Loading favorites file: [/home/minstrel/.config/retroarch/content_favorites.lpl].
[INFO] [PulseAudio]: Pausing.
[ERROR] [Font]: Failed to create rendering backend: freetype.
[ERROR] [Font]: Failed to create rendering backend: stb-unicode.
[INFO] [Font]: Using font rendering backend: bitmap.
[ERROR] [Font]: Failed to create rendering backend: freetype.
[ERROR] [Font]: Failed to create rendering backend: stb-unicode.
[INFO] [Font]: Using font rendering backend: bitmap.
[ERROR] [Font]: Failed to create rendering backend: freetype.
[ERROR] [Font]: Failed to create rendering backend: stb-unicode.
[INFO] [Font]: Using font rendering backend: bitmap.

I have not tested this in another OS yet. my other option currently is Mobian (Debian+Phosh) but the default version of retroarch in the debian repos is out of date.

Thank you for the feedback.

It is surely related to this issue. You are using also lima driver on Wayland. By the way did you have the opportunity to check if you got the same issue on Xorg ?

Thank you for your tests.

Retroarch works fine on all my laptops and desktops that are capable of using Xorg, but at this point in time I don’t see any instructions online or any ways to use Xorg on the pinephone. I think it’s just not supported in general. Do you think Wayland is part of the issue?

I made some quick test on Fedora 34 which is running Wayland and it was working.

So it might be related to lima driver and wayland ?

That is why I asked if it was possible to make a test on Xorg if you reproduce the issue.

It took some researching, but here’s what I was able to do; KDE Plasma Mobile and Phosh shells do not have any instructions to run them using Xorg. However, with some help I was shown this to set up Mobian(Debian) using GNOME. I was able to then sign in using GNOME on Xorg.

The next problem from was/is that the debian repo of Retroarch is wayyy out of date. I was able to install the flatpak version of Retroarch instead, and using that I was able to replicate the issue. Retroarch runs fine for a few seconds, or really until you try to do anything like load content. At that point it freezes. I could not figure out how to run the flatpak version with a --verbose flag to see if it gave the same errors though.

so short version: I think the issue is present using both Xorg and Wayland, but is still caused by some factor only present on the Pinephone. What would the next step be for troubleshooting?

Thank you for your tests.

Not sure if you can get some log with apitrace ?

I was wondering also if it will be possible to make some test using pmOS ?