MY WEBCAM TEST GUIDE

Using v4l2-ctl to Inspect Linux Video Devices (and Where the Webcam Microphone Fits In)

How to inspect Linux webcams and v4l2loopback virtual cameras with v4l2-ctl, why the webcam microphone won't appear there, and how to find it with ALSA and PipeWire tools.

The short answer

v4l2-ctl is a command-line tool from the v4l-utils package. It queries and adjusts video devices that use the Video4Linux2 (V4L2) interface, the /dev/videoN nodes that webcams, capture cards and virtual cameras such as v4l2loopback expose. It can list devices, report drivers and capabilities, enumerate pixel formats, resolutions and frame rates, and read or change controls such as brightness, exposure and focus.

The limitation matters if you care about speech capture: v4l2-ctl does not inspect a USB webcam's built-in microphone. On Linux, a USB webcam's microphone normally appears as a separate audio device handled by the sound subsystem (ALSA, usually through PipeWire or PulseAudio), not as part of the V4L2 video node. A virtual camera created with v4l2loopback carries video only, so it has no audio. Use v4l2-ctl to identify and check the camera, then use audio tools to find and test its microphone.

What v4l2-ctl can tell you

Start by listing every V4L2 device and the nodes that belong to it:

v4l2-ctl --list-devices

Each entry shows a device name, a bus identifier in parentheses, and one or more /dev/videoN paths. One physical webcam often creates several nodes. With the common UVC (USB Video Class) driver, one node usually delivers frames and another carries metadata only. If an application shows a black image or refuses a node, try the other node listed under the same device.

To see everything about one node, including driver name, capabilities, current format and controls:

v4l2-ctl -d /dev/video0 --all

Other commonly used queries:

v4l2-ctl -d /dev/video0 --info              # driver, card name, bus info, capabilities
v4l2-ctl -d /dev/video0 --list-formats-ext  # pixel formats with sizes and frame intervals
v4l2-ctl -d /dev/video0 --list-ctrls        # adjustable controls and current values
v4l2-ctl -d /dev/video0 --list-ctrls-menus  # same, with menu options expanded
v4l2-ctl -d /dev/video0 --get-fmt-video     # format currently in use

To change a control, pass its name as listed by --list-ctrls. Control names and ranges differ between cameras and driver versions, so check the list before setting a value:

v4l2-ctl -d /dev/video0 --set-ctrl=<control_name>=<value>

Recognizing a v4l2loopback virtual camera

Devices created by the v4l2loopback kernel module also appear in --list-devices, usually under the label you gave when loading the module. Running --info on such a node reports the loopback driver rather than uvcvideo. That is a quick way to tell a virtual camera (for example, one fed by OBS or an ffmpeg pipeline) from the physical webcam when several /dev/videoN entries exist.

Because v4l2loopback carries video only, choosing a virtual camera in a conferencing app does not choose a microphone. You still select audio input separately. If your workflow sends processed audio from the same tool that feeds the virtual camera, that audio has to travel through a separate audio route, such as a virtual source in PipeWire or PulseAudio.

Why the webcam microphone isn't listed

USB webcams with built-in microphones generally present them as a separate USB Audio Class interface on the same device. The kernel binds the video interface to a V4L2 driver and the audio interface to the ALSA USB audio driver. The two end up in different subsystems even though they share a cable.

v4l2-ctl does have an option to enumerate audio inputs (--list-audio-inputs). It reflects the V4L2 audio-input interface, which is mainly used by some capture and TV hardware to describe audio routing. Webcams typically report nothing there. An empty result does not mean the camera lacks a microphone.

Finding and testing the webcam microphone

List capture devices known to ALSA and the sources seen by the sound server:

arecord -l                  # ALSA capture hardware (card and device numbers)
arecord -L                  # ALSA device names usable with -D
cat /proc/asound/cards      # card names as the kernel sees them
pactl list short sources    # sources under PulseAudio or PipeWire's Pulse layer
wpctl status                # devices and default nodes under PipeWire/WirePlumber

A webcam microphone usually appears with a name close to the camera's product name. To confirm the match, compare the USB location in the bus info shown by v4l2-ctl --list-devices with what lsusb or the audio tools report for the same device.

Make a short test recording directly from that card, replacing the card name with the one shown by arecord -L or arecord -l:

arecord -D plughw:CARD=<card_name>,DEV=0 -f S16_LE -d 5 test.wav
aplay test.wav

The plughw device lets ALSA convert sample formats and rates the hardware does not natively support. To see what the microphone actually offers, such as channel count and supported sample rates (samples per second, which bound the frequency range captured), run arecord with --dump-hw-params against the hw: form of the device. If the recording is silent or very quiet, check the capture level and mute state for that card in alsamixer (press F6 to select the card) or in your desktop's sound settings. Webcam microphones commonly default to a capture control that can be muted or set low.

Practical implications for speech capture

  • Selecting a camera, physical or virtual, in a conferencing or recording app does not select its microphone. Set the audio input separately and confirm it by name.
  • A webcam that works in v4l2-ctl but whose microphone does not appear in arecord -l points to an audio-side issue, such as the USB audio driver, power or the device itself, not a V4L2 problem.
  • If the camera's video and audio come from different devices, for example a loopback camera plus a separate microphone, the app treats them as independent streams. Any lip-sync offset has to be corrected in the app or pipeline, not with v4l2-ctl.
  • Video settings changed with v4l2-ctl, such as resolution, frame rate or exposure, do not change microphone gain or quality. Audio level is controlled through ALSA mixer controls or the sound server.

What this guide can't confirm

No device-specific evidence was available for this article. The exact device names, node numbers, control names, supported formats and microphone sample rates depend on your camera model, kernel and distribution, so none are stated here. The commands above report those details for your own hardware. Treat their output, not general descriptions, as the authoritative answer for your setup. This guide also does not assess the voice quality of any particular webcam microphone. That requires recordings or measurements of the specific device.