Enable FireFox Hardware Video Acceleration on Ubuntu

Firefox supports hardware video acceleration via VA-API and Wayland. Both Intel and AMD support VA-API. NVIDIA needs to use the open-source Nouveau or nvidia-vaapi-driver.

“Hardware video acceleration” and “Firefox” on ArchLinux are very useful and detail resource.

Continue reading “Enable FireFox Hardware Video Acceleration on Ubuntu”

Tearing with Intel Graphics in Ubuntu Portrait Mode

I use the portrait mode in Ubuntu 20.04 running wayland on i5-9500. The build-in Intel HD Graphics 530 has tearing issues: refresh slowly while scrolling.

After several testing, the solution is to load the dri3 module and enable the “TearFree” option in 20-intel.conf or 20-intel-graphics.conf:

$sudo nano /etc/X11/xorg.conf.d/20-intel.conf 

Section "Module"
        Load "dri3"
EndSection

Section "Device"
        Identifier "Intel Graphics"
        Driver "intel"
        Option "TearFree" "true"
        Option "DRI" "3"
EndSection
Continue reading “Tearing with Intel Graphics in Ubuntu Portrait Mode”

Ubuntu with nVIDIA’s Proprietary Driver won’t Wake Up from Suspend

The Ubuntu 20.04LTS running on my i5-9400F and nVIDIA GT720 won’t wake up from suspend mode. It’s related to the proprietary driver nvidia-driver-470. Disabling nvidia-suspend solves this issue but the authentication dialog will pop up twice from suspend every time.

To disable:

$sudo systemctl disable nvidia-suspend

To check if these related services are still running:

$sudo systemctl status nvidia-suspend nvidia-hibernate nvidia-resume

