Project

General

Profile

Screenshots » History » Version 11

dl lud, 01/24/2020 05:30 AM
Added instructions on how to force SurfaceFlinger to use llvmpipe for both Replicant 6.0 0003 and 0004. Reworked taking screenshots with computer into steps.

1 1 Wolfgang Wiedmeyer
h1. Screenshots
2
3 11 dl lud
On Android, it is usually possible to take a screenshot by pressing simultaneously the @Volume Down@ and @Power@ buttons. A shortcut can also be added to the menu that pops up when long-pressing the @Power@ button. Unfortunately this doesn't work out-of-the-box in Replicant because [[GraphicsResearch#Android-software-renderer|libagl]], the software renderer used for SurfaceFlinger (screen compositor), has an incomplete OpenGL ES implementation.
4 1 Wolfgang Wiedmeyer
5 11 dl lud
h2. Taking screenshots in Replicant
6 1 Wolfgang Wiedmeyer
7 11 dl lud
It is possible to take screenshots from within Replicant by forcing SurfaceFlinger to use [[GraphicsResearch#Mesas-llvmpipe|llvmpipe]]. Be aware that this will make your system extremely slow and bring in [[Graphics#Known-issues-with-llvmpipe|rendering issue to apps such as Gallery and Orbot]].
8 1 Wolfgang Wiedmeyer
9 11 dl lud
h3. Replicant 6.0 0003
10 1 Wolfgang Wiedmeyer
11 11 dl lud
On Replicant 6.0 0003 it is only possible to change the software renderer system-wide. Please follow the instructions at [[Graphics#Choosing-the-default-software-renderer| Graphics - Choosing the default software renderer]].
12 2 Wolfgang Wiedmeyer
13 11 dl lud
h3. Replicant 6.0 0004
14
15
As of Replicant 6.0 0004, llvmpipe is used as the default renderer. However, due to performance reasons, an exception is in place that forces SurfaceFlinger to use libagl instead. Follow these steps to remove the exception:
16
# Install [[ADB]] on your computer. Make sure that it can access the device's [[ADB#Accessing-root-shell|root shell]] and that the [[ADB#Modifying-the-system-partition|system partition is mounted as writable]].
17
# Remove the file that makes SurfaceFlinger use libagl:
18 1 Wolfgang Wiedmeyer
<pre>
19 11 dl lud
adb shell rm /system/etc/libGLES_android/system/bin/surfaceflinger
20
</pre>
21
# Reboot your device.
22
# To revert, recreate the file (it is just an empty file):
23
<pre>
24
adb shell touch /system/etc/libGLES_android/system/bin/surfaceflinger
25
</pre>
26
27
h2. Taking screenshots with a computer
28
29
Regardless of which graphics renderer is enabled, it is possible to take screenshots when the device is connected to a computer through an USB cable. The following steps explain the procedure.
30
31
# Make sure [[ADB]] is installed on your computer and that it can access the device's [[ADB#Accessing-root-shell|root shell]]
32
# Download this script: "screencap.sh":https://git.replicant.us/replicant/vendor_replicant-scripts/plain/screencap/screencap.sh
33
# You need to have ffmpeg installed. If ffmpeg is not available on your GNU/Linux distribution but avconv is (e.g. as part of libav-tools), you will have to change the line
34
<pre>
35 2 Wolfgang Wiedmeyer
FFMEG="ffmpeg"
36
</pre>
37 3 Wolfgang Wiedmeyer
to
38
<pre>
39
FFMEG="avconv"
40 1 Wolfgang Wiedmeyer
</pre>
41 3 Wolfgang Wiedmeyer
at the beginning of the script.
42 11 dl lud
# Run the script to take a screenshot:
43 3 Wolfgang Wiedmeyer
<pre>
44
./screencap.sh -f OUTPUT.PNG
45
</pre>
46
@OUTPUT:PNG@ is the filename of the screenshot. The screenshot will be saved with this filename in the directory you are running the script in. The script only supports the PNG format for screenshots.
47
48 11 dl lud
The display size in pixels is auto-detected. If you want the script to be faster, you can add the screen size as another option, e.g.:
49 3 Wolfgang Wiedmeyer
<pre>
50
./screencap.sh -s 720x1280 -f OUTPUT.PNG
51 4 Wolfgang Wiedmeyer
</pre>
52
53
h3. In recovery mode
54
55 11 dl lud
It is also possible to take screenshots in recovery mode with the script by running:
56 4 Wolfgang Wiedmeyer
<pre>
57
./screencap.sh -r -s SCREENSIZE -f OUTPUT.PNG
58
</pre>
59 11 dl lud
Screen size detection does not work in recovery mode. The screen size must be specified.