Giter Site home page Giter Site logo

Comments (20)

nullobsi avatar nullobsi commented on August 24, 2024 1

You're welcome! But thank you for debugging this.

Why don't you use Temp clight property?

that sounds like a good idea, I'll add it to my todo list :)

from clightd.

FedeDP avatar FedeDP commented on August 24, 2024

Hi! As you can read here: https://github.com/FedeDP/Clightd/blob/master/src/modules/gamma_plugins/wl.c#L134, it seems like wlroots keeps the screen temperature until a wl_display connection is active.
Indeed, Clightd does not close the connection.
Thus i see 2 possibilities:

  • Clightd crashes and is restarted by Clight (dbus activated)
  • Sway closes the display connection after some idle time (as gamma temperature is automatically set by Clight during the morning and during the evening, thus lots of time passes in between, may be sway kills the conneciton even if Clightd keeps a reference on it)

Can you check if Clightd crashed?

from clightd.

nullobsi avatar nullobsi commented on August 24, 2024

i know clightd does not crash; i ran it under a debugger, and it still caused weird gamma changes...

it's very random, so I'm not sure what the root of the issue is. it could be something with Sway. sometimes the screen will flash the default gamma for a frame, then go back to the set gamma; other times it will reset the gamma completely.

from clightd.

nullobsi avatar nullobsi commented on August 24, 2024

clight-gui calls on the Clightd dbus in order to get/recieve events on the current gamma change

i think this may have something to do with the issue; perhaps two Clightd clients trying to access the same Wayland display through Clightd is causing some issues?

from clightd.

nullobsi avatar nullobsi commented on August 24, 2024

removing code from clight-gui that references Clightd/Gamma makes no difference; sometimes the gamma change simply goes away

from clightd.

FedeDP avatar FedeDP commented on August 24, 2024

i think this may have something to do with the issue; perhaps two Clightd clients trying to access the same Wayland display through Clightd is causing some issues?

Clightd does indeed cache open wl_display connections and reuses them for any client that makes a request, even for cross-module requests, eg:

  • a gamma Set opens a new display connection on let's say WAYLAND_DISPLAY wayland-0
  • a dpms Set requires wayland-0 display; a connection has been cached -> dpms will use again same connection

removing code from clight-gui that references Clightd/Gamma makes no difference; sometimes the gamma change simply goes away

As expected. I feel this is a wlroots issue, or at least i am mismanaging something in Clightd.
Can you test with eg: https://gitlab.com/chinstrap/gammastep if it has same issue?
Thank you!

from clightd.

nullobsi avatar nullobsi commented on August 24, 2024

I tested it for a bit, and gammastep doesn't make the gamma flicker. However using clight, sometimes it will flicker/stop (opening clight-gui, just at random)

from clightd.

nullobsi avatar nullobsi commented on August 24, 2024

it also seems calling Get on clightd wayland causes the gamma to reset

from clightd.

FedeDP avatar FedeDP commented on August 24, 2024

(opening clight-gui, just at random)

Does it happen only while opening clight-gui?

it also seems calling Get on clightd wayland causes the gamma to reset

Thanks, will investigate!
Btw thank you for your testing!

from clightd.

nullobsi avatar nullobsi commented on August 24, 2024

It doesn't just happen when opening clight-gui; that happens because clight-gui calls Get on clightd

but, with clight running, it will randomly drop the gamma... it seems using busctl directly on clightd and not touching it has no issues

from clightd.

FedeDP avatar FedeDP commented on August 24, 2024

it seems using busctl directly on clightd and not touching it has no issues

argh that makes it harder to debug; will try anyway.

but, with clight running, it will randomly drop the gamma

Is this gamma drop related to clight-gui calling Get on Clightd or completely random? (btw out of curiosity, why are you calling Clightd directly?)
Thanks!

from clightd.

nullobsi avatar nullobsi commented on August 24, 2024

here's a bit of a better description

scenario 1:

  • only run clightd
  • use busctl to call Set
  • gamma persists, even through multiple Set calls

scenario 2:

  • run clight and clightd
  • gamma is set automatically
  • gamma sometimes flashes/turns off

in both, calling Get on clightd, either through clight-gui or busctl, causes the gamma to disappear

from clightd.

nullobsi avatar nullobsi commented on August 24, 2024

Also, clight gui calls clightd directly to obtain the gamma temperature when it is opened, and then hooks to the Changed signal on gamma.

from clightd.

FedeDP avatar FedeDP commented on August 24, 2024

scenario 2:

run clight and clightd
gamma is set automatically
gamma sometimes flashes/turns off

in both, calling Get on clightd, either through clight-gui or busctl, causes the gamma to disappear

Thank you! This will help me isolate the problem!

Also, clight gui calls clightd directly to obtain the gamma temperature when it is opened, and then hooks to the Changed signal on gamma.

Why don't you use Temp clight property? https://github.com/FedeDP/Clight/wiki/Api#read-only-bus-properties
It also emits changes!

from clightd.

FedeDP avatar FedeDP commented on August 24, 2024

that sounds like a good idea, I'll add it to my todo list :)

Does new clight-gui that does no more call Clightd Gamma.Get helps?

from clightd.

nullobsi avatar nullobsi commented on August 24, 2024

Unfortunately it did not. While it did remove the launch issue, it still randomly went away.

from clightd.

FedeDP avatar FedeDP commented on August 24, 2024

Hi! Can you test with attached patch?
Thank you :)
clightd_wl.txt

I am trying to register the wl_display fd and dispatch any event it receives. Maybe this will keep the connection alive!

from clightd.

FedeDP avatar FedeDP commented on August 24, 2024

I should have found the issue: dpms protocol on wayland was segfaulting clightd were not supported (it is only supported by kwin... so on sway it crashed clightd).
I am testing and i will push a fix!

from clightd.

FedeDP avatar FedeDP commented on August 24, 2024

Should be fixed now!

from clightd.

nullobsi avatar nullobsi commented on August 24, 2024

it appears it is working fine! thank you for fixing it :)

from clightd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.