PipeWire: Difference between revisions

imported>Aditya-adiraju
m I tried copy pasting the code for the low-latency setup and was met with a bunch of syntax errors for the missing semicolons. So, I added them in the associated code block
Jopejoe1 (talk | contribs)
Fix pipewire examples
Line 125: Line 125:
<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
services.pipewire.extraConfig.pipewire."91-null-sinks" = {
services.pipewire.extraConfig.pipewire."91-null-sinks" = {
   context.objects = [
   "context.objects" = [
     {
     {
       # A default dummy driver. This handles nodes marked with the "node.always-driver"
       # A default dummy driver. This handles nodes marked with the "node.always-driver"
Line 131: Line 131:
       factory = "spa-node-factory";
       factory = "spa-node-factory";
       args = {
       args = {
         factory.name    = "support.node.driver";
         "factory.name"     = "support.node.driver";
         node.name        = "Dummy-Driver";
         "node.name"       = "Dummy-Driver";
         priority.driver  = 8000;
         "priority.driver" = 8000;
       };
       };
     }
     }
Line 139: Line 139:
       factory = "adapter";
       factory = "adapter";
       args = {
       args = {
         factory.name    = "support.null-audio-sink";
         "factory.name"     = "support.null-audio-sink";
         node.name        = "Microphone-Proxy";
         "node.name"       = "Microphone-Proxy";
         node.description = "Microphone";
         "node.description" = "Microphone";
         media.class      = "Audio/Source/Virtual";
         "media.class"     = "Audio/Source/Virtual";
         audio.position  = "MONO";
         "audio.position"   = "MONO";
       };
       };
     }
     }
Line 149: Line 149:
       factory = "adapter";
       factory = "adapter";
       args = {
       args = {
         factory.name    = "support.null-audio-sink";
         "factory.name"     = "support.null-audio-sink";
         node.name        = "Main-Output-Proxy";
         "node.name"       = "Main-Output-Proxy";
         node.description = "Main Output";
         "node.description" = "Main Output";
         media.class      = "Audio/Sink";
         "media.class"     = "Audio/Sink";
         audio.position  = "FL,FR";
         "audio.position"   = "FL,FR";
       };
       };
     }
     }
Line 166: Line 166:
in {
in {
   "pipewire/pipewire.d/91-null-sinks.conf".source = json.generate "91-null-sinks.conf" {
   "pipewire/pipewire.d/91-null-sinks.conf".source = json.generate "91-null-sinks.conf" {
     context.objects = [
     "context.objects" = [
       {
       {
         # A default dummy driver. This handles nodes marked with the "node.always-driver"
         # A default dummy driver. This handles nodes marked with the "node.always-driver"
Line 172: Line 172:
         factory = "spa-node-factory";
         factory = "spa-node-factory";
         args = {
         args = {
           factory.name    = "support.node.driver";
           "factory.name"     = "support.node.driver";
           node.name        = "Dummy-Driver";
           "node.name"       = "Dummy-Driver";
           priority.driver  = 8000;
           "priority.driver" = 8000;
         };
         };
       }
       }
Line 180: Line 180:
         factory = "adapter";
         factory = "adapter";
         args = {
         args = {
           factory.name    = "support.null-audio-sink";
           "factory.name"     = "support.null-audio-sink";
           node.name        = "Microphone-Proxy";
           "node.name"       = "Microphone-Proxy";
           node.description = "Microphone";
           "node.description" = "Microphone";
           media.class      = "Audio/Source/Virtual";
           "media.class"     = "Audio/Source/Virtual";
           audio.position  = "MONO";
           "audio.position"   = "MONO";
         };
         };
       }
       }
Line 190: Line 190:
         factory = "adapter";
         factory = "adapter";
         args = {
         args = {
           factory.name    = "support.null-audio-sink";
           "factory.name"     = "support.null-audio-sink";
           node.name        = "Main-Output-Proxy";
           "node.name"       = "Main-Output-Proxy";
           node.description = "Main Output";
           "node.description" = "Main Output";
           media.class      = "Audio/Sink";
           "media.class"     = "Audio/Sink";
           audio.position  = "FL,FR";
           "audio.position"   = "FL,FR";
         };
         };
       }
       }
Line 223: Line 223:
<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
services.pipewire.extraConfig.pipewire."92-low-latency" = {
services.pipewire.extraConfig.pipewire."92-low-latency" = {
   context.properties = {
   "context.properties" = {
     default.clock.rate = 48000;
     "default.clock.rate" = 48000;
     default.clock.quantum = 32;
     "default.clock.quantum" = 32;
     default.clock.min-quantum = 32;
     "default.clock.min-quantum" = 32;
     default.clock.max-quantum = 32;
     "default.clock.max-quantum" = 32;
   };
   };
};
};
Line 241: Line 241:
<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
services.pipewire.extraConfig.pipewire-pulse."92-low-latency" = {
services.pipewire.extraConfig.pipewire-pulse."92-low-latency" = {
   context.modules = [
   "context.modules" = [
     {
     {
       name = "libpipewire-module-protocol-pulse";
       name = "libpipewire-module-protocol-pulse";
       args = {
       args = {
         pulse.min.req = "32/48000";
         "pulse.min.req" = "32/48000";
         pulse.default.req = "32/48000";
         "pulse.default.req" = "32/48000";
         pulse.max.req = "32/48000";
         "pulse.max.req" = "32/48000";
         pulse.min.quantum = "32/48000";
         "pulse.min.quantum" = "32/48000";
         pulse.max.quantum = "32/48000";
         "pulse.max.quantum" = "32/48000";
       };
       };
     }
     }
   ];
   ];
   stream.properties = {
   "stream.properties" = {
     node.latency = "32/48000";
     "node.latency" = "32/48000";
     resample.quality = 1;
     "resample.quality" = 1;
   };
   };
};
};