nanoleaf-desktop icon indicating copy to clipboard operation
nanoleaf-desktop copied to clipboard

Ambient mode not working for me (Linux)

Open hobbesjaap opened this issue 1 year ago • 3 comments

This is such a great, great piece of software since it's allowed to breathe some new life into my Nanoleaf lights, which have been severely underused lately. Thank you!

I'm hoping you can help me resolve the issue I'm having with the Ambient mode. I'm running Manjaro/Arch Linux with the latest kernel 6.2. I'm using GNOME and XOrg window manager. (Wayland is too buggy with games for my particular setup)

I open up the app (I'm using the beta 6.1 version you posted earlier since otherwise I can't connect my lights). I then navigate to Ambient and under Capture Area I leave it at "Monitor..." since the only other option is "Default". This may be a first sign my screen isn't being detected?

When I then click on "Set Area" the following log is generated:

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: -1 at io.github.rowak.nanoleafdesktop.ambilight.CaptureAreaWindow.getMaxCaptureArea(CaptureAreaWindow.java:64) at io.github.rowak.nanoleafdesktop.ambilight.CaptureAreaWindow.getDefaultSelectionArea(CaptureAreaWindow.java:69) at io.github.rowak.nanoleafdesktop.ambilight.CaptureAreaWindow.loadSettings(CaptureAreaWindow.java:77) at io.github.rowak.nanoleafdesktop.ambilight.CaptureAreaWindow.<init>(CaptureAreaWindow.java:38) at io.github.rowak.nanoleafdesktop.ui.panel.AmbilightPanel$6.actionPerformed(AmbilightPanel.java:174) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:262) at java.awt.Component.processMouseEvent(Component.java:6539) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6304) at java.awt.Container.processEvent(Container.java:2239) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2297) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476) at java.awt.Container.dispatchEventImpl(Container.java:2283) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84) at java.awt.EventQueue$4.run(EventQueue.java:733) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.awt.EventQueue.dispatchEvent(EventQueue.java:730) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

So my guess is that something isn't quite getting registered, making the program run an out-of-bounds error. Would you be able to assist me with this please?

hobbesjaap avatar Mar 10 '23 23:03 hobbesjaap

Hey, thanks for providing so much detail! It looks like this is a bug caused by the monitor dropdown not being a required field. The "Monitor..." option is actually intended to be a placeholder to prompt the user to select one of the other options, so this error occurs since it isn't a valid option. I'll make sure this gets fixed.

Have you tried using the "Default" option? If you only have one monitor connected then that is the correct option to use. Let me know if you get any errors.

rowak avatar Mar 11 '23 03:03 rowak

Hi, thanks for your super speedy feedback! You were completely correct, changing that to Default made it work. It's working great now!

Should I be worried about the high percentage of CPU usage (23% in htop on a i7-10700K) for this on X11? Would it be better on Wayland? (Or does it not work on Wayland?)

Thanks again!

On Fri, 2023-03-10 at 19:25 -0800, Ethan Rowan wrote:

Hey, thanks for providing so much detail! It looks like this is a bug caused by the monitor dropdown not being a required field. The "Monitor..." option is actually intended to be a placeholder to prompt the user to select one of the other options, so this error occurs since it isn't a valid option. I'll make sure this gets fixed. Have you tried using the "Default" option? If you only have one monitor connected then that is the correct option to use. Let me know if you get any errors. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

hobbesjaap avatar Mar 11 '23 05:03 hobbesjaap

Great! Glad it's working :)

Your CPU usage seems pretty normal actually. I'm also getting a similar CPU usage on my 5900x (20-25% single core in htop). I haven't tried Wayland myself but I suspect it probably wouldn't make much difference (but let me know if you try it and it does!).

The CPU usage tends to increase as the "update delay" decreases. You can change the update delay by adjusting the slider in the settings just underneath the button to enable/disable ambient lighting mode. Dragging the slider to the left decreases the update delay and dragging to the right increases it. You should keep the slider as close to the left as possible for the best experience.

rowak avatar Mar 11 '23 15:03 rowak