Meefik's Blog

Freedom and Open Source

Overview of Linux Deploy graphics subsystems

20 Jan 2015 | android linuxdeploy

Linux Deploy supports several graphics subsystems, graphics output options that can be used depending on the task.

VNC is used by default and is a software server that runs in parallel with Android and creates a virtual desktop to which you can connect through a special application — VNC-client. You can connect via VNC both locally, directly from the device, and remotely, for example, from a computer or other device. The only condition is that the devices are in the same subnet, for example, connected to the same router. VNC has two main parameters: server address and display number. The server address is the IP or host name where the VNC server is running. The display number is the number of the virtual desktop that we want to work with and on which the desktop environment runs. The display number is in the range from 0 to 99 and corresponds to the port number of the VNC server from 5900 to 5999, respectively, this port will be opened on the server to wait for the client to connect. VNC is easy to set up, there are many client applications, cross-platform, but not without its shortcomings. Such disadvantages include relatively low responsiveness of graphics, lack of support for hardware acceleration, lack of multitouch, additional load on the system and some others.

To use VNC in Linux Deploy, just go to the parameters of the current profile and select VNC as the graphics subsystem (“Properties” -> “Graphics subsystem” -> “VNC”). And then, if necessary, you can change the settings of the VNC server in the menu “Properties” -> “GUI settings”. After that, when you start GNU/Linux, the desktop environment will run inside a virtual X server, access to which will be open to the VNC client. To connect to the server in the VNC client, it is enough to specify the IP address of this device (the IP address is displayed in the top line of the Linux Deploy application) and the number of the display to which you want to connect.

Another graphical subsystem that allows you to run GNU/Linux in parallel with Android is the X Server mode (X Window System). The mode is also enabled in the parameters of the graphics subsystem (“Properties” -> “Graphics subsystem” -> “X11”). This mode allows you to run the graphical desktop environment on a third-party X-server. Here, the server is responsible for drawing graphics and displaying it on a video adapter, and the client is responsible for executing applications and transmitting graphics to the server. So, in this case, the client is the GNU/Linux system and the applications running in it, and the server is another application in Android (for example, XServer XSDL), or even on another computer (for example, Xorg, Xnest, Xephyr, Xming). The X-server allows to some extent to solve the issue of performance and significantly increase the responsiveness of graphical interfaces, while not depriving the ability to use the necessary functions of the Android device in case of local server startup.

To display graphics on an external X-server, the Linux Deploy settings should specify the server address (IP or hostname) and the server display. Then run the X server and then run GNU/Linux via Linux Deploy. After that, the desktop environment should start on the specified X-server. According to this scheme, thin clients work, only in this case the role of a thin client is performed by a computer (or the device itself), and the role of a server is a phone/tablet.

Finally, another graphics subsystem mode should be mentioned — framebuffer. In this mode, when GNU/Linux graphics are displayed by applications, there are no intermediaries, everything works as in full-fledged desktop distributions. The included Xorg distribution server is configured in such a way that the graphics are displayed through a special driver — fbdev. The video device address (for example, /dev/graphics/fb0) and input devices (for example, /dev/input/event2 for the touchscreen) are configured separately to work directly with hardware. This mode instructs the X server to redirect the image directly to the video device, as well as use direct access to input devices. In this case, there is a gain in performance due to direct access to the hardware resources of the device. But there is a downside. Unfortunately, the Android and GNU/Linux graphics subsystem cannot run at the same time. To be able to run GNU/Linux graphics applications in this mode, Linux Deploy suspends Android while Linux applications are running. After the end of the graphical session, Android correctly restarts without having to restart the device (however, there are other options, both with a full stop of Android, and without stopping at all). Another limitation of the use of this mode is the problem of compatibility of Xorg with the hardware resources of the device in some cases.

To switch Linux Deploy to framebuffer mode, select the appropriate graphics subsystem (“Properties” -> “Graphics subsystem” -> “Framebuffer”). If no X server is selected in the list of components, do so (“Properties” -> “Select components”) and reconfigure (“Properties” -> “Reconfigure”) to install the required packages. In the parameters of the graphics subsystem (“Properties” -> “GUI settings”), specify the video device and the input device of a particular device. You may also need to freeze Android UI for this mode to work properly. The Xorg server settings can be configured more subtly in the /etc/X11/xorg.conf file within the environment of the installed distribution.

Comments