Skip to content

fix(daemon): use linuwu_sense module name in rmmod/modprobe + Predator log strings#193

Open
GbrFrn wants to merge 1 commit into
PXDiv:mainfrom
GbrFrn:fix/module-name-and-detection
Open

fix(daemon): use linuwu_sense module name in rmmod/modprobe + Predator log strings#193
GbrFrn wants to merge 1 commit into
PXDiv:mainfrom
GbrFrn:fix/module-name-and-detection

Conversation

@GbrFrn
Copy link
Copy Markdown

@GbrFrn GbrFrn commented May 16, 2026

Summary

Two bugs in DAMM-Daemon/DAMX-Daemon.py (daemon v0.4.6) that together strand the daemon in UNKNOWN mode when the first detection attempt fails for any reason.

1. Wrong module name in rmmod/modprobe calls

Every subprocess.run invocation that touches the kernel module uses 'linuwu-sense' (hyphen) instead of 'linuwu_sense' (underscore). The actual module name is the underscore form (lsmod and /sys/module/linuwu_sense confirm). Affected functions:

  • _restart_drivers_and_daemon (lines 327, 334)
  • _force_model_nitro (154, 161)
  • _force_model_predator (184, 191)
  • _force_enable_all (213, 220)

rmmod linuwu-sense returns non-zero, subprocess.run(..., check=True) raises, the except branch fires, the restart helper returns False. In the __init__ retry loop this looks like:

ERROR - Unexpected error during restart (attempt 4): Command '['sudo', 'rmmod', 'linuwu-sense']' returned non-zero exit status 1.
ERROR - Failed to restart drivers (attempt 4), continuing with limited functionality
INFO  - Detected laptop type: UNKNOWN
INFO  - Base path:
INFO  - Available features:

The daemon then settles into "limited functionality" mode for the lifetime of the process even when /sys/module/linuwu_sense is fine, and the GUI's "Force Predator/Nitro/Enable-all" buttons silently fail to actually reload the driver.

/etc/modprobe.d/linuwu-sense.conf (the conf file, not a kernel module argument) deliberately keeps the hyphen — modprobe normalizes -_ in module names, so that file still applies. The fix only touches the actual module-name args passed to rmmod / modprobe.

2. _force_model_predator copy-paste artifacts

The docstring, the entry log, and the exception log in _force_model_predator all reference "Nitro" where they should say "Predator" — pure copy-paste from _force_model_nitro. The actual modprobe ... predator_v4 call was already correct; only the logging was misleading.

Test plan

  • Verified all 8 rmmod/modprobe call sites use linuwu_sense after patch (AST scan)
  • Daemon now boots to Detected laptop type: PREDATOR on an Acer Predator Triton 300 SE PT316-51s (companion PR upstreams the matching DMI quirk to Div-Linuwu-Sense)
  • All 8 features detected: backlight_timeout, battery_calibration, battery_limiter, boot_animation_sound, fan_speed, lcd_override, thermal_profile, usb_charging

…rings

- rmmod/modprobe in restart/force paths used 'linuwu-sense' (hyphen);
  actual kernel module is 'linuwu_sense' (underscore), so every restart
  attempt failed with non-zero exit, stranding the daemon in UNKNOWN
  even when the module was loaded and sysfs was populated.
- _force_model_predator() docstring/log strings were copy-pasted from
  _force_model_nitro() — they said 'Nitro' where they should say 'Predator'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant