Difference between revisions of "Hardware/Workarounds"

From LibrePlanet
Jump to: navigation, search
(Add page)
 
(Bunch of changes (working locally))
Line 1: Line 1:
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.
+
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. Not all hope is lost! The missing components can be worked around to enable a fully free operating system with minimal compromises on usability for many people.
 
 
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 ==
 
== 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.
+
Graphics processing units are ubiquitous today with a multitude of capabilities. In practice, they accelerate 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 &quot;software rasterisation&quot;. On GNU/Linux, the <code>llvmpipe</code> module of the Mesa library is responsible for this task. Nevertheless, software rasterisation is very slow compared to using a hardware GPU.
+
When there is no alternative, these tasks can be done in software on the CPU with “software rasterisation”. On GNU/Linux, the <code>llvmpipe</code> module of the Mesa library is responsible for this task. However, software rasterisation is slow compared to dedicated hardware.
  
As a rule, without a GPU or very powerful CPU, all 3D applications should be avoided. For instance, 3D games and applications like <code>blender</code> will not be usable.
+
As a rule, without a GPU or powerful CPU, all 3D applications should be avoided. 3D games and applications like [https://www.blender.org/ 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.
+
A more subtle issue is GPU-requirements in the desktop environment. Although they are not 3D, modern desktop environments like GNOME 3 are resource intensive, making particular use of the GPU. Without a GPU, these desktops are sluggish at best, and unusable at worst. Instead, use a lightweight desktop, like MATE or XFCE, or even a barebones window manager, like i3 or Openbox.
 +
 
 +
Within the desktop environment, one component is “compositing”. Compositing window managers are typical in modern desktop environments, used for visual effects like window drop shadows. While aesthetically pleasing, compositing usually requires GPU acceleration.
  
Within the desktop environment, one key component is &quot;compositing&quot;. 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:
+
To compound the issue, modern desktops typically feature resource-hungry animations, which should be disabled as well.
  
* MATE: Go to System-&gt;Preferences-&gt;Look and Feel-&gt;Windows-&gt;General and untick &quot;Enable software compositing window manager&quot; &lt;https://wiki.archlinux.org/index.php/MATE#Enabling_compositing &gt;
+
For MATE, navigate to System-&gt;Preferences-&gt;Look and Feel-&gt;Windows-&gt;General and untick “Enable software compositing window manager” https://wiki.archlinux.org/index.php/MATE#Enabling_compositing. Then, execute <code>dconf-editor</code> and click the search icon in the top right corner (the magnifying glass). Search for “animation” and disable each option: <code>/org/gnome/desktop/interface/enable-animations</code>, <code>/org/mate/panel/general/enable-animations</code>, <code>/org/mate/desktop/interface/enable-animations</code>, <code>/org/mate/desktop/interface/gtk-enable-animations</code>, <code>/org/mate/panel/toplevels/top/enable-animations</code>.
* XFCE: Execute <code>xfwm4-tweaks-settings</code> and disable the compositor. https://wiki.archlinux.org/index.php/Xfwm#Composite_manager
 
* i3, Openbox, etc: By default, there is no compositing. Compositing is handled by a separate &quot;compositor&quot; program, like <code>compton</code>. Simply don't setup a compositor, and no compositing will be used.
 
  
If possible, it may also be beneficial to disable desktop animations.
+
For XFCE, execute <code>xfwm4-tweaks-settings</code> and disable the compositor https://wiki.archlinux.org/index.php/Xfwm#Composite_manager. ???animation
  
* MATE: Execute <code>dconf-editor</code> and click the search icon in the top right corner (the magnifying glass). Search for &quot;animation&quot; and disable each option: <code>/org/gnome/desktop/interface/enable-animations</code>, <code>/org/mate/panel/general/enable-animations</code>, <code>/org/mate/desktop/interface/enable-animations</code>, <code>/org/mate/desktop/interface/gtk-enable-animations</code>, <code>/org/mate/panel/toplevels/top/enable-animations</code>.
+
For bare window mangers like i3 and Openbox, there is no compositing by default; compositing is handled by a separate “compositor” program, like <code>compton</code>. Simply don’t setup a compositor, and no compositing will be used. Similarly, there are no animations included by default.
* XFCE: ??? {{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 &quot;optimised&quot; path.
+
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 <code>mpv</code>. By default, <code>mpv</code> usually requires a GPU or software rasterisation (through &quot;OpenGL&quot;). However, if it is passed with the <code>--vo x11</code> option, OpenGL will be avoided for significantly improved performance. For example, instead of
+
One video player which can avoid this issue is <code>mpv</code>. By default, <code>mpv</code> usually requires a GPU or software rasterisation (through OpenGL). However, if it is passed with the <code>--vo x11</code> 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
+
<pre>$ mpv &lt;https://static.fsf.org/nosvn/FSF30-video/FSF_30_720p.webm&gt;</pre>
 +
Use:
  
Use
+
<pre>$ mpv --vo x11 &lt;https://static.fsf.org/nosvn/FSF30-video/FSF_30_720p.webm&gt;</pre>
 
+
<code>mpv</code> 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 usually ''improve'' performance.
$ mpv --vo x11 https://static.fsf.org/nosvn/FSF30-video/FSF_30_720p.webm
 
 
 
<code>mpv</code> will print a warning that &quot;this legacy VO has bad performance. Consider fixing your graphics drivers, or not forcing the x11 VO.&quot;. 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 <code>area</code> algorithm may provide a considerable performance boost with minimal loss of quality from the default algorithm. Invoke it by passing the <code>--sws-scaler=area</code> flag, e.g.:
 
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 <code>area</code> algorithm may provide a considerable performance boost with minimal loss of quality from the default algorithm. Invoke it by passing the <code>--sws-scaler=area</code> flag, e.g.:
  
$ mpv --vo x11 --sws-scaler=area https://static.fsf.org/nosvn/FSF30-video/FSF_30_720p.webm
+
<pre>$ mpv --vo x11 --sws-scaler=area &lt;https://static.fsf.org/nosvn/FSF30-video/FSF_30_720p.webm&gt;</pre>
 +
You may prefer the even-faster <code>fast-bilinear</code> algorithm:
  
For VLC, GPU acceleration can be disabled by navigating to &quot;Tools-&gt;Preferences-&gt;Video&quot; and setting &quot;Output&quot; to &quot;X11 video output (XCB)&quot;, assuming X11 is in use on your system. VLC may need to be restarted before this settings are enabled. However, with both configured optimally, <code>mpv</code> may still be noticably faster than <code>VLC</code> absent a GPU.
+
<pre>$ mpv --vo x11 --sws-scaler=fast-bilinear &lt;https://static.fsf.org/nosvn/FSF30-video/FSF_30_720p.webm&gt;</pre>
 
+
For VLC, GPU acceleration can be disabled by navigating to “Tools-&gt;Preferences-&gt;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, <code>mpv</code> may still be faster than VLC.
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 <code>mpv</code>. [https://github.com/rg3/youtube-dl youtube-dl] can be used to download videos from many sites in freedom {{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 &quot;hardware acceleration&quot;. 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:
+
Many graphically intensive applications support optional “hardware acceleration”, typically referring to GPU acceleration. Disabling this setting can sometimes improve performance on machines without a GPU:
 
 
* Krita: Settings-&gt;Configure Krita-&gt;Display and untick &quot;Canvas Graphics Acceleration&quot;
 
* Firefox: Three bars in the top right-&gt;Preferences-&gt;Advacned; untick &quot;Use autoscrolling&quot;, &quot;Use smooth scrolling&quot;, and &quot;Use hardware acceleration when available&quot;
 
 
 
 
 
-----
 
 
 
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 <code>urxvt</code> 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
+
For Krita, navigate to Settings-&gt;Configure Krita-&gt;Display and untick “Canvas Graphics Acceleration”.
* 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.
+
For Firefox, click the three bars in the top right, navigate to Preferences-&gt;Advanced, and untick “Use autoscrolling”, “Use smooth scrolling”. and “Use hardware acceleration when available”.
  
  
 
-----
 
-----
  
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.
+
You may also consider lightweight alternatives to applications you use, which typically also have lighter GPU requirements. For instance, instead of viewing PDFs in Firefox or evince, try <code>mupdf</code>.
  
 
== VPU ==
 
== VPU ==
Line 86: Line 63:
 
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.
 
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.
+
Particularly on mobile devices like phones, VPUs minimise power consumption when watching videos, extending battery life. Nevertheless, modern 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.
 
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 <code>ffmpeg</code>, if hardware support is not available. No specific workaround is necessary by the user.
+
Video players on GNU/Linux use software decoding if hardware support is not available. No specific workaround is necessary by the user.
  
 
== Wi-Fi ==
 
== Wi-Fi ==
Line 98: Line 75:
 
Many USB Wi-Fi adaptors, however, work well with free software. The gold standard here are those using the <code>ath9k_htc</code> Linux driver. This driver is free software; while the cards do require firmware, the firmware is also free software!
 
Many USB Wi-Fi adaptors, however, work well with free software. The gold standard here are those using the <code>ath9k_htc</code> 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 <code>RTL8192CU</code> chipset, can work. This may be necessary on boards with buggy USB drivers, such as the <code>RK3288</code> with the <code>dwc2</code> stack.
+
Other USB adaptors have proprietary firmware burned into the adapter’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 <code>RTL8192CU</code> chipset, can work. This may be necessary on boards with buggy USB drivers, such as the <code>RK3288</code> with the <code>dwc2</code> stack.
  
 
Check https://h-node.org for more information about compatibility.
 
Check https://h-node.org for more information about compatibility.
Line 106: Line 83:
 
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.
 
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.{{expand}}
+
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.

Revision as of 14:56, 20 July 2018

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. Not all hope is lost! The missing components can be worked around to enable a fully free operating system with minimal compromises on usability for many people.

GPU

Graphics processing units are ubiquitous today with a multitude of capabilities. In practice, they accelerate 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 with “software rasterisation”. On GNU/Linux, the llvmpipe module of the Mesa library is responsible for this task. However, software rasterisation is slow compared to dedicated hardware.

As a rule, without a GPU or powerful CPU, all 3D applications should be avoided. 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 3 are resource intensive, making particular use of the GPU. Without a GPU, these desktops are sluggish at best, and unusable at worst. Instead, use a lightweight desktop, like MATE or XFCE, or even a barebones window manager, like i3 or Openbox.

Within the desktop environment, one component is “compositing”. Compositing window managers are typical in modern desktop environments, used for visual effects like window drop shadows. While aesthetically pleasing, compositing usually requires GPU acceleration.

To compound the issue, modern desktops typically feature resource-hungry animations, which should be disabled as well.

For MATE, navigate to System->Preferences->Look and Feel->Windows->General and untick “Enable software compositing window manager” https://wiki.archlinux.org/index.php/MATE#Enabling_compositing. Then, 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.

For XFCE, execute xfwm4-tweaks-settings and disable the compositor https://wiki.archlinux.org/index.php/Xfwm#Composite_manager. ???animation

For bare window mangers like i3 and Openbox, there is no compositing by default; compositing is handled by a separate “compositor” program, like compton. Simply don’t setup a compositor, and no compositing will be used. Similarly, there are no animations included by default.



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 usually 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>

You may prefer the even-faster fast-bilinear algorithm:

$ mpv --vo x11 --sws-scaler=fast-bilinear <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 faster than VLC.



Many graphically intensive applications support optional “hardware acceleration”, typically referring to GPU acceleration. Disabling this setting can sometimes improve performance on machines without a GPU:

For Krita, navigate to Settings->Configure Krita->Display and untick “Canvas Graphics Acceleration”.

For Firefox, click the three bars in the top right, navigate to Preferences->Advanced, and 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. For instance, instead of viewing PDFs in Firefox or evince, try mupdf.

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.

Particularly on mobile devices like phones, VPUs minimise power consumption when watching videos, extending battery life. Nevertheless, modern 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 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 adapter’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.