rust-rodio-wsl2-audio

Installation
SKILL.md

Rust Audio (rodio) on WSL2

Problem

Compiling and running Rust projects using rodio (or cpal) for audio on WSL2 fails at two stages:

  1. Compile time: Missing ALSA development headers
  2. Runtime: ALSA can't find audio devices because WSL2 uses PulseAudio via WSLg

Context / Trigger Conditions

Compilation Error

The system library `alsa` required by crate `alsa-sys` was not found.
The file `alsa.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
Installs
1
First Seen
Apr 1, 2026