Added documentation for using tuxrecord on PipeWire based systems.

This commit is contained in:
Johannes Findeisen 2026-10-09 23:36:54 +02:00
commit e699adfa60
2 changed files with 79 additions and 9 deletions

View file

@ -5,9 +5,8 @@ Record audio to a WAV file on **Linux** using **ALSA** as the recording source.
`tuxrecord` is the Linux port of the former macOS-only **macrecord** tool. The
Swift/AVFoundation code was rewritten in **C99** and now uses the native ALSA
capture API (`libasound`); it builds with **GCC**.
The port is derived from [macrecord](https://codeberg.org/armin/macrecord)
which was created by my good friend armin.
macrecord was created by my good friend Armin. You can find his code here:
[https://codeberg.org/armin/macrecord](https://codeberg.org/armin/macrecord)
## Requirements
@ -32,6 +31,9 @@ tuxrecord -p myrec
# Use a specific ALSA capture device
tuxrecord -D hw:1,0
# Record from PipeWire (the PipeWire sound server)
tuxrecord -D pipewire
```
## Options
@ -41,10 +43,12 @@ tuxrecord -D hw:1,0
| `-o <dir>` | Output directory (default: current directory) |
| `-d <secs>` | Stop automatically after `<secs>` seconds |
| `-p <prefix>` | Filename prefix instead of `tuxrecord` |
| `-D <device>` | ALSA capture device (default: `default`) |
| `-D <device>` | ALSA capture device (default: `default`; `pipewire` on PipeWire systems) |
| `-h, --help` | Show help |
Run `arecord -l` to list available ALSA capture devices.
Run `arecord -l` to list available ALSA capture devices. On systems with
PipeWire, list the PipeWire source nodes with `pactl list short sources`
or `wpctl status` (see "Recording from PipeWire" below).
## Controls
@ -80,6 +84,67 @@ through. Point your players at `hw:Loopback,0` (default sink) and record from
kernel version; if one direction is silent, try recording from
`hw:Loopback,0` while playing to `hw:Loopback,1`.
## Recording from PipeWire
On modern distributions (Fedora 34+, Ubuntu 22.04+, Arch Linux) the **PipeWire**
sound server takes over audio handling. PipeWire ships an ALSA compatibility
plugin (`pipewire-alsa`) that exposes the server as a normal ALSA capture
device named `pipewire`, so `tuxrecord` can record from it with no extra
setup:
```bash
# Record from PipeWire's default source (usually the microphone)
tuxrecord -D pipewire
# Record a fixed duration
tuxrecord -D pipewire -d 10
```
### What "pipewire" records
The pipewire-alsa plugin routes capture to PipeWire's **default source**:
```bash
# Show the current default source
pactl get-default-source # or: wpctl status
# List all available PipeWire sources
wpctl status
pactl list short sources
```
### Recording system audio (what you hear)
To capture everything that is currently playing (system audio), point the
default source at the **monitor** of the default sink. This is the PipeWire
equivalent of the ALSA loopback approach above but needs no kernel module:
```bash
# 1. Find the monitor of the default sink
pactl set-default-source "$(pactl get-default-sink).monitor"
# 2. Record it with tuxrecord
tuxrecord -D pipewire
```
The `.monitor` source carries exactly what the sink is playing, so anything
your players output ends up in the WAV file. Every capture follows the same
`<prefix>__<timestamp>.wav` naming and can be stopped with `q` or **Ctrl+C**.
The default setting can be restored later with
`pactl set-default-source <your-input-source>`.
### Troubleshooting
- **"cannot open ALSA capture device 'pipewire'"** — the `pipewire-alsa`
plugin is missing. Install it (e.g. `pipewire-alsa` on Debian/Ubuntu/Arch,
`pipewire-alsa` on Fedora), or the PipeWire server is not running
(`systemctl --user status pipewire`). In that case fall back to a regular
ALSA device with `tuxrecord -D hw:0,0`.
- Recording from a specific device or virtual node instead of the default
source is possible by setting the default source first (see `pactl` /
`wpctl` output) or by creating a loopback with `pw-loopback` and recording
that node.
## Build
```bash