Skip to content
50 changes: 47 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Press  ?  inside  pipmix  for context-sensitive key and mouse help.

## Features

- **Default overview tab**: Keeps your default output device and active playback streams together in one view, alongside dedicated tabs for Playback, Recording, Output Devices, Input Devices, and Cards (`1`–`6` or `Tab`).
- **Default overview tab**: Keeps your default output device and active playback streams together in one view, alongside dedicated tabs for Playback, Recording, Output Devices, Input Devices, and Cards (`1`–`6` or `Tab`). Which streams and devices it shows is configurable.
- **Live level meters**: Smooth per-channel average and peak-hold meters directly inside the volume faders, automatically paused when the terminal loses focus.
- **MPRIS media integration**: Displays currently playing track titles on playback streams, with controls to play/pause (`p`) or solo a stream (`s`).
- **Full keyboard and mouse control**: Emacs and Vim-style keyboard navigation, per-channel volume unlocking (`Space`), port and card profile menus (`p`/`P`), default device switching (`D`), and click-and-drag faders.
Expand All @@ -46,7 +46,7 @@ fps = 60 # max redraws per second (1 to 240)
tab = "default" # starting tab: default, playback, recording, outputs, inputs, cards (or 1 to 6)

[meter]
enable = true
enable = true # draw level meters
always = false # keep metering when the terminal is unfocused
rate = 40 # peaks per second per meter (1 to 200)
mode = "both" # both, average, or peak
Expand All @@ -65,10 +65,54 @@ enable = true # disable to allow normal terminal text selection

[jack]
enable = true # list JACK clients

[default]
recording = "active" # recording streams on the Default tab: off, active (while recording, and 5s after), or all; JACK clients only show on the Recording tab
outputs = "default" # output devices: default, active (others too while in use, and 5s after), or all
inputs = "off" # input devices: off, active (those in use, and 5s after), or all
```

### Hide rules

`[[default.hide]]` rules hide nodes from the Default tab; the other tabs still list everything. They can only be set in the config file. A node is hidden while any rule matching it says so, even when focused.

```toml
# Hide FluidSynth once it has been silent for 5 seconds.
[[default.hide]]
match = { type = "playback", name = "^FluidSynth$" }
when = "silent"
after = "5s"
threshold = -80 # dBFS; quieter peaks count as silence

# Hide Firefox's streams while they don't run.
[[default.hide]]
match = { binary = "firefox" }
when = "idle"

# Hide playback streams as soon as they are muted.
[[default.hide]]
match = { type = "playback" }
when = "muted"
after = "0s"
```

- `match` selects nodes; every key given must match. `pipmix -debug.dump` lists the properties of each node, and the rules each node matches.
- `type`: `playback`, `recording`, `output`, or `input`.
- `name`: a regular expression on `node.name`.
- `description`: a regular expression on `node.description`.
- `app`: a regular expression on `application.name`, or on the process name of a stream from PipeWire's ALSA plugin.
- `binary`: a regular expression on `application.process.binary`.

Regular expressions are unanchored: `firefox` matches anywhere in the value, `^firefox$` only the whole value.
- `when` says when matching nodes hide:
- `always` (the default): always.
- `idle`: while nothing plays or records through the node.
- `muted`: while the node is muted. A volume of 0% doesn't count.
- `silent`: while its level stays below `threshold` (-80 dBFS unless set). Muted nodes and nodes at 0% stay visible; use `muted` for those.
- `after` is how long `idle`, `muted`, or `silent` must last before the node hides; it is 10s unless set. A node shows again as soon as the condition ends, and nodes start out hidden if the condition already holds.

## Technical Details

- **Pure Go PipeWire protocol implementation**: Speaks PipeWire's native SPA POD protocol directly over the PipeWire Unix socket to track graph state and control volumes, mutes, routes, card profiles, and default devices, reconnecting automatically if PipeWire restarts.
- **On-demand metering via `pipewire-pulse`**: Level meters connect directly to the `pipewire-pulse` native socket with peak-detect streams only for the nodes currently visible on screen. When a node scrolls out of view, meters are toggled off (`a`), or the terminal loses focus, its meter streams are closed and the render loop goes quiet so that laptops can save on battery power.
- **On-demand metering via `pipewire-pulse`**: Level meters connect directly to the `pipewire-pulse` native socket with peak-detect streams only for the nodes currently visible on screen, and only for streams that are playing or recording. When a node scrolls out of view, meters are toggled off (`a`), or the terminal loses focus, its meter streams are closed and the render loop goes quiet so that laptops can save on battery power.
- **MPRIS matching over D-Bus**: Watches `org.mpris.MediaPlayer2` players on the session bus and matches them to PipeWire streams by process ID (walking ancestor PIDs so multi-process browsers match their audio streams).
Loading