T-Troll / alienfx-tools

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

Add support for Area 51 R4 #444

Open grghub opened 2 weeks ago

grghub commented 2 weeks ago

I have an Alienware Area 51 R4, which is listed as "Unknown" Tron in the "Supported and tested devices list", and hope I can provide enough info here to allow it to be known and supported.

In alienfx-gui the "Detect devices" button didn't find anything, but alienfx-cli probe=a did actually find all the lights (although I don't have it fully working, see below) -- so I'll start here with what that found in case that's an easy source of accurate info.

C:\Program Files\AlienFX Tools>alienfx-cli.exe status
alienfx-cli v8.6.1.1
Dell API not found, 1 devices found.
Device #0 - Alienware Area 51  R4, VID#6268, PID#1318, APIv2, 9 lights
  Light ID#0 - right panel, top
  Light ID#1 - right panel, forward
  Light ID#10 - alien head power button (Power button)
  Light ID#11 - front panel, left
  Light ID#12 - front panel, right
  Light ID#2 - right panel, rear
  Light ID#5 - left panel, top
  Light ID#6 - left panel, rear
  Light ID#7 - left panel, forward
1 groups:
  Group #0 (9 lights) - all lights
Done.

An alienfx-config.cmd backup produces the following afx-lights.reg file (renamed to make github allow the upload): afx-lights-dotreg.txt And alienfx-gui's "Save Lights and Grids" produces Current.csv

With that configuration, alienfx-cli.exe setall=255,0,0 does turn all case lights except the power button red, and alienfx-cli.exe setone=0,10,0,255,0 turns the power button green.

However, I couldn't get the setpower command to work; variations of alienfx-cli.exe lowlevel setpower=0,10,255,0,0,0,0,255 all seemed to hang for a minute or so and then exit without doing anything.

Furthermore, I tried to make alienfx-gui do interesting things with this setup and started by trying to enter a "Grid Effect" with one zone of all 9 lights, Trigger=Continuous, and when nothing happened I added a few Colors and tried various checkboxes on that screen, but then alienfx-gui started crashing. Upon restart it would hang for a minute, work for a few seconds, then hang for another minute and crash. Across several restarts during those few working seconds I manage to remove all the colors and uncheck all the checkboxes, and once I got that done and Saved it stopped crashing (but of course does nothing, given no instructions). Maybe this is just my ignorance and I'm doing the wrong thing? I admit that I have no idea how to tell that gui to do something interesting.

