Skip to content

Commit ed56a01

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 ed56a01

File tree

1 file changed

+59
-2
lines changed

1 file changed

+59
-2
lines changed

lenovo/legion/16irx8h/default.nix

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,78 @@
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=lenovo-legion-7i"
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+
# More aggressive TAS2781 fixes for Legion
35+
"snd_soc_tas2781.tas2781_dev_id=0x6a"
36+
"snd_hda_intel.single_cmd=1"
37+
# Hardware fixes
38+
"tsc=reliable" # Fix TSC ADJUST firmware bugs common on Legion laptops
39+
# ACPI thermal management fixes for Legion BIOS issues
40+
"acpi.debug_layer=0x2"
41+
"acpi.debug_level=0x2"
42+
"processor.ignore_ppc=1"
43+
];
44+
45+
# Additional audio configuration for Legion Pro 7
46+
boot.extraModprobeConfig = ''
47+
# Force specific Legion audio model for proper speaker routing
48+
options snd-hda-intel model=lenovo-legion-7i single_cmd=1 probe_mask=1
49+
# TAS2781 specific options
50+
options snd-soc-tas2781-comlib reset_calib=1
51+
options snd-hda-scodec-tas2781-i2c reset_calib=1
52+
'';
53+
54+
# Hardware firmware support for Legion audio
55+
hardware.enableRedistributableFirmware = lib.mkDefault true;
56+
57+
# Enable Bluetooth modules
58+
boot.kernelModules = [
59+
"bluetooth"
60+
"btusb"
61+
];
62+
2263
hardware = {
2364
nvidia = {
2465
modesetting.enable = lib.mkDefault true;
2566
powerManagement.enable = lib.mkDefault true;
26-
#
2767
prime = {
2868
intelBusId = "PCI:00:02:0";
2969
nvidiaBusId = "PCI:01:00:0";
3070
};
3171
};
72+
73+
# Enable Bluetooth with Legion-optimized settings
74+
bluetooth = {
75+
enable = lib.mkDefault true;
76+
powerOnBoot = lib.mkDefault false; # Save battery
77+
settings = {
78+
General = {
79+
ControllerMode = "dual";
80+
FastConnectable = "true";
81+
Experimental = "true"; # Enable LE Audio features
82+
KernelExperimental = "true"; # Enable ISO socket support
83+
};
84+
};
85+
};
3286
};
3387

34-
# Cooling management
88+
# Cooling management for Legion laptops
3589
services.thermald.enable = lib.mkDefault true;
3690

91+
# Audio group permissions
92+
users.groups.audio = { };
93+
3794
# √(2560² + 1600²) px / 16 in ≃ 189 dpi
3895
services.xserver.dpi = 189;
3996
}

0 commit comments

Comments
 (0)