diff --git a/config/profiles/gui/sound.nix b/config/profiles/gui/sound.nix index 043089bd..7125c10c 100644 --- a/config/profiles/gui/sound.nix +++ b/config/profiles/gui/sound.nix @@ -17,80 +17,21 @@ config = { pipewire = { "context.properties" = { - "link.max-buffers" = 16; "log.level" = 2; - "default.clock.rate" = 48000; - "default.clock.quantum" = 32; - "default.clock.min-quantum" = 32; - "default.clock.max-quantum" = 32; - "core.daemon" = true; - "core.name" = "pipewire-0"; + "default.clock.min-quantum" = + 32; # default; going lower may cause crackles and distorted audio }; - "context.modules" = [ - { - name = "libpipewire-module-rtkit"; - args = { - "nice.level" = -15; - "rt.prio" = 88; - "rt.time.soft" = 200000; - "rt.time.hard" = 200000; - }; - flags = [ "ifexists" "nofail" ]; - } - { name = "libpipewire-module-protocol-native"; } - { name = "libpipewire-module-profiler"; } - { name = "libpipewire-module-metadata"; } - { name = "libpipewire-module-spa-device-factory"; } - { name = "libpipewire-module-spa-node-factory"; } - { name = "libpipewire-module-client-node"; } - { name = "libpipewire-module-client-device"; } - { - name = "libpipewire-module-portal"; - flags = [ "ifexists" "nofail" ]; - } - { - name = "libpipewire-module-access"; - args = {}; - } - { name = "libpipewire-module-adapter"; } - { name = "libpipewire-module-link-factory"; } - { name = "libpipewire-module-session-manager"; } - ]; - }; - pipewire-pulse = { - "context.properties" = { - "log.level" = 2; - }; - "context.modules" = [ - { - name = "libpipewire-module-rtkit"; - args = { - "nice.level" = -15; - "rt.prio" = 88; - "rt.time.soft" = 200000; - "rt.time.hard" = 200000; - }; - flags = [ "ifexists" "nofail" ]; - } - { name = "libpipewire-module-protocol-native"; } - { name = "libpipewire-module-client-node"; } - { name = "libpipewire-module-adapter"; } - { name = "libpipewire-module-metadata"; } - { + pipewire-pulse = { + "context.modules" = [{ name = "libpipewire-module-protocol-pulse"; args = { - "pulse.min.req" = "32/48000"; - "pulse.default.req" = "32/48000"; - "pulse.max.req" = "32/48000"; - "pulse.min.quantum" = "32/48000"; - "pulse.max.quantum" = "32/48000"; - "server.address" = [ "unix:native" ]; + "pulse.min.quantum" = 32; # controls minimum playback quant + "pulse.min.req" = 32; # controls minimum recording quant + "pulse.min.frag" = 32; # controls minimum fragment size + "server.address" = + [ "unix:native" ]; # the default address of the server }; - } - ]; - "stream.properties" = { - "node.latency" = "32/48000"; - "resample.quality" = 1; + }]; }; }; }; diff --git a/config/profiles/hardware/networkmanager.nix b/config/profiles/hardware/networkmanager.nix index 822fa713..0eae5132 100644 --- a/config/profiles/hardware/networkmanager.nix +++ b/config/profiles/hardware/networkmanager.nix @@ -15,8 +15,35 @@ }; }; config = { - hardware.bluetooth.enable = true; + hardware.bluetooth = { + enable = true; + settings = { + General = { + Enable = "Source,Sink,Media,Socket"; + }; + }; + }; services.blueman.enable = true; + services.pipewire.media-session.config.bluez-monitor = { + properties = { }; + rules = [ + { + actions = { + update-props = { + "bluez5.a2dp-source-role" = "input"; + "bluez5.auto-connect" = [ "hfp_hf" "hsp_hs" "a2dp_sink" "a2dp_source" "hsp_ag" "hfp_ag" ]; + }; + }; + matches = [ { "device.name" = "~bluez_card.*"; } ]; + } + { + actions = { + update-props = { "node.pause-on-idle" = false; }; + }; + matches = [ { "node.name" = "~bluez_input.*"; } { "node.name" = "~bluez_output.*"; } ]; + } + ]; + }; networking = { networkmanager = { enable = true;