Mentions légales du service

Skip to content
Snippets Groups Projects
Verified Commit 7d76955e authored by Mattéo Delabre's avatar Mattéo Delabre
Browse files

Improve Linux/X11 instructions with background on RandR

parent 5bf77dcc
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,7 @@ For this scenario, you will need to configure your system to create a virtual se
The details are specific to the operating system you’re using:
* [Linux with X11](docs/linux-x11.md)
* [Linux with X11](docs/second-screen/linux-x11.md)
* Linux with Wayland (Help wanted!)
* macOS (Help wanted!)
* Windows (Help wanted!)
......@@ -106,6 +106,7 @@ Many thanks to:
- [libremarkable](https://github.com/canselcik/libremarkable) and [FBInk](https://github.com/NiLuJe/FBInk), on which input/output handling in this client is based.
- [Damien Challet](https://github.com/damienchallet) and [Qwertystop](https://news.ycombinator.com/item?id=13115739) for providing the inspiration of a VNC client for the reMarkable.
- The [Discord developer community](https://discord.gg/JSSGnFY) for providing initial feedback and testing.
- [Florian Magin](https://github.com/fmagin) for contributing a driver-generic way of setting up Linux/X11 systems.
[Martin Sandsmark](https://github.com/sandsmark) also built [a VNC client for the reMarkable](https://github.com/sandsmark/revncable) which only depends on Qt.
......
# Setup on Linux with X11
# Setup as a second screen on Linux with X11
## Setup output
## Find a suitable output
The first step is to create a new space on your computer on which applications can be launched and that can be mirrored on the reMarkable through VNC, without being visible on your computer.
It is assumed that you are using the [RandR X extension](https://www.x.org/releases/current/doc/randrproto/randrproto.txt) to arrange the different screens of your computer, which is likely the case with any recent Linux distribution.
With RandR, each screen connected to your computer (called an _output_) sees a subregion of a larger shared image (perhaps confusingly called a _screen_).
Even though the overall size of that shared image can be controlled manually—which could allow us to allocate some extra space outside of the other outputs for use as a second screen—this size is usually automatically calculated to cover the combined sizes of all available outputs, so the most robust way to allocate that space is to create a _virtual_ output.
The steps required to enable those _virtual_ outputs, which are treated like any other output but are not visible, vary depending on the driver that you use.
### Intel
When using the Intel X11 driver, virtual outputs `VIRTUAL1` and `VIRTUAL2` are created: you should see them at the bottom of `xrandr`’s output, listed as `disconnected`.
When using the Intel X11 driver, virtual outputs called `VIRTUAL1` and `VIRTUAL2` are available: you should see them at the bottom of `xrandr`’s output, listed as `disconnected`.
### AMD
AMD drivers seem to lack support for true virtual outputs like Intel. They have a virtual display feature (`virtual_display` in https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html ), but this disables all physical outputs by design, so it doesn't help in this use case.
AMD drivers seem to lack support for true virtual outputs like Intel.
They have a virtual display feature (see the `virtual_display` parameter in the [AMDgpu driver documentation](https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html)), but this disables all physical outputs by design, so it doesn't help in this use case.
### Nvidia
Unknown.
### Generic workaround
One workaround is to use an existing output that isn't plugged in. This might lead to weird issues, especially if corresponding GPU output is suddenly connected.
One workaround is to use any existing output that isn't plugged in.
This might lead to weird issues, especially if the corresponding screen is later connected.
To list all disconnected outputs, use the following command:
## Setup the display mode
Create a new mode compatible with the tablet’s resolution:
```
xrandr --newmode 1408x1872 $(gtf 1408 1872 60 | tail -n2 | head -n1 | tr -s ' ' | cut -d' ' -f4-)
```
## Setup the output
### Laptop with Intel GPU
on a modern laptop with an Intel GPU the internal display will most likely be called `eDP1` and the output `VIRTUAL1` should be available for the VNC server
First add the mode to the `VIRTUAL1` output
```sh
xrandr --addmode VIRTUAL1 1408x1872
```
Enable and place the `VIRTUAL1` output through your usual dual screen configuration program such as arandr, GNOME’s settings panel or KDE setting. Alternatively you can manually configure it with:
```sh
xrandr --output VIRTUAL1 --mode 1408x1872 --right-of eDP1
$ xrandr | grep disconnected
DP-3 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
```
### Using the generic workaround
Here, you may use either of the `DP-3` or `HDMI-1` outputs for the following instructions.
This example reuses a disconnected HDMI port that appears as the output `HDMI-1` on a dual monitor system with `DP-1` and `DP-2` as regular monitors. Using an output that is actually connected will most likely cause issues with the mode that was added, so be sure that the output isn't currently in use.
## Create a compatible display mode
#### Get unused output
Create a new mode compatible with the tablet’s resolution:
```sh
$ xrandr | grep disconnected
DP-3 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
$ xrandr --newmode 1408x1872 $(gtf 1408 1872 60 | tail -n2 | head -n1 | tr -s ' ' | cut -d' ' -f4-)
```
#### Setup mode
## Setup the output
_In the following, replace `OUTPUTNAME` by the name of the output you want to mirror on the reMarkable, as determined in the first section._
Add the mode to the desired output:
First add the display mode to the set output:
```sh
xrandr --addmode HDMI-1 1408x1872
$ xrandr --addmode OUTPUTNAME 1408x1872
```
#### Setup screen
GUI tools like `lxrandr` or `arandr` will not recognize or show the output because it is still disconnected. Manual `xrandr` commands still work.
To setup the tablet as a new screen below an existing monitor, use:
Enable and place the set output through your usual dual screen configuration program such as arandr, GNOME’s settings panel or KDE settings.
When using the generic workaround, the output you chose will not appear in those programs, and you need to use `xrandr` as follows:
```sh
xrandr --output HDMI-1 --mode 1408x1872 --below DP-1
$ xrandr --output OUTPUTNAME --mode 1408x1872 --right-of MAINOUTPUT
```
Where `MAINOUTPUT` is the name of your main screen to the right of which you want to place the second screen.
You may replace `--right-of` by `--left-of`, `--above`, or `--below`.
Ignore any error saying `xrandr: Configure crtc X failed`.
## Start the VNC server
Any VNC server can be used for this task.
We recommend x11vnc, which can be launched using the following command line on an Intel laptop setup:
_In the following, replace `OUTPUTNAME` by the name of the output you want to mirror on the reMarkable, as determined in the first section._
```sh
x11vnc -repeat -forever -nocursor -allow 10.11.99.1 -clip $(xrandr | awk '/VIRTUAL1 connected/{print $3}')
```
For the generic workaround, you need to get the position and resolution for the output of your choice, e.g.:
Any VNC server can be used for this task.
We recommend x11vnc, which can be launched using the following command line:
```sh
x11vnc -repeat -forever -nocursor -allow 10.11.99.1 -clip $(xrandr | awk '/HMDI-1 disconnected/{print $3}')
$ x11vnc -repeat -forever -nocursor -allow 10.11.99.1 -clip $(xrandr | perl -n -e'/VIRTUAL1 .*?(\d+x\d+\+\d+\+\d+)/ && print $1)
```
Note that the output is still expected to appear as `disconnected`!
### Options
......@@ -116,7 +97,7 @@ Flag | Description
Finally, start rmvncclient using SSH.
```sh
ssh root@10.11.99.1 "systemctl stop xochitl && ./rmvncclient; systemctl start xochitl"
$ ssh root@10.11.99.1 "systemctl stop xochitl && ./rmvncclient; systemctl start xochitl"
```
**Note:** If you get a message saying that the `Server uses an unsupported resolution`, you did not configure your screen correctly.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment