Screenshots » History » Version 14
dl lud, 01/24/2020 05:33 AM
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 | 12 | dl lud | |
17 | 11 | dl lud | # 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]]. |
18 | # Remove the file that makes SurfaceFlinger use libagl: |
||
19 | 1 | Wolfgang Wiedmeyer | <pre> |
20 | 11 | dl lud | adb shell rm /system/etc/libGLES_android/system/bin/surfaceflinger |
21 | </pre> |
||
22 | # Reboot your device. |
||
23 | # To revert, recreate the file (it is just an empty file): |
||
24 | <pre> |
||
25 | adb shell touch /system/etc/libGLES_android/system/bin/surfaceflinger |
||
26 | </pre> |
||
27 | |||
28 | h2. Taking screenshots with a computer |
||
29 | |||
30 | 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. |
||
31 | |||
32 | 13 | dl lud | # Make sure [[ADB]] is installed on your computer and that it can access the device's [[ADB#Accessing-root-shell|root shell]]. |
33 | 11 | dl lud | # Download this script: "screencap.sh":https://git.replicant.us/replicant/vendor_replicant-scripts/plain/screencap/screencap.sh |
34 | # 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 |
||
35 | <pre> |
||
36 | 2 | Wolfgang Wiedmeyer | FFMEG="ffmpeg" |
37 | </pre> |
||
38 | 3 | Wolfgang Wiedmeyer | to |
39 | <pre> |
||
40 | FFMEG="avconv" |
||
41 | 1 | Wolfgang Wiedmeyer | </pre> |
42 | 3 | Wolfgang Wiedmeyer | at the beginning of the script. |
43 | 11 | dl lud | # Run the script to take a screenshot: |
44 | 3 | Wolfgang Wiedmeyer | <pre> |
45 | ./screencap.sh -f OUTPUT.PNG |
||
46 | </pre> |
||
47 | 14 | dl lud | @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. |
48 | 3 | Wolfgang Wiedmeyer | |
49 | 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.: |
50 | 3 | Wolfgang Wiedmeyer | <pre> |
51 | ./screencap.sh -s 720x1280 -f OUTPUT.PNG |
||
52 | 4 | Wolfgang Wiedmeyer | </pre> |
53 | |||
54 | h3. In recovery mode |
||
55 | |||
56 | 11 | dl lud | It is also possible to take screenshots in recovery mode with the script by running: |
57 | 4 | Wolfgang Wiedmeyer | <pre> |
58 | ./screencap.sh -r -s SCREENSIZE -f OUTPUT.PNG |
||
59 | </pre> |
||
60 | 11 | dl lud | Screen size detection does not work in recovery mode. The screen size must be specified. |