digitaltrails / vdu_controls

VDU controls - a control panel for monitor brightness/contrast/...
GNU General Public License v3.0
103 stars 4 forks source link

FIFO not shown in light metering settings #77

Closed herrwusel closed 4 months ago

herrwusel commented 4 months ago

With version 2.0.0, I can't select the FIFO under the Light-Metering settings: image

The FIFO is created by the python script:

$ ls .cache/vl* -lh
prw-r--r-- 1 user group 0  8. Feb 11:26 .cache/vlux_fifo
$ cat .cache/vlux_fifo         
10011

Do you have any idea what is going wrong here?

digitaltrails commented 4 months ago

What exactly are the symptoms?

From your example screenshot, it looks like .cache/vlux_fifo isn't appearing in the file dialog. That seems wrong. Are you seeing any error dialogs? Is anything logged to the syslog or stdout of the application?

I set up my own .cache/vlux_fifo and was able to switch to it. When the file-dialog launched, the default value for the "Look in:" field on the file-dialog was wrong/confusing, I had to navigate the file-dialog back to home, then into .cache, then pick the fifo. I need to fix that, but I'm not sure if it's related to your issue.

What is in $HOME/.config/vdu_controls/AutoLux.conf ?

As a workaround you could try manually editing the above AutoLux.conf file and set the lux-device = /home/SOMEONE/.cache/vlux_fifo

When I tried to switch back to /dev/arduino, the application locked up - so I definitely have an issue to track down, but it's possibly a different issue to yours.

digitaltrails commented 4 months ago

There definitely might be issues switching the metering "devices".

When switching away from a fifo to a different fifo or other device, the application goes into a spin because the fifo-meter reading-loop fails to check its worker.stop_requested flag and continues to wait on the now closed fifo.

I'm not sure that's the problem being reported though.

herrwusel commented 4 months ago

What exactly are the symptoms?

The FIFO is created by the python script and is available from terminal. In vdu's file picker dialog, the file is not visible/available.

Is anything logged to the syslog or stdout of the application?

I ran vdu from terminal, but nothing regarding the fifo showed up in the logs.

What is in $HOME/.config/vdu_controls/AutoLux.conf ?

[metadata]
version = 2.0.0
timestamp = 2024-02-20 17:46:44.339884+01:00

[lux-meter]
automatic-brightness = no
interpolate-brightness = yes

[lux-profile]
lg_ultrafine_308masx9j302 = [(1, 10), (12, 12), (125, 21), (1675, 37), (6899, 61), (41446, 78), (100000, 100)]

[lux-ui]

[lux-presets]
lux-preset-points = []

As a workaround you could try manually editing the above AutoLux.conf file and set the lux-device = /home/SOMEONE/.cache/vlux_fifo

With manually setting the FIFO, the file picker shows it. After picking it, I can't enable automatic brightness adjustment.

image

digitaltrails commented 4 months ago
  1. Could you try the latest 2.0.1 source code. There was a bug with changing FIFO's, but I'm not sure if it is the cause of your problem. I've also improved the file-selection dialog.
  2. Your filepicker screenshot looks unfamiliar, what desktop are you using? Maybe the file not being visible is is a bug that only affects some desktops. I'm using KDE, I tested gnome, xfce and deepin, but I'm not sure I tested the picker in all of those.
  3. If it still doesn't work, you could try manually editing again, I would expect the AutoLux.conf to contain something like:
    
    [metadata]
    version = 2.0.1
    timestamp = 2024-02-20 17:46:44.339884+01:00

[lux-meter] lux-device = /home/SOMEONE/.cache/vlux_fifo lux-device-type = fifo automatic-brightness = no interpolate-brightness = yes

[lux-profile] lg_ultrafine_308masx9j302 = [(1, 10), (12, 12), (125, 21), (1675, 37), (6899, 61), (41446, 78), (100000, 100)]

[lux-ui]

[lux-presets] lux-preset-points = []

herrwusel commented 4 months ago

Thanks for helping!

  1. After updating, I could not pick the FIFO with the file picker, but manually editing the config worked.
  2. I'm using hyprland, a wayland compositor. It appears that the file picker is the one from QT. It might look different because I applied a KVANTUM theme. Here Is more information about the window:
    Window 5fcff456d3d0 -> Select: Linux FIFO — VDU Controls:
    mapped: 1
    hidden: 0
    at: 2765,433
    size: 629,430
    workspace: 3 (3)
    floating: 1
    monitor: 1
    class: vdu_controls
    title: Select: Linux FIFO — VDU Controls
    initialClass: vdu_controls
    initialTitle: Select: Linux FIFO — VDU Controls
    pid: 27093
    xwayland: 0
  3. As mentioned under 1., this is the way it is working for me.
digitaltrails commented 4 months ago

It's good that the workaround worked.

When I have some time, I will investigate options that change the behaviour of the filepicker.

I'll take a look at how the file-picker behaves on the various desktops. I can also create a new user and experiment with kvantum. I've tried kvantum in the past, but I think it resulted in some issues, it was too long ago for me to remember.

I'll also investigate if there is an option for Qt to use an internal non-native file-picker?

digitaltrails commented 4 months ago

Thanks for providing some feedback, I can't test all variations of all desktops, so this kind of feedback is very helpful.

digitaltrails commented 4 months ago

Could you try the latest code.

I experimentally forced the file-picker to be the Qt file-picker (rather than the native one). I then got the same behaviour as you, I could no longer see the FIFOs in the picker.

I tracked this down to a Qt file-picker filter option that controls whether "System" files, such as FIFOs are shown in the picker. On my desktop this option appears to default to on for Qt when using the native-picker and off when using the Qt-picker. So perhaps the defaults may vary depending on who set up Qt for a given desktop. Maybe your desktop has this option defaulted to off.

Anyway I've explicitly set the option to on, so it would be interesting to see if it makes a difference.

herrwusel commented 4 months ago

The latest code resolved the issue for me - thanks!

What I did:

  1. Delete the config entries in AutoLux.conf
  2. Start vdu
  3. Chose fifo with the file picker
  4. Previously deleted config entries reappeared
digitaltrails commented 4 months ago

Thanks for doing the test. I'll stop relying on the file-picker's default settings. If no more bugs come in today, I'll start the process of releasing v2.0.1 to the distros.