Graphics » History » Version 19

dl lud, 01/24/2020 04:46 AM
Choosing the software renderer for a system component. Reworked instructions into steps. Added llvmpipe issues.

1 1 Wolfgang Wiedmeyer
h1. Graphics
3 17 dl lud
Replicant relies on the CPU for graphics rendering, a technique known as software rendering. Using the dedicated graphics processor (GPU) currently requires non-free software on all of the supported devices. As free-software replacements are not yet available, the GPU cannot be used with Replicant for the moment (see [[GraphicsResearch]]). The software rendering is the reason why Replicant devices appear slow at times and is responsible for a lot of crashes that can happen during usage.
4 11 Fil Bergamo
5 17 dl lud
Until [[Images#Replicant-60-0003-images|Replicant 6.0 0003]] Replicant used the [[GraphicsResearch#Android-software-renderer|Android software renderer]], also known as libagl. libagl is fast, but [[Graphics#Known-issues-with-libagl|caused several issues]] due to lack of OpenGL ES (GLES) 2.0 support.
6 1 Wolfgang Wiedmeyer
7 18 dl lud
As of "Replicant 6.0 0004 rc1":, [[GraphicsResearch#Mesas-llvmpipe|llvmpipe]] is used as the default software renderer. llvmpipe has a more complete GLES implementation than libagl (see #705), so more apps work with it, like Firefox-based browsers or more recent WebViews (see #1780). Unfortunately, llvmpipe is too slow for certain system components, which may also be true for some apps. Furthermore, certain apps still crash with llvmpipe, although less frequently. Usually the screen stays black if an app does not work with llvmpipe.
8 16 doak complex
9 18 dl lud
To cater for these issues, Replicant 6.0 0004 includes a "mechanism to choose between llvmpipe and ligagl, on a per process basis": Such mechanism is "actually used": on the Replicant 6.0 0004 images to force some system components (bootanimation, SurfaceFlinger and system_server) to use libagl.
10 16 doak complex
11 19 dl lud
h2. Methods to choose the software renderer
12 17 dl lud
13 19 dl lud
For all the methods bellow you must have [[ADB]] installed on your computer. Make sure that it can access the device's [[ADB#Accessing-root-shell|root shell]] and that the system partition [[ADB#Modifying-the-system-partition|is mounted as writable]].
14 1 Wolfgang Wiedmeyer
15 19 dl lud
h3. Choosing the default software renderer
17 17 dl lud
The following command switches between llvmpipe and libagl:
18 1 Wolfgang Wiedmeyer
adb shell "grep -q "ro.libagl=1" /system/build.prop && sed "s/ro.libagl=1/ro.libagl=0/" -i /system/build.prop || sed "s/ro.libagl=0/ro.libagl=1/" -i /system/build.prop" 
21 17 dl lud
22 1 Wolfgang Wiedmeyer
Then reboot the device. To switch back to previous renderer, run the above command again and reboot the device.
This method works on both Replicant 6.0 0003 and 0004. Do note that on 0003 you will start with libagl by default, whereas on 0004 the default is llvmpipe.
24 18 dl lud
25 19 dl lud
h3. Choosing the software renderer for a specific app
26 18 dl lud
# Find out the app ID. Example: @org.gnu.icecat@
28 19 dl lud
# Force the app to always use libagl by creating empty file named @libGLES_android@ on it's data directory (e.g. @/data/data/org.gnu.icecat/@). Example command:
29 18 dl lud
30 1 Wolfgang Wiedmeyer
adb shell touch /data/data/org.gnu.icecat/libGLES_android
31 18 dl lud
32 19 dl lud
To force llvmpipe instead, use a file named @libGLES_mesa@.
# Get back to the default renderer by removing the file. Example command:
34 1 Wolfgang Wiedmeyer
adb shell rm /data/data/org.gnu.icecat/libGLES_android
This method only works for Replicant 6.0 0004.
40 19 dl lud
h3. Choosing the software renderer for a system component
41 1 Wolfgang Wiedmeyer
42 19 dl lud
System components usually lack a directory in the data partition. Thus, another method must be used to switch their software renderer.
43 1 Wolfgang Wiedmeyer
44 19 dl lud
# Find out the full path of the executable. You can use @which@ for that:
root@i9300:/ # which surfaceflinger
# Force the component to always use libagl by creating empty file at @/system/etc/libGLES_android/<executable_full_path>@. Example commands:
adb shell mkdir -p /system/etc/libGLES_android/system/bin
adb shell touch /system/etc/libGLES_android/system/bin/surfaceflinger
To force llvmpipe instead, create the file under @/system/etc/libGLES_mesa/@.
# Get back to the default renderer by removing the file. Example command:
adb shell rm /system/etc/libGLES_android/system/bin/surfaceflinger
This method only works for Replicant 6.0 0004.
62 1 Wolfgang Wiedmeyer
h2. Known issues with libagl
63 16 doak complex
64 14 doak complex
* Selecting the third option besides photo and video (Panorama mode) will crash the Camera app.
* Video playback in the browser does not work. (issue #1533)
* Screenshots do not work. (see [[Screenshots]] for a workaround)
67 1 Wolfgang Wiedmeyer
* Selecting wallpapers from storage does not work.
* Screen content is sometimes shortly visible before unlocking. (issue #1275, happens with llvmpipe as well)
* Previews of the windows in the tasks switcher are missing.
* Switching between apps, apps and the launcher or different views inside an app is sometimes slow and the device may seem unresponsive.
* There are issues with using folders with the Trebuchet launcher. (issue #1790, happens with llvmpipe as well)
72 14 doak complex
73 19 dl lud
h3. Popular apps from F-Droid that do not work with libagl
74 14 doak complex
75 16 doak complex
* All Firefox-based browsers like "IceCatMobile": and Orfox
76 1 Wolfgang Wiedmeyer
* "Document Viewer":
* "LibreOffice Viewer":
78 16 doak complex
* "RedReader": cannot display images ("upstream bug":
79 2 Wolfgang Wiedmeyer
80 19 dl lud
h2. Known issues with llvmpipe
* Too slow to use in SurfaceFlinger (screen compositor).
* If SurfaceFlinger uses llvmpipe, Gallery and Orbot render some GUI elements are visible while the main screen is black. The GUI of Simple File Manager works as long as no image is viewed in fullscreen.
85 8 Denis 'GNUtoo' Carikli
h2. See also
86 9 Denis 'GNUtoo' Carikli
87 19 dl lud
There is a page about [[GraphicsResearch]] that gathers information to improve graphics support.