Hardware/Workarounds

From LibrePlanet
< Hardware
Revision as of 11:20, 18 June 2018 by Alyssa (talk | contribs) (Add page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Many ARM-based machines, such as popular single-board computers, have features missing when using a fully free operating system. In particular, radios like Wi-Fi typically require proprietary firmware; additionally, graphics processing units (GPUs) and video processing units (VPUs) often require invasive "blobs", proprietary drivers that mistreat the user.

Popular boards often have dedicated projects reverse-engineering these hardware components. For instance, the [Lima] and [Panfrost] projects are developing free software drivers for Mali GPUs found in many boards that otherwise would be usable with free software. [Cedrus] is providing free software support for the VPUs found in Allwinner SoCs.

In the mean time, these hardware components are not usable in the free world. But not all hope is lost! With a little creativity, the missing components can be worked around to enable a fully free operating system with minimal compromises on usability.

GPU

Graphics processing units are ubiquitous today with a multitude of capabilities. In practice, their main roles are to accelerate performance of 3D applications and, to a lesser extent, accelerate graphically-intensive 2D applications.

When there is no alternative, these tasks can be done in software on the CPU using "software rasterisation". On GNU/Linux, the llvmpipe module of the Mesa library is responsible for this task. Nevertheless, software rasterisation is very slow compared to using a hardware GPU.

As a rule, without a GPU or very powerful CPU, all 3D applications should be avoided. For instance, 3D games and applications like blender will not be usable.



A more subtle issue is GPU-requirements in the desktop environment. Although they are not 3D, modern desktop environments like GNOME and KDE are resource intensive, making particular use of the GPU. These desktops will be sluggish at best, and unusable at worst, without a GPU. Instead, switch to a lightweight desktop, like MATE or XFCE, or perhaps use a bare window manager without a desktop environment, like i3 or Openbox.

Within the desktop environment, one key component is "compositing". Compositing window managers are the norm in modern desktop environments; they are necessary for eye candy like window transparency and drop shadows. While aesthetically pleasing, compositing unfortunately requires GPU acceleration for good performance on most computers. If possible, consider disabling compositing:

If possible, it may also be beneficial to disable desktop animations.

  • MATE: Execute dconf-editor and click the search icon in the top right corner (the magnifying glass). Search for "animation" and disable each option: /org/gnome/desktop/interface/enable-animations, /org/mate/panel/general/enable-animations, /org/mate/desktop/interface/enable-animations, /org/mate/desktop/interface/gtk-enable-animations, /org/mate/panel/toplevels/top/enable-animations.
  • XFCE: ??? Template:Todo
  • i3, etc: Under normal circumstances, there are no animations enabled in the first place.



Although the VPU is specifically for video, GPUs often play a role in video playback. However, if there is no GPU available (software rasterisation is used as a fallback), modern video players may have a heavy performance hit from attempting to use this "optimised" path.

One video player which can avoid this issue is mpv. By default, mpv usually requires a GPU or software rasterisation (through "OpenGL"). However, if it is passed with the --vo x11 option, OpenGL will be avoided for significantly improved performance. For example, instead of

$ mpv https://static.fsf.org/nosvn/FSF30-video/FSF_30_720p.webm

Use

$ mpv --vo x11 https://static.fsf.org/nosvn/FSF30-video/FSF_30_720p.webm

mpv will print a warning that "this legacy VO has bad performance. Consider fixing your graphics drivers, or not forcing the x11 VO.". Ignore the message; counter-intuitively, in the absence of the GPU, this will improve performance.

Depending on the type of video, certain software scaling algorithms may be better. For instance, on cartoon-like videos which are predominantly flat-shaded except for edges, the area algorithm may provide a considerable performance boost with minimal loss of quality from the default algorithm. Invoke it by passing the --sws-scaler=area flag, e.g.:

$ mpv --vo x11 --sws-scaler=area https://static.fsf.org/nosvn/FSF30-video/FSF_30_720p.webm

For VLC, GPU acceleration can be disabled by navigating to "Tools->Preferences->Video" and setting "Output" to "X11 video output (XCB)", assuming X11 is in use on your system. VLC may need to be restarted before this settings are enabled. However, with both configured optimally, mpv may still be noticably faster than VLC absent a GPU.

Similar configuration may be possible for embedded browser video players, such as Firefox's. However, these browsers are generally graphically and computationally intensive; better performance can usually be attained by downloading the video directly and watching in mpv. youtube-dl can be used to download videos from many sites in freedom Template:TODO: What about its JS/Flash interpreters used to break certain pseudo-DRM schemes? Can we really recommend it in light of that?



In general, a number of graphically intensive applications support optional "hardware acceleration". Typically, this refers to GPU acceleration. It is worth looking at the settings available for applications you use to see if this option can be disabled. Applications known to expose this capability include:

  • Krita: Settings->Configure Krita->Display and untick "Canvas Graphics Acceleration"
  • Firefox: Three bars in the top right->Preferences->Advacned; untick "Use autoscrolling", "Use smooth scrolling", and "Use hardware acceleration when available"



You may also consider lightweight alternatives to applications you use, which typically also have lighter GPU requirements. Some ideas could be:

  • Firefox: Dillo/Netsurf/links2
  • PDF.js, Evince: mupdf

A more extreme option, for those who are comfortable, is to use text-based applications in a terminal emulator rather than full-fledged GUIs. Lightweight terminals like urxvt have minimal resource footprints out of the box; they run smoothly even without a GPU present. Depending on your needs, some ideas might include:

  • Pidgin: irssi/weechat + bitlbee
  • Firefox: links/lynx/elinks/w3m
  • LibreOffice: vim/emacs + pandoc

These choices, while limiting compared to their everything-including-the-kitchen-sink counterparts, also have the benefit of reduced CPU, memory, and disk usage, regardless of the reduced graphical strain.



Living without a GPU is not for the faint of heart, but for someone adventurous comfortable with the GNU/Linux command-line, it is very doable with a bit of creativity, patience, and experimentation.

VPU

Video processing units are prevalent on modern system-on-chips. Capabilities vary; in general, VPUs accelerate decoding (and in some cases, encoding) of video in select codecs.

Particular on mobile devices like phones, VPU support is desirable to lower power consumption when watching videos, thereby extending battery life. However, on modern systems, CPUs are usually fast enough to decode videos in software in real-time.

In some cases, even when supported with free software, the VPU does not implement codecs of interest, such as VP9. In these cases, software decoding will be used anyway.

Video players on GNU/Linux use software decoding, with free packages like ffmpeg, if hardware support is not available. No specific workaround is necessary by the user.

Wi-Fi

Internal Wi-Fi cards almost always require proprietary software, typically firmware or sometimes entire drivers. A small number of PCIe cards are compatible with a fully free software stack, such as those supported by the ath9k driver. SDIO cards, such as those found in many laptops, generally require proprietary software for normal operation.

Many USB Wi-Fi adaptors, however, work well with free software. The gold standard here are those using the ath9k_htc Linux driver. This driver is free software; while the cards do require firmware, the firmware is also free software!

Other USB adaptors have proprietary firmware burned into the adaptor's ROM. While free firmware would be preferable, this can be considered to be part of the hardware; adaptors in this category, like those based on the RTL8192CU chipset, can work. This may be necessary on boards with buggy USB drivers, such as the RK3288 with the dwc2 stack.

Check https://h-node.org for more information about compatibility.

While replacing the internal Wi-Fi is generally not practical for end-users, particularly on modern laptops where the Wi-Fi is soldered on to the motherboard, a compatible USB Wi-Fi adaptor is a great choice for connectivity.

Alternatively, if wireless functionality is not essential, a USB-Ethernet adaptor can be used instead. These typically work out of the box on free GNU/Linux systems, although it impedes portability.

While cellphones are not ideal due to grave freedom issues, in a pinch, tethering over USB to a phone running Replicant or Android can also enable Internet connectivity.Template:Expand