Installing v4l2loopback-dkms on Arch Linux
How to install and load v4l2loopback-dkms on Arch Linux for a virtual webcam, and why it carries no audio, so speech capture needs its own microphone or virtual source setup.
The short answer
On Arch Linux, v4l2loopback-dkms is installed with pacman together with the kernel headers that match your running kernel. DKMS (Dynamic Kernel Module Support) compiles the module for your kernel and rebuilds it when the kernel is upgraded. You then load it with modprobe to create a virtual video device that apps such as OBS Studio can write to and that conferencing apps can read from as a webcam.
There is one major limit for anyone concerned with speech capture. v4l2loopback handles video only. It creates no audio device, and a virtual camera built on it sends no sound to a call. Your voice still reaches the conferencing app through a separate audio input. That input might be the webcam's built-in microphone, a USB or analog microphone, or a virtual audio source you create in PipeWire or PulseAudio.
What you need before installing
- An up-to-date system, because installing headers for a newer kernel than the one you booted can leave the module unbuilt for the running kernel.
- The headers package that matches your kernel: linux-headers for the default kernel, linux-lts-headers for linux-lts, linux-zen-headers for linux-zen, and so on.
- Awareness of Secure Boot: if it is enforced with module signature checks, an unsigned DKMS-built module may refuse to load until you sign it or change that setting.
Installation steps
Update the system first, then install the headers and the DKMS package. The example below assumes the standard linux kernel. Substitute the headers package for your kernel if you run a different one.
sudo pacman -Syu
sudo pacman -S linux-headers v4l2loopback-dkms
Two optional packages are useful. v4l2loopback-utils provides the v4l2loopback-ctl helper. v4l-utils provides v4l2-ctl, which lists and inspects video devices.
sudo pacman -S v4l2loopback-utils v4l-utils
If you rebooted into a new kernel during the update, confirm that DKMS built the module for it:
dkms status
Loading the module and creating a virtual camera
sudo modprobe v4l2loopback devices=1 video_nr=10 card_label="Virtual Camera" exclusive_caps=1
v4l2-ctl --list-devices
Each option has a specific role:
- devices sets how many loopback devices are created.
- video_nr picks the device number, so this example gives /dev/video10. A high number keeps it from shifting the numbering of your real webcam.
- card_label is the name that apps display in their camera menus.
- exclusive_caps=1 makes the device advertise itself as a capture device. Chromium-based browsers and other WebRTC apps generally need this before they will list it as a camera.
Making it load at boot
A module loaded with modprobe disappears at the next reboot. To load it automatically with the same options, create these two files:
# /etc/modules-load.d/v4l2loopback.conf
v4l2loopback
# /etc/modprobe.d/v4l2loopback.conf
options v4l2loopback devices=1 video_nr=10 card_label="Virtual Camera" exclusive_caps=1
To change options later, unload and reload the module. Unloading fails while any app has the device open.
sudo modprobe -r v4l2loopback
sudo modprobe v4l2loopback
Feeding the virtual camera
OBS Studio's Start Virtual Camera button writes to a v4l2loopback device once the module is available. You can also send a video file with ffmpeg. The command below maps only the video stream, because the loopback device cannot accept audio.
ffmpeg -re -i input.mp4 -map 0:v -f v4l2 -pix_fmt yuv420p /dev/video10
What this means for speech capture
Because the virtual camera is silent, conferencing apps take audio from whatever device is selected as the microphone in their audio settings. This causes several practical effects:
- If you route your real webcam through OBS and out to the virtual camera, the webcam's built-in microphone does not travel with the picture. Select it, or another microphone, directly in the conferencing app's audio input menu.
- Audio you add inside OBS, such as filtered voice, music or a second microphone, stays in OBS. It will not reach a call through the virtual camera.
- To send processed audio from OBS or another program into a call, you need a separate virtual audio source, typically created in PipeWire or PulseAudio, which you then select as the app's microphone.
- A webcam that is busy feeding OBS may not be available to other apps at the same time. Its USB audio interface, however, normally appears as its own separate input device.
On systems running PipeWire with its PulseAudio compatibility layer, one common pattern uses a null sink as a place to send audio, plus a remapped source that apps can select as a microphone. The names below are examples. These modules do not persist across a restart of the audio server unless you add them to your configuration.
pactl load-module module-null-sink sink_name=virtual_mic_sink sink_properties=device.description=VirtualMicSink
pactl load-module module-remap-source master=virtual_mic_sink.monitor source_name=virtual_mic source_properties=device.description=VirtualMic
Next, route OBS's monitoring output, or any other audio program, to VirtualMicSink, and choose VirtualMic as the microphone in the conferencing app. Each app routes audio differently, so confirm the result by checking the input level meter in the app's audio settings before a call.
Common problems
- "Module not found" after installing: the headers usually do not match the running kernel, or you have updated but not rebooted. Check dkms status and the output of uname -r.
- "Key was rejected by service" or a similar load error: Secure Boot is blocking an unsigned module.
- The camera appears in OBS but not in a browser: reload the module with exclusive_caps=1.
- The device number changes after reboot: set video_nr in the modprobe.d file.
- The other side sees video but hears nothing: this is expected behaviour of v4l2loopback. Check the app's microphone selection instead.
Gaps in this guide
No specific evidence was supplied for package versions, release dates, compatibility with particular kernel releases, or how individual conferencing apps behave. The steps above describe the general, documented way that DKMS packages and v4l2loopback options work on Arch. Package names and defaults can change, so check the current package details and the Arch Wiki entry for v4l2loopback if a step does not match your system. This guide makes no claims about audio quality, because none were measured.