openrazer icon indicating copy to clipboard operation
openrazer copied to clipboard

Static color not restored after suspend for Cynosa v2

Open ZwS opened this issue 4 years ago • 8 comments

Distribution

Ubuntu 21.04, OpenRazer 3.1.0, Polychromatic 0.7.0

Support

  • [x] Have you tried rebooting?
  • [x] Have you looked at the Troubleshooting page?

I've setup Cynosa V2 lighting to static color, but every time I waking my computer lighting become disabled. There no issue If I change lighting mode to Reactive, Breath or Wave.

Here snippet from daemon logs:

2021-08-17 01:05:27 | razer.device0.keymanager       | ERROR    | Got key error. Couldn't convert event to key name
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/openrazer_daemon/misc/key_event_management.py", line 381, in key_action
    key_name = self.EVENT_MAP[key_id]
KeyError: 142
2021-08-17 01:05:27 | razer.device0.keymanager       | ERROR    | Got key error. Couldn't convert event to key name
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/openrazer_daemon/misc/key_event_management.py", line 381, in key_action
    key_name = self.EVENT_MAP[key_id]
KeyError: 142
2021-08-17 01:05:31 | razer.device0                  | INFO     | Suspending RazerCynosaV2
2021-08-17 01:05:31 | razer.device1                  | INFO     | Suspending RazerBasiliskV2
2021-08-17 19:36:18 | razer.device0                  | INFO     | Resuming RazerCynosaV2
2021-08-17 19:36:18 | razer.device1                  | INFO     | Resuming RazerBasiliskV2

ZwS avatar Aug 17 '21 17:08 ZwS

This sounds like similar firmware behaviour to a Chroma HDK I have. If the device is powered on while at zero brightness on a static effect, it's like the effect reset itself to "None". So, even changing the brightness (like the daemon does in this case) remains in darkness until an effect is selected again.

By default, the lighting is set to 0 brightness when the screensavers are active. This can be turned off in ~/.config/openrazer/razer.conf if desired, or as you're using Polychromatic: Tools → OpenRazer → Configure.

lah7 avatar Aug 18 '21 09:08 lah7

By default, the lighting is set to 0 brightness when the screensavers are active. This can be turned off in ~/.config/openrazer/razer.conf if desired, or as you're using Polychromatic: Tools → OpenRazer → Configure

Thank you, worked for me.

I'm not sure if this issue should be closed since this seems more like a workaround.

ZwS avatar Aug 19 '21 09:08 ZwS

Same behavior for my Cynosa Chroma on fresh installed Manjaro, OpenRazer 3.1.0, Polychromatic 0.7.2, manjaro 5.14 kernel: lighting off after waking up from suspend. Worked fine before on the same hardware but with Ubuntu 20.04, liquorix 5.14 kernel and OpenRazer drivers from stable branch ppa.

th3bucch avatar Nov 04 '21 21:11 th3bucch

Same issue on my system as well. Device: Razer Cynosa V2 (K)Ubuntu 23.04 Kernel: 6.2.0-36-generic OpenRazer 3.7.0 Desktop Environment: KDE Plasma 5.27.4

I'm using static red background lights. When only just the screensaver/lockscreen activates it works correctly (turns off the background lights) and unlocking the scrren BEFORE the screen turns off the background lights comes back as it was before. But if the screen was turned off too, the keyboard also disconnects and after reconnecting the background lights remains off.

Here is a verbose daemon log. At 22:24:40 I locked the screen. After ~5 minutes at 22:30:59 the screen also turned off. At 22:31:01 I pressed a button on the keyboard to wake up the system and unlocked the screen.

If @lah7 is right and when the brightness is set to 0 on the static effect the effect resets back to none in the firmware, the during reconnect or resume the static effect shuld be set again.

