From 414606b58ea6b77698a614835918513f80463421 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 25 May 2021 18:18:40 +0200 Subject: [PATCH] modules: bluetooth: add pipewire codecs --- modules/bluetooth.nix | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/modules/bluetooth.nix b/modules/bluetooth.nix index 661ed60..b4b8362 100644 --- a/modules/bluetooth.nix +++ b/modules/bluetooth.nix @@ -24,6 +24,43 @@ in extraModules = [ pkgs.pulseaudio-modules-bt ]; package = pkgs.pulseaudioFull; }; + + services.pipewire = { + media-session.config.bluez-monitor.rules = [ + { + # Matches all cards + matches = [{ "device.name" = "~bluez_card.*"; }]; + actions = { + "update-props" = { + "bluez5.reconnect-profiles" = [ + "hfp_hf" + "hsp_hs" + "a2dp_sink" + ]; + # mSBC provides better audio + microphone + "bluez5.msbc-support" = true; + # SBC XQ provides better audio + "bluez5.sbc-xq-support" = true; + }; + }; + } + { + matches = [ + # Matches all sources + { + "node.name" = "~bluez_input.*"; + } + # Matches all outputs + { + "node.name" = "~bluez_output.*"; + } + ]; + actions = { + "node.pause-on-idle" = false; + }; + } + ]; + }; }) # Support for A2DP audio profile