Closed subterfugium closed 3 years ago
Unfortunately, OpenRGB has no idea how many ARGB LEDs are connected to the header (that's why there is a resize option at all), so there will never be any error for you catch. The error you are running into is probably caused by repeatedly calling resize
and set_color
without any delay. This warning from the docs actually applies to any operation that interacts with SDK server. I'll update the docs to reflect that.
Does resizing to 10 LEDs cause the error even when done outside of a loop? If so, does resizing to 10 LEDs cause the error if you do it with the resize button on OpenRGB itself?
Resizing to 10 with delay or from openrgb GUI does not cause this error. It just happened to happen when doing resizing in loop :) So I can forget trying to find correct LED size. Why I was asking this is that it seems that resize() does not seem to change zone.leds list at the first run.
If I turn on openrgb server and do this for every ZoneType.Linear device (ARGB_LEDS = 9, the amount of leds in my fans):
loop:
print('zone %s type %s' % (zone.name, zone.type))
if len(zone.leds) != ARGB_LEDS:
print('resize to %s' % ARGB_LEDS)
zone.resize(ARGB_LEDS)
time.sleep(0.1)
print('led count: %s' % len(zone.leds))
I get prints:
zone D_LED1 Bottom type ZoneType.LINEAR
resize to 9
led count: 10
zone D_LED2 Top type ZoneType.LINEAR
resize to 9
led count: 0
zone D_LED1 Bottom type ZoneType.LINEAR
resize to 9
led count: 0
zone D_LED2 Top type ZoneType.LINEAR
resize to 9
led count: 0
If I do the same with 3 second delay I get same result (run openrgb server and run script). I don't close openrgb between runs, then led count is correct at second run. If I run resize(), when it is expected to zone.leds list be populated?
Here is both runs with prints from my rgb script 3second delay after resize (script generates random colors and sets them to all devices):
subterfugium@pc:~$ rgb
B550 AORUS ELITE
zone D_LED1 Bottom type ZoneType.LINEAR
resize to 9
led count: 10
- Set D_LED1 Bottom ARGB 10 leds to rosybrown greenyellow (gradient=False)
zone D_LED2 Top type ZoneType.LINEAR
resize to 9
led count: 0
- Set D_LED2 Top ARGB 0 leds to rosybrown greenyellow (gradient=False)
zone Motherboard type ZoneType.SINGLE
- Set Back I/O one of ['rosybrown', 'greenyellow'] colors
- Set CPU Header one of ['rosybrown', 'greenyellow'] colors
- Set PCIe one of ['rosybrown', 'greenyellow'] colors
- Set LED C1/C2 one of ['rosybrown', 'greenyellow'] colors
B550 AORUS ELITE
zone D_LED1 Bottom type ZoneType.LINEAR
resize to 9
led count: 0
- Set D_LED1 Bottom ARGB 0 leds to rosybrown greenyellow (gradient=False)
zone D_LED2 Top type ZoneType.LINEAR
resize to 9
led count: 0
- Set D_LED2 Top ARGB 0 leds to rosybrown greenyellow (gradient=False)
zone Motherboard type ZoneType.SINGLE
- Set Back I/O one of ['rosybrown', 'greenyellow'] colors
- Set CPU Header one of ['rosybrown', 'greenyellow'] colors
- Set PCIe one of ['rosybrown', 'greenyellow'] colors
- Set LED C1/C2 one of ['rosybrown', 'greenyellow'] colors
ASUS Aura DRAM
- Set ASUS Aura DRAM RAM 8 leds to rosybrown greenyellow (gradient=False)
ASUS Aura DRAM
- Set ASUS Aura DRAM RAM 8 leds to rosybrown greenyellow (gradient=False)
subterfugium@pc:~$ rgb
B550 AORUS ELITE
zone D_LED1 Bottom type ZoneType.LINEAR
- Set D_LED1 Bottom ARGB 9 leds to magenta yellow (gradient=True)
zone D_LED2 Top type ZoneType.LINEAR
- Set D_LED2 Top ARGB 9 leds to magenta yellow (gradient=True)
zone Motherboard type ZoneType.SINGLE
- Set Back I/O one of ['magenta', 'yellow'] colors
- Set CPU Header one of ['magenta', 'yellow'] colors
- Set PCIe one of ['magenta', 'yellow'] colors
- Set LED C1/C2 one of ['magenta', 'yellow'] colors
B550 AORUS ELITE
zone D_LED1 Bottom type ZoneType.LINEAR
- Set D_LED1 Bottom ARGB 9 leds to magenta yellow (gradient=True)
zone D_LED2 Top type ZoneType.LINEAR
- Set D_LED2 Top ARGB 9 leds to magenta yellow (gradient=True)
zone Motherboard type ZoneType.SINGLE
- Set Back I/O one of ['magenta', 'yellow'] colors
- Set CPU Header one of ['magenta', 'yellow'] colors
- Set PCIe one of ['magenta', 'yellow'] colors
- Set LED C1/C2 one of ['magenta', 'yellow'] colors
ASUS Aura DRAM
- Set ASUS Aura DRAM RAM 8 leds to magenta yellow (gradient=True)
ASUS Aura DRAM
- Set ASUS Aura DRAM RAM 8 leds to magenta yellow (gradient=True)
Ah, I see the problem. When openrgb-python gets the new information from the server (new LEDs), it isn't updating zones stored in separate variables. For you right now, a workaround is to not store zones in separate variables from the device. Like using device.zones[i]
instead of assigning zone = device.zones[i]
and using zone
. I should get a fix for this in the next few days, but I'm not sure when the fix will make it into a pypi release.
Oh okay. I can can pull and do local pip install, just let me know!
Can you test how it works on the latest commit and reopen the issue if there are any problems?
Yes, now leds count is updated after using resize
B550 AORUS ELITE
+ zone D_LED1 Bottom type ZoneType.LINEAR
resize to 9
led count: 9
- Set D_LED1 Bottom ARGB 9 leds to lightsalmon orchid darkred (gradient=False)
+ zone D_LED2 Top type ZoneType.LINEAR
resize to 9
led count: 9
- Set D_LED2 Top ARGB 9 leds to lightsalmon orchid darkred (gradient=False)
+ zone Motherboard type ZoneType.SINGLE
- Set Back I/O one of ['lightsalmon', 'orchid', 'darkred'] colors
- Set CPU Header one of ['lightsalmon', 'orchid', 'darkred'] colors
- Set PCIe one of ['lightsalmon', 'orchid', 'darkred'] colors
- Set LED C1/C2 one of ['lightsalmon', 'orchid', 'darkred'] colors
B550 AORUS ELITE
+ zone D_LED1 Bottom type ZoneType.LINEAR
resize to 9
led count: 9
- Set D_LED1 Bottom ARGB 9 leds to lightsalmon orchid darkred (gradient=False)
+ zone D_LED2 Top type ZoneType.LINEAR
resize to 9
led count: 9
- Set D_LED2 Top ARGB 9 leds to lightsalmon orchid darkred (gradient=False)
+ zone Motherboard type ZoneType.SINGLE
- Set Back I/O one of ['lightsalmon', 'orchid', 'darkred'] colors
- Set CPU Header one of ['lightsalmon', 'orchid', 'darkred'] colors
- Set PCIe one of ['lightsalmon', 'orchid', 'darkred'] colors
- Set LED C1/C2 one of ['lightsalmon', 'orchid', 'darkred'] colors
ASUS Aura DRAM
- Set ASUS Aura DRAM RAM 8 leds to lightsalmon orchid darkred (gradient=False)
ASUS Aura DRAM
- Set ASUS Aura DRAM RAM 8 leds to lightsalmon orchid darkred (gradient=False)
I run script second time then resize is not needed as leds count is already there. Perfect.
Just for some reason it's skipping 2nd ARGB header on my mobo. Probably something to to do with openrgb itself as it detects my mobo twice. Need to investigate more.
2: B550 AORUS ELITE
Type: Motherboard
Description: IT5702-GIGABYTE V2.0.8.0
Version: 0x00080002
Location: HID: /dev/hidraw1
Serial: 0x57020100
Modes: [Direct] Static Breathing Blinking 'Color Cycle' Flashing
Zones: 'D_LED1 Bottom' 'D_LED2 Top' Motherboard
LEDs: 'D_LED1 Bottom LED 0' 'D_LED1 Bottom LED 1' 'D_LED1 Bottom LED 2' 'D_LED1 Bottom LED 3' 'D_LED1 Bottom LED 4' 'D_LED1 Bottom LED 5' 'D_LED1 Bottom LED 6' 'D_LED1 Bottom LED 7' 'D_LED1 Bottom LED 8' 'D_LED1 Bottom LED 9' 'Back I/O' 'CPU Header' PCIe 'LED C1/C2'
3: B550 AORUS ELITE
Type: Motherboard
Description: IT5702-GIGABYTE V2.0.8.0
Version: 0x00080002
Location: HID: /dev/hidraw1
Serial: 0x57020100
Modes: [Direct] Static Breathing Blinking 'Color Cycle' Flashing
Zones: 'D_LED1 Bottom' 'D_LED2 Top' Motherboard
LEDs: 'Back I/O' 'CPU Header' PCIe 'LED C1/C2'
I'm trying to do something like this:
And
I was hoping that when resize is more than actual amount of leds in fan/led strip there would be exception that I could catch. At the moment python-openrgb seems to get stuck waiting for openrgb when I resize to 10 (avaialble leds is 9). All leds go black (I take this indication that led controller detected bad configuration) and:
And openrgb outputs not and if you try to stop it then:
Is this possible or is there just bug in python-openrgb (Version: 0.2.3) or openrgb (0.5)?
EDIT: upgraded python-openrgb to 0.2.5 but behaviour seems to be same.