2023-11-02 22:24:40 | razer.screensaver              | DEBUG    | Received screensaver active signal
2023-11-02 22:24:40 | razer.device0                  | INFO     | Suspending RazerCynosaV2
2023-11-02 22:24:40 | razer.device0                  | DEBUG    | DBus call set_brightness
2023-11-02 22:30:59 | razer                          | DEBUG    | Device event [unbind]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.1/3-6.4.1:1.0/0003:1532:025E.0002
2023-11-02 22:30:59 | razer                          | DEBUG    | Device event [remove]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.1/3-6.4.1:1.0/0003:1532:025E.0002
2023-11-02 22:30:59 | razer                          | DEBUG    | Device event [unbind]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.1/3-6.4.1:1.1/0003:1532:025E.0003
2023-11-02 22:30:59 | razer                          | DEBUG    | Device event [remove]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.1/3-6.4.1:1.1/0003:1532:025E.0003
2023-11-02 22:30:59 | razer                          | DEBUG    | Device event [unbind]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.1/3-6.4.1:1.2/0003:1532:025E.0004
2023-11-02 22:30:59 | razer                          | DEBUG    | Device event [remove]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.1/3-6.4.1:1.2/0003:1532:025E.0004
2023-11-02 22:30:59 | razer.device0.keymanager       | DEBUG    | Stopping key manager
2023-11-02 22:30:59 | razer.device0.ripplemanager    | DEBUG    | Closing Ripple Manager
2023-11-02 22:30:59 | razer                          | DEBUG    | Writing persistence config
2023-11-02 22:30:59 | razer                          | WARNING  | Removing 0003:1532:025E.0004
2023-11-02 22:30:59 | razer                          | DEBUG    | Emitted Device Remove Signal
2023-11-02 22:30:59 | razer                          | DEBUG    | Device event [unbind]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.2/3-6.4.2:1.0/0003:046D:C246.0005
2023-11-02 22:30:59 | razer                          | DEBUG    | Device event [remove]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.2/3-6.4.2:1.0/0003:046D:C246.0005
2023-11-02 22:30:59 | razer                          | DEBUG    | Device event [unbind]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.2/3-6.4.2:1.1/0003:046D:C246.0006
2023-11-02 22:30:59 | razer                          | DEBUG    | Device event [remove]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.2/3-6.4.2:1.1/0003:046D:C246.0006
2023-11-02 22:31:01 | razer                          | DEBUG    | Device event [add]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.2/3-6.4.2:1.0/0003:046D:C246.000A
2023-11-02 22:31:01 | razer                          | DEBUG    | Device event [add]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.2/3-6.4.2:1.1/0003:046D:C246.000B
2023-11-02 22:31:01 | razer                          | DEBUG    | Device event [add]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.1/3-6.4.1:1.0/0003:1532:025E.0007
2023-11-02 22:31:01 | razer                          | DEBUG    | Device event [add]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.1/3-6.4.1:1.1/0003:1532:025E.0008
2023-11-02 22:31:01 | razer                          | DEBUG    | Device event [add]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.1/3-6.4.1:1.2/0003:1532:025E.0009
2023-11-02 22:31:01 | razer                          | DEBUG    | Device event [bind]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.2/3-6.4.2:1.1/0003:046D:C246.000B
2023-11-02 22:31:01 | razer                          | DEBUG    | Device event [bind]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.2/3-6.4.2:1.0/0003:046D:C246.000A
2023-11-02 22:31:01 | razer                          | DEBUG    | Device event [bind]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.1/3-6.4.1:1.1/0003:1532:025E.0008
2023-11-02 22:31:01 | razer                          | DEBUG    | Device event [bind]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.1/3-6.4.1:1.0/0003:1532:025E.0007
2023-11-02 22:31:01 | razer                          | DEBUG    | Device event [bind]: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-6/3-6.4/3-6.4.1/3-6.4.1:1.2/0003:1532:025E.0009
2023-11-02 22:31:03 | razer                          | INFO     | Found valid device.0: 0003:1532:025E.0009
2023-11-02 22:31:03 | razer.device0                  | INFO     | Initialising device.0 RazerCynosaV2
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.misc.getDriverVersion method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.misc.getRazerUrls method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.misc.getDeviceMode method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.misc.getDeviceImage method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.misc.hasDedicatedMacroKeys method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.misc.getSerial method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.misc.setDeviceMode method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.restoreLastEffect method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.misc.getVidPid method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.misc.resumeDevice method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.misc.suspendDevice method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.getEffectSpeed method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.getEffect method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.getEffectColors method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.getWaveDir method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.misc.getFirmware method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.misc.getMatrixDimensions method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.misc.hasMatrix method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.misc.getDeviceName method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.misc.getKeyboardLayout method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.brightness.getBrightness method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.brightness.setBrightness method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.misc.getDeviceType method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.setWave method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.setStatic method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.setSpectrum method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.setReactive method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.setNone method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.setBreathRandom method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.setBreathSingle method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.setBreathDual method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.setCustom method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.setKeyRow method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.led.gamemode.getGameMode method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.led.gamemode.setGameMode method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.led.macromode.getMacroMode method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.led.macromode.setMacroMode method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.led.macromode.getMacroEffect method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.led.macromode.setMacroEffect method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.macro.getMacros method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.macro.deleteMacro method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.macro.addMacro method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.setStarlightRandom method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.setStarlightSingle method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.chroma.setStarlightDual method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.custom.setRipple method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Adding razer.device.lighting.custom.setRippleRandomColour method to DBus
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | DBus call set_brightness
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Set persistence (backlight, brightness, 100)
2023-11-02 22:31:03 | razer.device0                  | DEBUG    | Sending observer message: ('effect', RazerCynosaV2:PM2042F413XXXXX, 'setBrightness', 255)
2023-11-02 22:31:03 | razer.device0.keymanager       | DEBUG    | Starting KeyWatcher
2023-11-02 22:31:03 | razer.device0                  | INFO     | Putting device into driver mode. Daemon will handle special functionality
2023-11-02 22:31:03 | razer                          | DEBUG    | Emitted Device Added Signal
2023-11-02 22:31:05 | razer                          | DEBUG    | State recently changed, writing to disk
2023-11-02 22:31:05 | razer                          | DEBUG    | Writing persistence config
2023-11-02 22:31:11 | razer.screensaver              | DEBUG    | Received screensaver inactive signal
2023-11-02 22:31:11 | razer.device0                  | INFO     | Resuming RazerCynosaV2
2023-11-02 22:31:11 | razer.device0                  | DEBUG    | DBus call set_brightness
2023-11-02 22:31:11 | razer.device0                  | INFO     | Putting device back into driver mode.