● nvidia-suspend.service - NVIDIA system suspend actions
     Loaded: loaded (/lib/systemd/system/nvidia-suspend.service; disabled; vend>
     Active: inactive (dead)

● nvidia-hibernate.service - NVIDIA system hibernate actions
     Loaded: loaded (/lib/systemd/system/nvidia-hibernate.service; enabled; ven>
     Active: inactive (dead)

● nvidia-resume.service - NVIDIA system resume actions
     Loaded: loaded (/lib/systemd/system/nvidia-resume.service; enabled; vendor>
     Active: inactive (dead)

Reference

  1. nVidia: [FIXED] Suspend / Resume issues with the driver version 470
  2. nVidia: Ubuntu 20.04 with nvidia-460 driver freezes randomly after resume from suspend/hibernate
  3. askUbuntu: Ubuntu 20.04 doesn’t wake up after suspend

Enable Hardware Video Acceleration in Chrome / Chromium / Firefox on Ubuntu 20.04

This post keep tracking my test enabling video hardware acceleration on Ryzen 2200g and Intel i5-6500 using integrated graphic card.

Table of Contents

  1. Table of Contents
  2. Quick Guide
  3. Testing Video Hardware Acceleration on Chrome/Chromium
    1. GPU Supported Video Codec
    2. Use CloudReady to Test
    3. Test Procedure
    4. CloudReady Test Result
      1. i5-6500 with Intel HD Graphics 530
      2. i5-9400f with nVidia gt720
      3. J3455
      4. Ryzen 2200g
  4. Monitor Hardware Video Acceleration
    1. Intel
    2. AMD
    3. NVIDIA
  5. Terminology
    1. Vulkan, VA-API, & VD-PAU
    2. ANGLE
  6. Installation & Configuration
    1. GPU Drivers
    2. Chrome & Chromium
    3. Firefox
      1. VA-API
      2. Extra Codecs
      3. Firefox Configurations
      4. Verify
  7. Final Thoughts
    1. Chrome
    2. Firefox
  8. Reference

Quick Guide

  1. No huge performance advantage when hardware accelerated video decode has been enabled in Chomre/chromium on i5-6500 and J3455. The CPU usage is still high to me.
  2. Fail to enable hardware accelerated video decode with Ryzen 2200g
  3. It’s easier to test using CloudReady to know if the hardware accelerated video decode feature in Chrome/Chromium is supported.
  4. Some video issues if hardware accelerated video decode is enabled on Ubuntu 20.04LTS.
Continue reading “Enable Hardware Video Acceleration in Chrome / Chromium / Firefox on Ubuntu 20.04”

Turn Off LED on msi Motherboard

Table of Contents

  1. Quick Guide
  2. Install msi-rgb
  3. Turn Off Immediatedly
  4. Turn Off on Start
  5. Turn Off After Resume
  6. Reference

Quick Guide

  1. Get and install nagisa’s msi-rgb utlity for msi motherboards.
  2. OpenRGB is an alternative solution and supports more motherboards.
  3. Turn off by running ‘sudo /home/amigo/msi-rgb/target/release/msi-rgb -x 00000000 00000000 00000000‘.
  4. Use crontab to turn off after boot.
  5. Create a shell script in /lib/systemd/system-sleep/ to turn off after resume.
Continue reading “Turn Off LED on msi Motherboard”

Prepare the LAMP Development Environment with VisualStudio Code and VirtualBox

For PHP development, I preferred to code in the host and run in the guest OS. It helps to keep the host clean and stable. Because PHP and APEX[1] are both required, I switch from NetBeans to Visual Studio Code.

  1. Install and Configure Visual Studio Code and PHP Extensions
  2. Import and Configure TurnKey LAMP Stack
Continue reading “Prepare the LAMP Development Environment with VisualStudio Code and VirtualBox”

Build the Linux Kernel Module to Enable RTL8811CU/RTL8821CU USB Wireless Dongles

There is no built-in support for Realtek RTL8811CU[1][2] and RTL8821CU[3] in Ubuntu 20.04 LTS. The later also has a Bluetooth controller. I have to download the RTL8811CU/RTL8821CU driver source code, compile to a kernel module, add it to the kernel, and switch to the WiFi USB mode.

The following USB wireless dongle uses the RTL8811CU chipset:

  1. TOTOLINK A650UA[4]

Quick Summary

For Ubuntu 18.04 LTS and 20.04LTS, follow these steps:

$sudo apt-get update
$sudo apt-get install dkms git
$git clone https://github.com/brektrou/rtl8821CU.git
$cd ~/rtl8821CU
$sudo ./dkms-install.sh
$sudo /usr/sbin/usb_modeswitch -KW -v 0bda -p 1a2b

If the usb_modeswitch doesn’t work, check the vendor and product id:

$sudo modprobe 8821cu
$lsusb

If it works, make it work automatically:

$sudo vi /lib/udev/rules.d/40-usb_modeswitch.rules
/1a2b
# D-Link DWA-171 Wifi Dongle
#ATTR{idVendor}=="0bda", ATTR{idProduct}=="1a2b", RUN+="usb_modeswitch '/%k'"

# TOTOLINK A500UA
ATTR{idVendor}=="0bda", ATTR{idProduct}=="1a2b", RUN+="/usr/sbin/usb_modeswitch -K -v 0bda -p 1a2b"

For RTL8821CU, run systemctl start bluetooth.service to enable Bluetooth.

Continue reading “Build the Linux Kernel Module to Enable RTL8811CU/RTL8821CU USB Wireless Dongles”

Build the Linux Kernel Module to Enable RTL8192EU USB Wireless Dongles

The built-in support for Realtek RTL8192EU[1][2] in Ubuntu 20.04 LTS has some issues with D-Link DWA-131 E1[3]. It provides a weak signal and slow WiFi. To improve, I have to download the RTL8192EU driver source code, compile to a kernel module, add it to the kernel, remove the existing drivers, and fix the detection issue.

The following USB wireless dongle uses the RTL8192EU chipset:

  1. D-Link DWA-131 E1

Quick Summary

For Ubuntu 18.04 LTS and 20.04LTS, follow these steps:

$sudo apt-get update
$sudo apt-get install dkms git
$git clone https://github.com/Mange/rtl8192eu-linux-driver
$cd ~/rtl8192eu-linux-driver
$sudo rmmod 8192eu
$sudo rmmod rtl8xxxu
$sudo dkms remove rtl8192eu/1.0 --all
$sudo dkms add .
$sudo dkms install rtl8192eu/1.0
$sudo depmod -a
$echo "blacklist rtl8xxxu" | sudo tee /etc/modprobe.d/rtl8xxxu.conf
$echo -e "8192eu\n\nloop" | sudo tee /etc/modules
$echo "options 8192eu rtw_power_mgnt=0 rtw_enusbss=0" | sudo tee /etc/modprobe.d/8192eu.conf
$sudo update-grub
$sudo update-initramfs -u;
$sudo shutdown -r now
Continue reading “Build the Linux Kernel Module to Enable RTL8192EU USB Wireless Dongles”

Manage Ubuntu Kernels

Display and peripheral issues are always related to the kernel drivers and modules. Upgrade to a newer kernel version might help.

There are many tools to manage kernels[1]:

  1. Manage with the ubuntu-mainline-kernel.sh[2]
  2. Manage with the Ubuntu Mainline Kernel Installer[3]
  3. Manage with dpkg[4]
  4. Low Latency vs Generic Kernel
  5. Upgrade to a Low Latency Kernel
  6. The GRUB[5] Configuration
  7. Remove Unused Kernel
Continue reading “Manage Ubuntu Kernels”