OpenBSD Handbook

    Theme
    • Part I. Install & Configure
      • Introduction
      • Installing OpenBSD
      • The X Window System
      • Networking
      • System Configuration
      • OpenBSD Basics
      • Managing Software: Packages and Ports
    • Part II. Daily Operations
      • Graphical Environments
      • Multimedia
      • Printing
      • Linux Compatibility
      • Windows Compatibility
      • Games
    • Part III. System Administration
      • Virtualization
      • Storage and File Systems
      • Updating and Upgrading
      • Localization
      • The OpenBSD Boot Process
      • Security
    • Part IV. Networking & Daemons
      • Services
        • Database
          • MariaDB
          • PostgreSQL
          • Redis
          • memcached
        • Directory
          • YP (NIS)
          • LDAP
        • File
          • NFS
          • Samba
        • FTP Services
          • ftpd
          • ProFTPD
          • vsftpd
          • Pure-FTPd
          • TFTP
        • Mail
          • smtpd
          • Dovecot
          • Postfix
          • Exim
          • Rspamd
        • Name
          • Unbound
          • NSD
          • BIND
        • Networking
          • OpenBGPD
          • rad
          • DHCP
          • slaacd
        • Web
          • Apache
          • nginx
          • httpd
          • relayd
        • Logging
          • syslogd
        • Monitoring
          • SNMP
        • Remote Access
          • Audit OpenSSH
          • sshd
        • File Synchronization
          • rsync
        • Messaging
          • RabbitMQ
        • Time
          • NTP
      • PF
        • pfctl cheat sheet
        • PF Anchors
        • PF Filter Rules
        • PF Forwarding
        • PF Lists and Macros
        • PF Load Balancing
        • PF Logging
        • PF NAT
        • PF Options
        • PF Policies
        • PF Shortcuts
        • PF Tables
      • Advanced Networking
        • High Availability and State Replication
        • Multi-WAN and Policy-Based Routing
        • VPN and Cryptographic Tunneling
        • Classic and Lightweight Tunnels
        • IPv6 at Scale
        • QoS and Traffic Shaping
        • MPLS and Label Distribution
        • Network Services at Scale
        • Virtualization and Host Networking
        • Large-Scale L2 and L3 Design
        • Telemetry, Logging, and Flow Export
        • Hardening and Operational Safety
        • Reference Architectures
        • Troubleshooting Playbooks
      • Serial Communication
    • Part V. Miscellaneous
      • Virtualization Cheat Sheet
      • OpenBSD Cheatsheet
      • How-to Guides
        • Complete the First 30 Minutes After Installation
        • Check Hardware Compatibility Before Installing
        • Bootstrap Wi-Fi Firmware Without Ethernet
        • Set Up OpenBSD as a Laptop or Workstation
        • Configure Laptop Power Management
        • Run OpenBSD as a Virtual Machine Guest
        • Install OpenBSD on a VPS or Cloud Server
        • Install OpenBSD with Full-Disk Encryption
        • Troubleshoot Web Browsers on OpenBSD
        • Create an Administrator Account with doas and SSH Keys
        • Establish a Conservative Security Baseline
        • Manage OpenBSD with Ansible
        • Recover Access and Reset the Root Password
        • Collect OpenBSD Diagnostic Evidence
        • Configure Secure Remote Access with OpenSSH
        • Set Up WordPress
        • Build Third-Party Software from Ports
        • Use FIDO Security Keys with OpenSSH
        • Build OpenBSD from Source
        • Configure Wi-Fi Roaming and Wired Failover
        • Dual-Boot OpenBSD on a UEFI System
        • Troubleshoot PF, NAT, and Routing
        • Automate OpenBSD Installation with Autoinstall and PXE
        • Route Multiple VLANs with PF
        • Configure a Road-Warrior WireGuard VPN
        • Troubleshoot Package Installation and Update Failures
        • Route IPv6 Networks without NAT
        • Schedule Recurring Maintenance
        • Plan a Docker Workload Migration to OpenBSD
        • Build a Mail Server with OpenSMTPD, Dovecot, and Rspamd
        • Build a Simple Router and Firewall
        • Monitor an OpenBSD System
        • Back Up and Restore an OpenBSD System
        • Configure softraid RAID1
        • Recover an OpenBSD System That Does Not Boot
        • Install Z shell (zsh)
      • OpenBSD for Linux Users
      • OpenBSD for FreeBSD Users
      • OpenBSD for macOS Users
    • OpenBSD FAQ
    • Package Search
      • Synopsis
      • Identify Audio and Video Devices
      • Verify sndiod and Playback
      • Enable Audio Recording Deliberately
      • Enable a Webcam Deliberately
      • Install Media Applications
      • Test Video Playback and Capture
      • Record the Screen
      • Unsupported and External Interfaces
      • Troubleshoot by Layer

      Multimedia

      Synopsis #

      OpenBSD provides audio through the audio(4) device layer and sndio(7) framework. Video capture devices use drivers such as uvideo(4) and the video(4) interface. Recording is deliberately disabled by default at the kernel layer.

      This chapter verifies base audio, enables microphone or camera recording only when required, grants camera-device access narrowly, and installs applications through packages. Application names and capabilities can change between releases; the installed package README remains authoritative for package-specific integration.

      Identify Audio and Video Devices #

      Review kernel attachment messages:

      $ dmesg | grep -Ei 'audio|azalia|uaudio|video|uvideo|drm'
      

      Common audio drivers include azalia(4) for High Definition Audio and uaudio(4) for supported USB audio devices. Driver availability depends on architecture and exact hardware.

      List relevant device nodes without changing them:

      $ ls -l /dev/audio* /dev/video* 2>/dev/null
      

      An absent device node can indicate unsupported hardware, a driver attachment failure, or a device node that has not been created. Do not create a node with guessed major and minor numbers. Use MAKEDEV(8) only with the documented target for the architecture.

      Verify sndiod and Playback #

      The base sndiod(8) service normally provides shared audio access. Confirm its state:

      # rcctl check sndiod
      

      If it is configured but stopped, inspect /var/log/daemon and its rcctl(8) flags before restarting it. Do not replace the packaged service with an interactive foreground sndiod command as a persistent configuration.

      Display audio controls with sndioctl(1) :

      $ sndioctl
      

      Inspect hardware mixer controls with mixerctl(8) :

      $ mixerctl -av
      

      Control names and ranges vary by driver and codec. Change only a control reported by the local device.

      Play a known-good WAV file through aucat(1) :

      $ aucat -i test.wav
      

      If playback fails, separate device attachment, sndiod, mixer mute or level, per-user session, and application-format problems.

      Enable Audio Recording Deliberately #

      OpenBSD records silence by default when kern.audio.record is 0. Read the current value:

      $ sysctl kern.audio.record
      

      Enable recording for the current boot only when microphone access is required:

      # sysctl kern.audio.record=1
      

      Some devices also expose a record.enable mixer control. Inspect local controls before changing it:

      $ mixerctl -av | grep record
      

      Test recording with a short file:

      $ aucat -o recording.wav
      

      Stop the command after a short sample and play the result. If recording is a permanent host requirement, add this line to /etc/sysctl.conf:

      kern.audio.record=1
      

      This is a system-wide recording capability, not a per-browser permission. Disable it again when the host does not require recording.

      Enable a Webcam Deliberately #

      OpenBSD blanks video capture by default when kern.video.record is 0. Confirm the device and policy:

      $ dmesg | grep uvideo
        # Confirm that a supported USB video device attached
      $ sysctl kern.video.record
        # Display the global video-recording policy
      $ ls -l /dev/video*
        # Display device ownership and mode
      

      Enable video recording for the current boot:

      # sysctl kern.video.record=1
      

      Grant one logged-in account access to the selected device rather than making every camera world-accessible:

      # chown alice /dev/video0
      

      Replace alice and /dev/video0 with the intended account and verified device. Device ownership is separate from the global recording sysctl. Revisit the assignment when users change, device nodes are recreated, or the machine becomes multi-user.

      If video recording is a permanent host requirement, add this line to /etc/sysctl.conf:

      kern.video.record=1
      

      The installed browser or conferencing package README can require additional pledge, unveil, or session configuration. Apply only the documented narrow change.

      Install Media Applications #

      Search the packages available for the running release:

      $ pkg_info -Q mpv
        # Search for a media player package
      $ pkg_info -Q ffmpeg
        # Search for media conversion tools
      

      Install only the selected package:

      # pkg_add mpv
      

      Read installation messages and any file under /usr/local/share/doc/pkg-readmes/ before launching the application or enabling a daemon. Do not assume a Linux audio backend, capture format, hardware-acceleration flag, streaming service, or digital-rights-management component exists on OpenBSD.

      Test Video Playback and Capture #

      Test a known-good local media file before diagnosing network streaming:

      $ mpv test-video.mkv
      

      For a webcam, use the input format documented by the installed FFmpeg package. OpenBSD’s video(4) layer implements the supported V4L2 interface used by current FFmpeg packages. A typical test is:

      $ ffplay -f v4l2 -i /dev/video0
      

      Confirm the local ffplay -devices output and package documentation before adding format-specific options. Browser capture additionally depends on site permission and browser policy.

      Record the Screen #

      Screen capture reads pixels from the current X session and does not use the camera privacy control. Confirm that the installed FFmpeg package provides the x11grab input, then record from the current display as the logged-in graphical user:

      $ ffmpeg -f x11grab -i "$DISPLAY" screen.mkv
      

      Stop the command after a short test and inspect the result. Screen recording can capture passwords, messages, notifications, and private windows. Close unrelated applications and protect the output file. Adding microphone audio is a separate recording path and requires the audio privacy control described above.

      Unsupported and External Interfaces #

      OpenBSD does not provide a Bluetooth stack for Bluetooth audio devices. Use a supported USB audio device, a wired interface, or a network protocol supported by an installed application.

      Commercial streaming services can require unavailable DRM modules or change their browser requirements without notice. Package availability does not guarantee that a third-party service supports OpenBSD.

      Troubleshoot by Layer #

      Collect focused evidence:

      $ dmesg | grep -Ei 'audio|azalia|uaudio|video|uvideo|drm'
        # Confirm driver attachment
      # rcctl check sndiod
        # Confirm the shared audio daemon
      $ sndioctl
        # Inspect sndio controls
      $ mixerctl -av
        # Inspect hardware mixer state
      $ sysctl kern.audio.record kern.video.record
        # Confirm recording privacy policy
      $ ls -l /dev/video*
        # Confirm camera device access
      

      Then reproduce with the smallest base or packaged tool before testing a browser, desktop portal, or streaming application. See Troubleshoot Web Browsers and Collect OpenBSD Diagnostic Evidence for the next layer.

      Report a bug
      • Synopsis
      • Identify Audio and Video Devices
      • Verify sndiod and Playback
      • Enable Audio Recording Deliberately
      • Enable a Webcam Deliberately
      • Install Media Applications
      • Test Video Playback and Capture
      • Record the Screen
      • Unsupported and External Interfaces
      • Troubleshoot by Layer