Skip to content

Commit

Permalink
pipewire: make local streaming go through ROC to have exactly same la…
Browse files Browse the repository at this point in the history
…tency
  • Loading branch information
xddxdd committed Apr 20, 2024
1 parent 888ac65 commit c161d7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 51 deletions.
6 changes: 5 additions & 1 deletion hosts/lt-hp-omen/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
../../nixos/optional-apps/nvidia/prime.nix
../../nixos/optional-apps/obs-studio.nix
../../nixos/optional-apps/pipewire-roc-sink.nix
../../nixos/optional-apps/pipewire-roc-source.nix
../../nixos/optional-apps/samba.nix
../../nixos/optional-apps/syncthing.nix
../../nixos/optional-apps/vlmcsd.nix
Expand All @@ -44,7 +45,10 @@
};
hardware.xpadneo.enable = true;

lantian.pipewire.roc-sink-ip = [ "192.168.0.207" ];
lantian.pipewire.roc-sink-ip = [
"127.0.0.1"
"192.168.0.207"
];

# This host has full disk encryption, no need to encrypt keyring
security.pam.services.login.enableGnomeKeyring = lib.mkForce false;
Expand Down
51 changes: 1 addition & 50 deletions hosts/lt-hp-omen/pipewire-combined-sink.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,6 @@
name = "pipewire-combined-sink";
text = builtins.toJSON {
"context.modules" = [
{
name = "libpipewire-module-loopback";
args = {
"node.description" = "100ms latency to sync with ROC Sink";
"target.delay.sec" = 0.1;
"capture.props" = {
"node.name" = "latency.sink";
"node.description" = "100ms Latency Sink";
"media.class" = "Stream/Input/Audio";
"audio.position" = [
"FL"
"FR"
];
"node.autoconnect" = false;
};
"playback.props" = {
"node.name" = "latency.source";
"node.description" = "100ms Latency Source";
"node.passive" = true;
"media.class" = "Stream/Output/Audio";
"audio.position" = [
"FL"
"FR"
];
"target.object" = "alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink";
};
};
}
{
name = "libpipewire-module-combine-stream";
args = {
Expand All @@ -53,33 +25,12 @@
"FR"
];
"stream.rules" = [
# Physical speakers with latency compensation
{
matches = [
{
"media.class" = "Stream/Input/Audio";
"node.name" = "latency.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";
"node.name" = "~roc-sink-.*";
}
];
actions = {
Expand Down

0 comments on commit c161d7a

Please sign in to comment.