December 25, 2024

How to record computer screen and a microphone sound in Linux Ubuntu and Raspberry Pi by using Kazam

In this tutorial, we explain how to record a computer screen and a microphone in Linux Ubuntu and Raspberry Pi using Kazam. The YouTube tutorial is given below.

Kazam is free and open-source software for recording computer screen and microphone sounds. To install Kazam on Linux Ubuntu and Raspberry Pi 5, open a Linux terminal, and execute this command:

sudo apt install kazam

However, some users (including myself) were not able to record the screen after installing Kazam by using this approach. That is, the screen is completely black after being recorded with Kazam. In the sequel, we explain how to fix this black screen issue that appears in Kazam.

This issue comes from the fact that Kazam and similar screen recording programs are incompatible with the Wayland display protocol. To check the current display protocol, we need to type this

echo $XDG_SESSION_TYPE

and you should see an output “wayland”. This can be solved by switching to the Xorg protocol (denoted by X11). To fix this issue, we need to edit this file:

sudo nano /etc/gdm3/custom.conf

In this configuration file, find this line

#WaylandEnable=false

and simply remove the comment. That is, the line should look like this:

WaylandEnable=false

This should fix the issue. Before the fix can be applied, you need to restart the system. After you restart the system, you need to type this

echo $XDG_SESSION_TYPE

The output should be

x11

This means that we switched to Xorg.

These changes can also be applied without a hard restart of the system. They can be applied by restarting the GNOME Display Manager (GDM) using the following command:

sudo systemctl restart gdm