From 38079311831bd64f7c76e891fa2af7ab2ea08cb0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 20 Aug 2017 19:35:11 +0200 Subject: Try fancier audio setup --- bragi.nix | 26 ++++++++++++++++---------- custom/trivmix-service.nix | 3 ++- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/bragi.nix b/bragi.nix index 93af8fd7..67f8daf5 100644 --- a/bragi.nix +++ b/bragi.nix @@ -146,20 +146,26 @@ in rec { }; }; - systemd.services."mpdmix0" = trivmixService { name = "mpdmix0"; connectOut = "system:playback_3"; group = "mpd"; initial = "-35dB"; }; - systemd.services."mpdmix1" = trivmixService { name = "mpdmix1"; connectOut = "system:playback_4"; group = "mpd"; initial = "-35dB"; }; + systemd.services."mpdmix0" = trivmixService { name = "mpdmix0"; connectOut = "outnode0:in"; group = "mpd"; initial = "-35dB"; }; + systemd.services."mpdmix1" = trivmixService { name = "mpdmix1"; connectOut = "outnode1:in"; group = "mpd"; initial = "-35dB"; }; - systemd.services."passmix0" = trivmixService { name = "passmix0"; connectOut = "system:playback_3"; connectIn = "system:capture_5"; group = "vali_out"; initial = "-5dB"; }; - systemd.services."passmix1" = trivmixService { name = "passmix1"; connectOut = "system:playback_4"; connectIn = "system:capture_6"; group = "vali_out"; initial = "-5dB"; }; + systemd.services."passmix0" = trivmixService { name = "passmix0"; connectOut = "outnode0:in"; connectIn = "system:capture_5"; group = "vali_out"; initial = "-5dB"; }; + systemd.services."passmix1" = trivmixService { name = "passmix1"; connectOut = "outnode1:in"; connectIn = "system:capture_6"; group = "vali_out"; initial = "-5dB"; }; - systemd.services."passmix2" = trivmixService { name = "passmix2"; connectOut = "system:playback_5"; connectIn = "system:capture_1"; group = "vali_in"; initial = "1"; }; - systemd.services."passmix3" = trivmixService { name = "passmix3"; connectOut = "system:playback_6"; connectIn = "system:capture_1"; group = "vali_in"; initial = "1"; }; + systemd.services."passmix2" = trivmixService { name = "passmix2"; connectOut = "system:playback_5"; connectIn = "system:capture_1"; group = "mic_out"; initial = "1"; }; + systemd.services."passmix3" = trivmixService { name = "passmix3"; connectOut = "system:playback_6"; connectIn = "system:capture_1"; group = "mic_out"; initial = "1"; }; - systemd.services."passmix4" = trivmixService { name = "passmix4"; connectOut = "system:playback_3"; connectIn = "system:capture_7"; group = "hel_out"; initial = "-5dB"; }; - systemd.services."passmix5" = trivmixService { name = "passmix5"; connectOut = "system:playback_4"; connectIn = "system:capture_8"; group = "hel_out"; initial = "-5dB"; }; + systemd.services."passmix4" = trivmixService { name = "passmix4"; connectOut = "outnode0:in"; connectIn = "system:capture_7"; group = "hel_out"; initial = "-5dB"; }; + systemd.services."passmix5" = trivmixService { name = "passmix5"; connectOut = "outnode1:in"; connectIn = "system:capture_8"; group = "hel_out"; initial = "-5dB"; }; - systemd.services."passmix6" = trivmixService { name = "passmix6"; connectOut = "system:playback_7"; connectIn = "system:capture_1"; group = "hel_in"; initial = "1"; }; - systemd.services."passmix7" = trivmixService { name = "passmix7"; connectOut = "system:playback_8"; connectIn = "system:capture_1"; group = "hel_in"; initial = "1"; }; + systemd.services."outnode0" = trivmixService { name = "outnode0"; initial = "1"; }; + systemd.services."outnode1" = trivmixService { name = "outnode1"; initial = "1"; }; + + systemd.services."headphones0" = trivmixService { name = "heaphones0"; connectOut = "system:playback_3"; connectIn = "outnode0:out"; group = "headphones"; initial = "1"; }; + systemd.services."headphones1" = trivmixService { name = "heaphones1"; connectOut = "system:playback_4"; connectIn = "outnode1:out"; group = "headphones"; initial = "1"; }; + + systemd.services."speakers0" = trivmixService { name = "speakers0"; connectOut = "system:playback_7"; connectIn = "outnode0:out"; group = "speakers"; initial = "0"; }; + systemd.services."speakers1" = trivmixService { name = "speakers1"; connectOut = "system:playback_8"; connectIn = "outnode1:out"; group = "speakers"; initial = "0"; }; services.mpd = { enable = true; diff --git a/custom/trivmix-service.nix b/custom/trivmix-service.nix index e9120f88..44044504 100644 --- a/custom/trivmix-service.nix +++ b/custom/trivmix-service.nix @@ -4,6 +4,7 @@ , connectIn ? null , group ? null , initial ? null +, adjustable ? true , trivmix , stdenv , makeWrapper @@ -34,7 +35,7 @@ in { ${optionalString connect "--run ${connectScript}"} \ ${optionalString (! isNull run) "--run ${run}"} \ ${optionalString (! isNull initial) "--level ${initial}"} \ - /dev/shm/mix/${name}/level \ + ${optionalString (adjustable && isNull group) "/dev/shm/mix/${name}/level"} \ ${optionalString (! isNull group) "/dev/shm/mix/${group}/level"} ''; User = "jack"; -- cgit v1.2.3