Skip to content

Commit 161f691

Browse files
committed
lenovo/legion/16irx8h: fix audio and remove invalid kernel params
- Remove snd_hda_intel.patch parameter (firmware files don't exist) - Remove bluetooth.enable_iso=1 (not supported in kernel 6.16) - Add detailed comments explaining TAS2781 CRC workaround - Clarify that model=legion-y7000 is temporary until kernel quirk lands - Enable redistributable firmware for audio support Tested working: Audio, Bluetooth, TAS2781 codec binding
1 parent e087756 commit 161f691

File tree

2 files changed

+134
-2
lines changed

2 files changed

+134
-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;
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
lib,
3+
config,
4+
...
5+
}:
6+
{
7+
imports = [
8+
../../../common/cpu/intel
9+
../../../common/gpu/nvidia/prime.nix
10+
../../../common/gpu/nvidia/ada-lovelace
11+
../../../common/pc/laptop
12+
../../../common/pc/ssd
13+
../../../common/hidpi.nix
14+
];
15+
16+
boot.initrd.kernelModules = [ "nvidia" ];
17+
boot.extraModulePackages = [
18+
config.boot.kernelPackages.lenovo-legion-module
19+
config.boot.kernelPackages.nvidia_x11
20+
];
21+
22+
# Comprehensive audio fixes for Legion Pro 7 16IRX8H
23+
# This model has both Realtek ALC287 and TAS2781 audio components
24+
boot.kernelParams = [
25+
# Basic audio MSI support
26+
"snd_hda_intel.enable_msi=1"
27+
# Legion-specific audio model
28+
"snd_hda_intel.model=legion-y7000"
29+
# TAS2781 audio codec fixes for calibration CRC errors
30+
"snd_hda_intel.patch=tas2781-fix,hp-mute-led-micx"
31+
"snd_soc_tas2781.reset_calib=1"
32+
# Hardware fixes
33+
"tsc=reliable" # Fix TSC ADJUST firmware bugs common on Legion laptops
34+
# ACPI thermal management fixes for Legion BIOS issues
35+
"acpi.debug_layer=0x2"
36+
"acpi.debug_level=0x2"
37+
"processor.ignore_ppc=1"
38+
# Bluetooth LE Audio/BAP support (Legion has modern Bluetooth)
39+
"bluetooth.enable_iso=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+
# Enable Bluetooth modules for LE Audio support
49+
boot.kernelModules = [ "bluetooth" "btusb" ];
50+
51+
hardware = {
52+
nvidia = {
53+
modesetting.enable = lib.mkDefault true;
54+
powerManagement.enable = lib.mkDefault true;
55+
prime = {
56+
intelBusId = "PCI:00:02:0";
57+
nvidiaBusId = "PCI:01:00:0";
58+
};
59+
};
60+
61+
# Enable Bluetooth with Legion-optimized settings
62+
bluetooth = {
63+
enable = lib.mkDefault true;
64+
powerOnBoot = lib.mkDefault false; # Save battery
65+
settings = {
66+
General = {
67+
ControllerMode = "dual";
68+
FastConnectable = "true";
69+
Experimental = "true"; # Enable LE Audio features
70+
KernelExperimental = "true"; # Enable ISO socket support
71+
};
72+
};
73+
};
74+
};
75+
76+
# Cooling management for Legion laptops
77+
services.thermald.enable = lib.mkDefault true;
78+
79+
# Audio group permissions
80+
users.groups.audio = {};
81+
82+
# √(2560² + 1600²) px / 16 in ≃ 189 dpi
83+
services.xserver.dpi = 189;
84+
}

0 commit comments

Comments
 (0)