PipeWire 1.6.4
Loading...
Searching...
No Matches
rnnoise-toggle

Toggle the rnnoise noise suppression source

SYNOPSIS

rnnoise-toggle [-q] on

rnnoise-toggle [-q] off [\fIsource\fR]

rnnoise-toggle [-q] status

rnnoise-toggle -h

DESCRIPTION

rnnoise-toggle switches the default PipeWire capture source to or from the rnnoise noise-suppression source (effect_output.rnnoise).

It is a convenience wrapper around pactl set-default-source that complements the rnnoise filter-chain configuration (see source-rnnoise.conf).

When enabling noise suppression with the on command, the current default source is saved to a per-user runtime state file ($XDG_RUNTIME_DIR/rnnoise-toggle-original-source) so that it can be restored later. When disabling with off, the saved source is restored automatically unless an explicit source name is given. The state file is cleared on logout/reboot, which is the desired behaviour since the saved source name may not be valid after reinitialisation.

The state file is written atomically and with access mode 0600 to prevent tampering or race conditions. Source names passed to off or read from the state file are validated to contain only safe characters (a-z A-Z 0-9 . _ -). All toggle actions (on, off, success, failure) are logged to the system journal via logger -t rnnoise-toggle for audit purposes.

OPTIONS

-q, –quiet
Suppress informational messages. Errors are still printed to standard error.
-h, –help
Show help and exit.

COMMANDS

on
Enable noise suppression by setting the default source to effect_output.rnnoise. The current default source is saved to the state file. Fails if the rnnoise source node is not present, indicating that the filter-chain configuration is not loaded.
off [\fIsource\fR]
Disable noise suppression. If the optional source argument is given, it is set as the new default source. Otherwise, the previously saved original source (from the on command) is restored. If no saved source exists and no explicit source is given, the available sources are listed on standard error and an error is returned (see EXIT STATUS).
status
Print the current state to standard output: on when the default source is effect_output.rnnoise, off otherwise. If pactl fails to query the default source (e.g. pipewire-pulse is not running), the command prints an error to standard error and exits with code 3 instead of printing a potentially misleading off.

EXIT STATUS

0
Success.
1
Usage error: unknown command, missing argument, or no saved source to restore. Available source names are listed on standard error in this case.
2
Missing dependency: pactl was not found in PATH.
3
pactl command failed: the rnnoise source is not available, setting the default source failed, or querying the default source failed (in status mode).

EXAMPLES

Enable noise suppression:
rnnoise-toggle on
Disable, restoring the saved original source:
rnnoise-toggle off
Disable and explicitly set a hardware source:
rnnoise-toggle off alsa_input.pci-0000_00_1f.3.HiFi__Mic__source
Capture the current state into a shell variable:
state=$(rnnoise-toggle status)

AUTHORS

The PipeWire Developers https://github.com/deepin-community/pipewire/issues; PipeWire is available from https://github.com/deepin-community/pipewire

SEE ALSO

pipewire(1), pw-cli(1), pactl(1)

The rnnoise filter-chain configuration is typically located at: /usr/share/pipewire/filter-chain.conf.d/source-rnnoise.conf