bbacskay avatar Nov 03 '23 04:11 bbacskay

In theory, the device being reconnected again should restore the original state. Is persistence enabled in ~/.config/openrazer/razer.conf?

[Startup]
restore_persistence = True

(There is also ~/.config/openrazer/persistence.conf worth checking)

lah7 avatar Nov 03 '23 09:11 lah7

In theory, the device being reconnected again should restore the original state. Is persistence enabled in ~/.config/openrazer/razer.conf?

And you are right again. I turned on the restore persistence option and now it works. I used the Polychromatic to configure the OpenRazer daemon options and the "Restore last used settings on daemon start" wording for the "restore_persistence" misled me and I tought that the settings are restored only when the daemon starts up.

(There is also ~/.config/openrazer/persistence.conf worth checking) The persistence.conf file is created/updated regardless whether or not the restore persistence is enabled. See the "Writing persistence config" entries in my posted log.

bbacskay avatar Nov 03 '23 15:11 bbacskay

That's my bad for the misleading UI label. I'll amend it.

The persistence.conf file is created/updated regardless whether or not the restore persistence is enabled.

That's correct. When settings change, the daemon usually writes it to disk after a few seconds. It's that restore_persistence setting that determines whether or not the daemon should actually use those "software" settings or do nothing and leave it up to the device when it's detected.

(It's a must for some newer Razer stuff as they always reset to spectrum on power on. Or in this case, because the firmware set itself to None instead of what software last sent - Static. There is no known way to query the hardware for what effect it's actually doing)

lah7 avatar Nov 03 '23 15:11 lah7