T-Troll / alienfx-tools

Alienware systems lights, fans, and power control tools and apps
MIT License
507 stars 46 forks source link

Tool for linux #434

Open urbanze opened 4 months ago

urbanze commented 4 months ago

This tool works nicelly with Alienware m16 r1 (i9 13900HX + RTX 4060) in W11, but I use Ubuntu (24.04) most of time to to develop and work. Someone can give me any ideia to use this tool in linux?

I really want to control fans speed in linux (most important) and after this, of course, control some RGB LEDs to get more FPS on vscode xD. So, how fans are controled (BIOS, pwm, etc)? How LEDs are controled (bus, protocol, etc)?

T-Troll commented 4 months ago

All you need to port my SDKs (Fan and FX). Now it uses Windows APIs, you need to alter it to Linux one. CLI will work after without any changes. Most of the lights are USB HID devices, so it's simple. Fans more tricky. SDKv2 utilize proprietary Dell WMI functions. Some Linux have WMI mappings as well, but it's Windows native in fact. But SDKv1 uses direct ACPI methods call, so it's easy to port as well. The only issue, ACPI method names different from model to model, so you need to dump you BIOS and check.

t0m5k1 commented 3 months ago

I'm not a coder in any way so how do we go about doing any of this?

T-Troll commented 3 months ago

I'm sorry, bro. Find a coder.

JL2210 commented 2 months ago

I'm interested in doing this. I think the first steps would be to switch build systems to CMake and then port all the USB HID code to a cross-platform library like hidapi.

The WMI calls are tricky. Some stuff is implemented in dell_wmi but it's really barebones. I'd probably have to write a bunch of stuff to get everything working.

The ACPI calls should work. I might have to use the old acpi_call interface until a "proper" driver is written.

For now I've been using Dell-G15-Controller but it's mostly GUI-only

T-Troll commented 2 months ago

Right. However, i recommend to keep SDKs as library, so you can reuse it into different cli/gui.

ACPI have issue - main method name is quite stable (WMAX), but it's position into device tree and device name vary from system to system. Good news - you can use mine rwdec - it's WMI mappings decoder, it can help you to configure out which WMI device (AW**) has main method (AWCCWmiMethodFunction).

JL2210 commented 2 months ago

That's nice, thanks. I've been messing around with bmfdec but it seems to be missing the first 12 WMI methods from AWCC. Hopefully your tool can find them.

T-Troll commented 2 months ago

NB: it's using .rw dump format, from RWEverything. But it can find a lot, f.e. this is mine m16 dump. m16r1.txt

urbanze commented 2 months ago

I use linux but never developed something specific for linux (devices, drivers, etc). But Im embedded developer and have some skills to help this. Of course, I have one M16 R1 (i9 13900HX + 4060) and can help with tests and so on.

T-Troll commented 2 months ago

This port doesn't need to develop any drivers, you just need to be familiar with USB HID (using some lib or directly) and some skill working with Linux ACPI device.

JL2210 commented 2 months ago

I think the best way for me to work on this is to dual-boot both Windows and Linux. Wine and QEMU device pass-through don't work super well with this.

ACPI calls on Linux are somewhat hard to do well. You either need a specific driver to abstract the calls to something more user friendly or you can use acpi_call which creates a file at /proc/acpi/call.

In my experience acpi_call is kind of fiddly and hard to get working well (read: you need to close and re-open the file every time you want to make an ACPI call), so I'll eventually want to put something in the alienware-wmi driver.

urbanze commented 2 months ago

I have some friends that work with advanced embedded linux devices. I will ask about this theme and if can help us. I really want this features to control fan and kayboard rgb on ubuntu. Lets try to do this.

T-Troll commented 2 months ago

Ok, guys, i wish you good luck and feel free to ask me about details. F.e., HID interfaces uses all 3 types of communications - Report, Feature_set, Interrupt. You should support it all.