Skip to content

Commit 4972097

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 4972097

File tree

1 file changed

+50
-2
lines changed

1 file changed

+50
-2
lines changed

lenovo/legion/16irx8h/default.nix

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,68 @@
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 = [ "bluetooth" "btusb" ];
53+
2254
hardware = {
2355
nvidia = {
2456
modesetting.enable = lib.mkDefault true;
2557
powerManagement.enable = lib.mkDefault true;
26-
#
2758
prime = {
2859
intelBusId = "PCI:00:02:0";
2960
nvidiaBusId = "PCI:01:00:0";
3061
};
3162
};
63+
64+
# Enable Bluetooth with Legion-optimized settings
65+
bluetooth = {
66+
enable = lib.mkDefault true;
67+
powerOnBoot = lib.mkDefault false; # Save battery
68+
settings = {
69+
General = {
70+
ControllerMode = "dual";
71+
FastConnectable = "true";
72+
Experimental = "true"; # Enable LE Audio features
73+
KernelExperimental = "true"; # Enable ISO socket support
74+
};
75+
};
76+
};
3277
};
3378

34-
# Cooling management
79+
# Cooling management for Legion laptops
3580
services.thermald.enable = lib.mkDefault true;
81+
82+
# Audio group permissions
83+
users.groups.audio = {};
3684

3785
# √(2560² + 1600²) px / 16 in ≃ 189 dpi
3886
services.xserver.dpi = 189;

0 commit comments

Comments
 (0)