Commit 091f16d

HPCesia <me@hpcesia.com>
2026-09-23 09:23:39
game: fix dualsense haptics in linux 7
1 parent 9eee786
Changed files (1)
modules
desktop
modules/desktop/game/misc.nix
@@ -1,7 +1,12 @@
 {den, ...}: {
   den.aspects.desktop.game.includes = [den.aspects.desktop.game.misc];
   den.aspects.desktop.game.misc = {
-    nixos = {pkgs, ...}: let
+    nixos = {
+      pkgs,
+      lib,
+      config,
+      ...
+    }: let
       # Fix DualSense haptics until https://github.com/alsa-project/alsa-ucm-conf/issues/677 been resolved.
       alsa-ucm-conf-dualsense-haptics = with pkgs;
         alsa-ucm-conf.overrideAttrs {
@@ -12,6 +17,15 @@
         };
     in {
       environment.sessionVariables.ALSA_CONFIG_UCM2 = "${alsa-ucm-conf-dualsense-haptics}/share/alsa/ucm2";
+      # Linux 7.1-7.2 sticky-mixer detection falsely hides the DualSense "PCM Playback Volume"
+      # that haptics need at 100%.
+      # NOTE: 7.3 demotes the check and flips the flag to MIXER_GET_CUR_OK.
+      boot.extraModprobeConfig = let
+        kernelVersion = lib.getVersion config.boot.kernelPackages.kernel;
+      in
+        lib.mkIf
+        (lib.versionAtLeast kernelVersion "7.1" && lib.versionOlder kernelVersion "7.3")
+        "options snd_usb_audio quirk_flags=054c:0ce6:MIXER_GET_CUR_BROKEN, 054c:0df2:MIXER_GET_CUR_BROKEN";
 
       programs.gamemode.enable = true;