feat(audio): Start using libpipewire-module-combine-stream
Previously we used virtual audio sinks and sources for combinging and
splitting audio streams, this caused audio to become choppy, switching
to libpipewire-module-combine-stream instead duplicates the audio stream
to each sink which eliminates this issue
Change-Id: I4def965d9acfccca16713ebdb530b7facd02d209
Reviewed-on: https://git.clicks.codes/c/Chimera/NixFiles/+/842
Reviewed-by: Skyler Grey <minion@clicks.codes>
Tested-by: Samuel Shuert <coded@clicks.codes>
diff --git a/systems/x86_64-linux/shorthair/audio/default.nix b/systems/x86_64-linux/shorthair/audio/default.nix
new file mode 100644
index 0000000..9b1151f
--- /dev/null
+++ b/systems/x86_64-linux/shorthair/audio/default.nix
@@ -0,0 +1,41 @@
+{...}: {
+ services.pipewire.extraConfig.pipewire."new-virtual-devices" = {
+ "context.modules" = [
+ {
+ name = "libpipewire-module-combine-stream";
+ args = {
+ "combine.mode" = "sink";
+ "node.name" = "output";
+ "node.description" = "Combined Outputs";
+ "combine.latency-compensate" = false;
+ "combine.props" = {
+ "audio.position" = [ "FL" "FR" ];
+ };
+ "stream.props" = {
+ "stream.dont-remix" = true;
+ };
+ "stream.rules" = [
+ {
+ matches = [
+ {
+ "media.class" = "Audio/Sink";
+ "node.name" = "alsa_output.usb-NXP_SEMICONDUCTORS_Razer_Kraken_V3_Pro-00.analog-stereo";
+ }
+ {
+ "media.class" = "Audio/Sink";
+ "node.name" = "alsa_output.usb-R__DE_RODECaster_Duo_IR0023015-00.analog-stereo";
+ }
+ ];
+ actions = {
+ create-stream = {
+ "audio.position" = [ "FL" "FR" ];
+ "combine.audio.position" = [ "FL" "FR" ];
+ };
+ };
+ }
+ ];
+ };
+ }
+ ];
+ };
+}
diff --git a/systems/x86_64-linux/shorthair/default.nix b/systems/x86_64-linux/shorthair/default.nix
index d0aabb2..eecc5a8 100644
--- a/systems/x86_64-linux/shorthair/default.nix
+++ b/systems/x86_64-linux/shorthair/default.nix
@@ -2,6 +2,7 @@
{
imports = [
./assistant
+ ./audio
./boot
./backlight
./compositor