Skip to content

Commit a1afc79

Browse files
committed
lenovo/legion/16irx8h: add comprehensive audio and hardware support
Add full hardware configuration for Legion Pro 7 16IRX8H including: - Realtek ALC287 + TAS2781 audio with proper kernel params - Bluetooth LE Audio support via BlueZ settings - Thermal management (thermald + ACPI fixes) - Audio group permissions Fixes audio issues where speakers wouldn't work due to missing TAS2781 calibration reset and incorrect HDA model detection.
1 parent e087756 commit a1afc79

File tree

1 file changed

+53
-2
lines changed

1 file changed

+53
-2
lines changed

lenovo/legion/16irx8h/default.nix

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,72 @@
1919
config.boot.kernelPackages.nvidia_x11
2020
];
2121

22+
# Comprehensive audio fixes for Legion Pro 7 16IRX8H
23+
# This model has both Realtek ALC287 and TAS2781 audio components
24+
# The TAS2781 I2C codec binds to the HDA subsystem and requires special handling
25+
boot.kernelParams = [
26+
# Audio configuration
27+
"snd_hda_intel.enable_msi=1"
28+
# Legion-specific audio model (required until kernel quirk is upstreamed)
29+
"snd_hda_intel.model=legion-y7000"
30+
# TAS2781 calibration reset to handle CRC errors in factory calibration data
31+
# This is a known issue on Legion laptops where the TAS2781 firmware has corrupted
32+
# calibration values; resetting allows the codec to initialize with defaults
33+
"snd_soc_tas2781.reset_calib=1"
34+
# Hardware fixes
35+
"tsc=reliable" # Fix TSC ADJUST firmware bugs common on Legion laptops
36+
# ACPI thermal management fixes for Legion BIOS issues
37+
"acpi.debug_layer=0x2"
38+
"acpi.debug_level=0x2"
39+
"processor.ignore_ppc=1"
40+
];
41+
42+
# Additional audio configuration for Legion Pro 7
43+
boot.extraModprobeConfig = ''
44+
# Force specific Legion audio model for proper speaker routing
45+
options snd-hda-intel model=lenovo-legion-7i
46+
'';
47+
48+
# Hardware firmware support for Legion audio
49+
hardware.enableRedistributableFirmware = lib.mkDefault true;
50+
51+
# Enable Bluetooth modules
52+
boot.kernelModules = [
53+
"bluetooth"
54+
"btusb"
55+
];
56+
2257
hardware = {
2358
nvidia = {
2459
modesetting.enable = lib.mkDefault true;
2560
powerManagement.enable = lib.mkDefault true;
26-
#
2761
prime = {
2862
intelBusId = "PCI:00:02:0";
2963
nvidiaBusId = "PCI:01:00:0";
3064
};
3165
};
66+
67+
# Enable Bluetooth with Legion-optimized settings
68+
bluetooth = {
69+
enable = lib.mkDefault true;
70+
powerOnBoot = lib.mkDefault false; # Save battery
71+
settings = {
72+
General = {
73+
ControllerMode = "dual";
74+
FastConnectable = "true";
75+
Experimental = "true"; # Enable LE Audio features
76+
KernelExperimental = "true"; # Enable ISO socket support
77+
};
78+
};
79+
};
3280
};
3381

34-
# Cooling management
82+
# Cooling management for Legion laptops
3583
services.thermald.enable = lib.mkDefault true;
3684

85+
# Audio group permissions
86+
users.groups.audio = { };
87+
3788
# √(2560² + 1600²) px / 16 in ≃ 189 dpi
3889
services.xserver.dpi = 189;
3990
}

0 commit comments

Comments
 (0)