PipeWire: Difference between revisions
imported>Fufexan |
imported>Fufexan Rewrite alsa-monitor configuration in module-specific option |
||
| Line 77: | Line 77: | ||
As a general rule, the values in <code>pipewire-pulse</code> should not be lower than the ones in <code>pipewire</code>. | As a general rule, the values in <code>pipewire-pulse</code> should not be lower than the ones in <code>pipewire</code>. | ||
===Controlling the ALSA devices=== | ===Controlling the ALSA devices=== | ||
It is possible to configure various aspects of soundcards through | It is possible to configure various aspects of soundcards through PipeWire, including format, period size and batch mode: | ||
<syntaxHighlight lang="nix"> | <syntaxHighlight lang="nix"> | ||
services.pipewire = { | |||
media-session.config.alsa-monitor = { | |||
rules = [ | |||
{ | |||
matches = [ { "node.name" = "alsa_output.*" } ]; | |||
actions = { | |||
update-props = { | |||
"audio.format" = "S16LE"; | |||
"audio.rate" = 48000; | |||
"api.alsa.period-size" = 160; # defaults to 1024, tweak by trial-and-error | |||
} | #"api.alsa.disable-batch" = true; # generally, USB soundcards use the batch mode | ||
} | }; | ||
}; | |||
}; | |||
]; | |||
}; | |||
}; | |||
</syntaxHighlight> | </syntaxHighlight> | ||
The <code>matches</code> attribute applies the <code>actions</code> to the devices/properties listed there. It is usually used with soundcard names, like shown in the config above. <code><alsa_device></code> can be one of the outputs of | The <code>matches</code> attribute applies the <code>actions</code> to the devices/properties listed there. It is usually used with soundcard names, like shown in the config above. <code><alsa_device></code> can be one of the outputs of | ||