Skip to content

Commit

Permalink
pipewire: add combined sink on lt-hp-omen
Browse files Browse the repository at this point in the history
  • Loading branch information
xddxdd committed Apr 18, 2024
1 parent 1b23a6e commit d1e74de
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 1 deletion.
1 change: 1 addition & 0 deletions hosts/lt-hp-omen/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
./hp-keyboard-backlight
./nandsim.nix
# ./nbfc.nix
./pipewire-combined-sink.nix

../../nixos/optional-apps/clamav.nix
../../nixos/optional-apps/glauth.nix
Expand Down
78 changes: 78 additions & 0 deletions hosts/lt-hp-omen/pipewire-combined-sink.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
pkgs,
lib,
LT,
config,
utils,
inputs,
...
}@args:
{
config.services.pipewire.configPackages = [
(pkgs.writeTextFile {
name = "pipewire-combined-sink";
text = builtins.toJSON {
"context.modules" = [
{
name = "libpipewire-module-combine-stream";
args = {
"combine.mode" = "sink";
"node.name" = "combine_sink";
"node.description" = "Combined Sink";
"combine.latency-compensate" = true;
"combine.props"."audio.position" = [
"FL"
"FR"
];
"stream.rules" = [
# Physical speakers
{
matches = [
{
"media.class" = "Audio/Sink";
"node.name" = "alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink";
}
];
actions = {
create-stream = {
"combine.audio.position" = [
"FL"
"FR"
];
"audio.position" = [
"FL"
"FR"
];
};
};
}
# Network receiver
{
matches = [
{
"media.class" = "Audio/Sink";
"node.name" = "roc-sink-192.168.0.207";
}
];
actions = {
create-stream = {
"combine.audio.position" = [
"FL"
"FR"
];
"audio.position" = [
"FL"
"FR"
];
};
};
}
];
};
}
];
};
destination = "/share/pipewire/pipewire.conf.d/combined-sink.conf";
})
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
n:
pkgs.writeTextFile {
name = "pipewire-${n}-resample-quality";
text = builtins.toJSON { "stream.properties"."resample.quality" = 10; };
text = builtins.toJSON {
"context.properties"."default.clock.min-quantum" = 1024;
"stream.properties"."resample.quality" = 10;
};
destination = "/share/pipewire/${n}.conf.d/resample-quality.conf";
}
)
Expand Down

0 comments on commit d1e74de

Please sign in to comment.