Following the "How to collect data for the new light device" instructions -- from the info above I think the relevant device is HID\VID_187C&PID_0526 (which is also listed in https://github.com/trackmastersteve/alienfx/blob/master/alienfx/data/etc/udev/rules.d/10-alienfx.rules as the device for the Area 51 R2 (the R4 is not listed there, but it looks like maybe it's the same as the R2?); here are the all the Hardware IDs listed for that device in Device Manager:

HID\VID_187C&PID_0526&REV_0000
HID\VID_187C&PID_0526
HID\VID_187C&UP:FF00_U:0001
HID_DEVICE_UP:FF00_U:0001
HID_DEVICE_UPR:FF00-FFFF
HID_DEVICE

I think that's what you're looking for, but for completeness I'll mention that there's a standalone top-level "Alienware Alienware Area-51 R4" device with hardware IDs:

COMPUTER\{CBEE6E87-CA56-5645-A998-11643185BCD0}
COMPUTER\{140FCCD7-1041-548C-9222-7E22B756E90B}
COMPUTER\{6C0351A2-983A-58AA-A36D-153489C028C9}
COMPUTER\{ABACDA57-53F5-506D-B968-E4A9CD1ABDDE}
COMPUTER\{32F32D84-A1D0-5D3A-A2ED-B8E9ABD2077A}
COMPUTER\{F74D7841-CAA7-5276-87F1-4C59683694E4}
COMPUTER\{BE2EC741-44E6-5A68-BAE3-E99F5739831D}
COMPUTER\{C2AF4C2E-274F-5D8E-A913-0F874C798E90}
COMPUTER\{37AECE23-4ECF-5136-ADD2-0E021EE4E690}
COMPUTER\{73735569-B868-5294-B874-2E0D995F1F02}
COMPUTER\{57C07333-E98C-5D18-BDC1-C1B8F6E7491F}
COMPUTER\{1DB2BEFB-DC91-5482-8BF7-3F65C31BB628}
and "Bus Type GUID" property = {06d10322-7de0-4cef-8e25-197d0e7442e2}

and also a second "HID-Compliant Vendor-Defined Device" with hardware IDs:

HID\VID_0B0E&PID_0412&REV_0109&MI_03&Col02
HID\VID_0B0E&PID_0412&MI_03&Col02
HID\VID_0B0E&UP:FF00_U:0001
HID_DEVICE_UP:FF00_U:0001
HID_DEVICE_UPR:FF00-FFFF
HID_DEVICE

I don't have AWCC running, but here is a USBPcap of making light#0 (right panel, top light) green (0,255,0): caselightgreen-pcap.log

The instructions ask for dimming and other effects, but since I don't have AWCC or alienfx-gui running, the only way I could think of to get any kind of effect recorded was to capture while sleeping & waking the machine (sleep = turns off all case lights, makes alien head power button fade off & on orange; and wake = turns on all case lights to aqua color, makes alien head power button green), with the caveat that I don't know which of those light actions were actually captured in the pcap vs which were done when the capture process was asleep (but the file looks like the right size to have captured something?): sleep-pcap.log

A personal request: it seems that after running the alienfx-cli commands above, when I now start the machine after a shutdown, the 3 lights on the right panel do not come on, whereas they always had until today (but the other 6 case lights do come on). Is that expected? Is there something I can do to fix that?

Hope the above contains the info you're looking for, but of course I'd be happy to provide any other information I can find, run more captures, or other tests as needed. (And as an aside, if I'm doing something wrong in alienfx-gui, I'd appreciate knowing what to tell it to get it to do something interesting.) Thank you!

T-Troll commented 2 weeks ago

Well... Impressive job, thank you! I'll add your mappings into autodetect next release.

Now about issues.... For APIv1,v2,v4 light system can spend a lot of time then you try to set power button. But app should not hang, i use separated thread for it. BTW, making light as a HARDWARE power button enable automation - so charging/sleeping/battery will be automatic as you set it.

So if app hangs, issue is out of it, thanks for pointing this, i'll take a look.

The bad news is my last APIv2 device was broken beyond repair 2 years ago, so i can't check what wrong with power button code directly.... I only can guess (it works before, but i can break it).

and when nothing happened

Grid effects REQUIRE lights located on grid. I check about crash, most probably it's in case some of them misplaced. You are share me enough information for this. Also, please share me afx-gui.reg to understand you effect settings.

grghub commented 2 weeks ago

Here's afx-gui.reg as it stands now, which is after all the colors were removed & checkboxes cleared so it doesn't crash (filename-mangled for github): afx-gui-dotreg.txt -- I think it should show that I have one zone with all 9 lights, but absolutely nothing else set... (although looking at the file I don't see info on the zone? curious..)

Current.csv above does I think show that I have the power button marked as a hardware power button, FWIW.

Does "grid" mean only keyboard lights? (which I don't have) Sorry, I'm new to alienfx-tools and still figuring it out...

I think I should clarify that I do have the latest AWCC installed, but it doesn't seem to support this hardware (while the hardware clearly works, since alienfx-tools successfully controls all 9 lights) - could that be interfering? Should I uninstall AWCC or otherwise disable it somehow?

Thank you!

T-Troll commented 2 weeks ago

Here's afx-gui.reg as it stands now, which is after all the colors were removed & checkboxes cleared so it doesn't crash (filename-mangled for github): afx-gui-dotreg.txt -- I think it should show that I have one zone with all 9 lights, but absolutely nothing else set... (although looking at the file I don't see info on the zone? curious..)

Oh.... I need one then it crashes/hangs... And yes, zones into lights.reg Please REMOVE power button from "all lights" zone and set it separately, then needed (as i told you, it's a great slowdown).

Does "grid" mean only keyboard lights? (which I don't have) Sorry, I'm new to alienfx-tools and still figuring it out...

No. Grid means ANY light position at desktop/notebook surface. GRID effects only available if light position defined on grid. You can make grid for any side of notebook, or (additionally) grid aggregating all lights. NB: Light can be placed to more, than one grid.

I think I should clarify that I do have the latest AWCC installed

No, it doesn't matter. You can have issues with supported lights, mostly, and fan control.

BTW.... Fan control. As i can see, you have it enabled. Did it work for your gear? Should not, this control standard come later, then any v2 device... THIS can be the source of issues.

PS: Sorry, i can't answer such faster later on - i'm quite busy for my main duty AND preparing tools-v9 version.

grghub commented 2 weeks ago

Oh.... I need one then it crashes/hangs...

OK, I experimented some to figure out the crash/hang of alienfx-gui (recall from above that alienfx-cli setpower also hangs, but that's not covered here). alienfx-gui will get into its crashing mode if it's configured with all of these three things:

  1. Trigger = Continues (on Grid Effect tab)
  2. colors in the Color List (on Grid Effect tab)
  3. a zone defined with lights which includes the power button (yes, I know you said to take it out; here I'm just debugging the hang, and your response about it is what called my attention to this)

If those three things are configured (here they are in an afx-gui.reg: afx-gui-all9-crashes-dotreg.txt), if I start alienfx-gui and just leave it, it crashes about 55 seconds later. It does seem to be operable during that time, without hanging. The hang happens if I click on the "Devices and Grids" tab - if I do, it hangs for about 40 seconds before filling out the display for that tab. (And if it hits the 55-second mark before those 40 seconds are up, it crashes in the middle of hanging.)

If I take any of those 3 away (delete the colors, or make Trigger=off, or take the power button out of the zone leaving the remaining 8 lights) then alienfx-gui doesn't crash. (And taking the power button out of the zone, it "only" takes about 20 seconds of hanging before displaying the "Devices and Grids" tab.)

BTW.... Fan control. As i can see, you have it enabled. Did it work for your gear?

I didn't enable fan control -- maybe it's enabled by default? I haven't done anything with the fans. Reading the docs, it looks like the way to disable fan control is to change "Power mode" to anything other than "Manual"? But the only option alienfx-gui gives me for Power mode is Manual, I can't change it to anything else.

Finally, I still have the issue which started after running the above alienfx-cli commands, which is that when I power the machine on (without running alienfx-tools), the 3 lights on the right panel do not come on, whereas they always had before (but again, the other 6 case lights do come on). Any idea what I need to do to get it back to turning on all the lights at boot? Thanks!

T-Troll commented 2 weeks ago

About crashes - seems like i found the reason, will fix into new release.

About hangs... The source is understandable. Issue is you chip report non-ready state, so setting each light wait for ready until timeout (about 4 sec per light). Devices&Grids do not use separate thread for fading lights, so... yes, about 35 sec hang. Seems like i make a mess with a status check then modify SDK... But i doesn't have v2 now for check and fix... Ok, let me think.

About fan - just turn it off in Settings. Seems like your BIOS have functions needed for it (so support detected), but they are not implemented.

CLI does not save colors, it can just change it until reboot. Use GUI "Save" button to store current light set.

grghub commented 2 weeks ago

I have some color cycling mostly running now! afx-lights-dotreg.txt, afx-gui-dotreg.txt

But one apparent issue here -- with it running from the "Colors" tab (several colors, morphing), on its first run-through when it switches to 2nd & 3rd colors in the list, light #7 blinks off and then on; and then on 4th color in the list it just goes off & stays off until the cycle is restarted (e.g. by changing something in the config). (Is this somehow related to not having full support for this device yet, or should I be filing this as a separate issue? I don't want to abuse and muddle up this one issue...)

Please REMOVE power button from "all lights" zone and set it separately, then needed (as i told you, it's a great slowdown).

I'm not sure if this is what you were saying, but if I have the power button in any zone, even if that zone isn't on the grid, alienfx-gui crashes. (Is this related to the crash you already found (thanks!!), or a different one?)

CLI does not save colors, it can just change it until reboot. Use GUI "Save" button to store current light set.

Using the GUI Save button does not seem to affect what happens on cold boot, so I still now have a dark right panel at power-on. It seems like that would have to be a BIOS/CMOS setting? The lights come on as soon as the power comes on, seemingly before even a POST. and somehow that's now been changed, with 3 of the lights (all on the right panel) not lighting by default any more (the rest of the lights come on as they always have). Anything else I can try to get that restored?

EDIT: Oh, wow, after playing around with alienfx-gui some more I'm in a state now where ONLY light#7 comes on at cold boot, with one of the colors I was using in the GUI, the rest are all dark. Clearly something I'm doing is affecting this -- what? How do I fix it back?

About fan - just turn it off in Settings.

Done, thanks for the tip. FWIW, when it was on it seemed to be displaying actual data for 3 fan speeds and 9 temperatures. but it didn't show any fan speed curves and I didn't try controlling the fan speeds.

Thank you!

T-Troll commented 1 week ago

Is this somehow related to not having full support for this device yet, or should I be filing this as a separate issue?

it's just because your device only support 2-color effects. My app trying to extend it, but reaction can be... strange.

I'm not sure if this is what you were saying, but if I have the power button in any zone, even if that zone isn't on the grid, alienfx-gui crashes. (Is this related to the crash you already found (thanks!!), or a different one?)

Wait a moment. We don't talk about grid, but set. What if PB is in a separate zone, but not set to anything? What if set TWO colors?

The lights come on as soon as the power comes on, seemingly before even a POST. and somehow that's now been changed, with 3 of the lights (all on the right panel) not lighting by default any more (the rest of the lights come on as they always have). Anything else I can try to get that restored?

Your device have a special commands to save light colors for system start. Seems like this lights not saved correctly. This can be related to 4-color set attempt.

Done, thanks for the tip. FWIW, when it was on it seemed to be displaying actual data for 3 fan speeds and 9 temperatures. but it didn't show any fan speed curves and I didn't try controlling the fan speeds.

You can play with it if you wish, try to define some curves and see what happened. I just not sure if it will work for your system (but should not break anything).

Also, be careful with "Tempo" (Speed) slider, it provides a slowdown at every color set sometimes.

grghub commented 1 week ago

I see the release note for v9.0.0.0 says it has Area-51 R4 profile detection in the gui! Thank you for the speedy support! Weirdly, the first few times I tried the "Detect devices" button on the v9.0.0.0 gui (after clicking on "Clear device" to get a cleaner slate) it didn't seem to detect anything, but after playing around a bunch more (including the below alienfx-cli probe=a? and a bunch of reboots) now it does detect the Area-51 R4 and load the light list!

Wait a moment. We don't talk about grid, but set. What if PB is in a separate zone, but not set to anything? What if set TWO colors?

I experimented more with this, here's what I found:

it's just because your device only support 2-color effects.

Oh! I guess I shouldn't be trying more than 2 colors per zone and expecting it to work on cold boot then? I had no idea.

(Did I miss that in the docs? I saw in the doc page Breath, Spectrum, and Rainbow all said they needed APIv4, which is why I was using Morph. And I did see that it says Morph has a minimum of 2 lights. But at the bottom of the alienfx-cli help output under all of the actions including Morph it says "Up to 9 colors can be entered", so I was trying even up to 8! And 8 "mostly" worked in the gui (except light #⁠7 blinking and then staying dark), but not on power-up. Maybe a warning message in the gui would be helpful?)

alienfx-cli

Even with only 2 colors for "all but PB" zone and no colors for PB zone, alienfx-cli seems to be having some problems now; last week alienfx-cli setone and alienfx-cli setall always worked, but today they almost always fail to do anything when run... I've seen alienfx-cli setall work only once in the middle of a long series of attempts, and I haven't seen alienfx-cli setone work even once today. I ran through an alienfx-cli probe=a again - which does turn all lights off and then each one on at a time, so alienfx-cli does still seem to have some light control (and I hoped that running through the probe might reset something to a working state? but setone and setall still weren't working even after the probe).

At first I was worried it might be a regression added in v9.0.0.0, but then I noticed the alienfx-cli output reports it's v8.6.1.1 (as it did when I had the v8.6.1.3 msi installed), which in itself seems odd...

T-Troll commented 18 hours ago

I'm sorry for later reply - i just have my main duty calls me sometimes. So...

What i need to mention - Power button control for V2 thrashed into latest releases. Also, i need to mention i doesn't have APIv2 device for check and fix.

So let's go the other way. Try to install older v8.x.x.x versions and check power button set (you can use CLI). In case we can pinpoint what version broke the stuff - i can fix it back.