digitaltrails / vdu_controls

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

Contrast isn't being set when using the dbus service #74

Closed denilsonsa closed 4 months ago

denilsonsa commented 4 months ago

Hi! Hello again!

I have two displays, and I have a bunch of presets that set both the brightness and the contrast. The presets are available on my dotfiles.

After updating to version 2, and installing the dbus service package (Manjaro Linux), when I switch profiles, only the brightness is set, the contrast isn't. If I open the main dialog and manually change the contrast widget, it works instantly. But if I change a profile that sets both brightness and contrast, the contrast isn't changed.

Untested: a profile that only sets the contrast. I guess it might work, but I haven't had time to investigate.

Untested: a profile that sets multiple items.

System: HP EliteDesk 800 G2 with Intel i7-6700 and Intel HD Graphics 530.

Verbose log output ``` 09:21:02 INFO: VDU Controls 2.0.0 /usr/bin/vdu_controls 09:21:02 INFO: python-locale: ('en_GB', 'UTF-8') Qt-locale: en_GB 09:21:02 INFO: app-style: breeze (detected a dark theme) 09:21:02 INFO: Looking for config file '/home/denilson/.config/vdu_controls/vdu_controls.conf' 09:21:02 INFO: Using config file '/home/denilson/.config/vdu_controls/vdu_controls.conf' 09:21:02 WARNING: command-line debug=yes overrides vdu-controls-globals.debug-enabled=no (in /home/denilson/.config/vdu_controls/vdu_controls.conf) 09:21:02 INFO: Logging to stdout 09:21:02 DEBUG: config: vdu_controls.conf [metadata] version = 2.0.0 09:21:02 DEBUG: config: vdu_controls.conf [metadata] timestamp = 2024-02-17 08:39:09.587671+01:00 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-globals] system-tray-enabled = yes 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-globals] hide-on-focus-out = no 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-globals] translations-enabled = no 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-globals] weather-enabled = no 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-globals] schedule-enabled = yes 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-globals] lux-options-enabled = no 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-globals] splash-screen-enabled = yes 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-globals] warnings-enabled = no 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-globals] smart-window = yes 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-globals] monochrome-tray-enabled = yes 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-globals] mono-light-tray-enabled = no 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-globals] debug-enabled = yes 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-globals] syslog-enabled = no 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-globals] dbus-client-enabled = yes 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-globals] dbus-signals-enabled = yes 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-globals] location = 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-globals] adjust-for-dpi = yes 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] brightness = yes 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] contrast = yes 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-volume = yes 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-mute = yes 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-treble = no 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-bass = no 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-mic-volume = no 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] input-source = yes 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] power-mode = no 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] osd-language = yes 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] color-temperature = yes 09:21:02 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] enable-vcp-codes = 14 09:21:02 DEBUG: config: vdu_controls.conf [ddcutil-parameters] sleep-multiplier = 1.00 09:21:02 DEBUG: config: vdu_controls.conf [ddcutil-parameters] ddcutil-extra-args = 09:21:02 DEBUG: config: vdu_controls.conf [ddcutil-capabilities] capabilities-override = 09:21:03 INFO: Screen DP-1 09:21:03 INFO: Screen DP-2 09:21:03 DEBUG: Reserve shortcut 'P' 09:21:03 DEBUG: Reserve shortcut 'G' 09:21:03 DEBUG: Reserve shortcut 'S' 09:21:03 DEBUG: Reserve shortcut 'R' 09:21:03 DEBUG: Reserve shortcut 'T' 09:21:03 DEBUG: Reserve shortcut 'H' 09:21:03 DEBUG: Reserve shortcut 'Q' 09:21:03 INFO: native_font_height_pixels=18 09:21:03 INFO: Using monochrome app_icon: monochrome_tray=True mono_light_tray=False 09:21:03 INFO: Using system tray. 09:21:03 INFO: Configuring application (reconfiguring=False)... 09:21:03 DEBUG: configure: try to obtain application_configuration_lock 09:21:03 DEBUG: Holding application_configuration_lock 09:21:03 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_A-darkest-0-0.conf' 09:21:03 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_B-darker-0-25.conf' 09:21:03 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_C-dark-0-50.conf' 09:21:03 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_D-medium-dark-25-50.conf' 09:21:03 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_E-medium-bright-50-50.conf' 09:21:03 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_F-bright-75-50.conf' 09:21:03 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_G-brighter-100-50.conf' 09:21:03 DEBUG: Enabled callback for VDU-connectivity-change D-Bus signals 09:21:03 INFO: ddcutil version (2, 0, 0) (dynamic-sleep=True) - interface 1.0.0 (D-Bus ddcutil-service - libddcutil) 09:21:03 INFO: Using monochrome app_icon: monochrome_tray=True mono_light_tray=False 09:21:03 DEBUG: Detecting connected monitors, looping detection until it stabilises. 09:21:03 DEBUG: checking possible IDs for display 1 09:21:03 DEBUG: checking possible IDs for display 2 09:21:03 DEBUG: Unique key for vdu_number='1' manufacturer='AOC' is (model_name='Q27P1B' main_id='GNXKCHA123704') 09:21:03 DEBUG: Unique key for vdu_number='2' manufacturer='AOC' is (model_name='Q27P1B' main_id='GNXJ7HA015309') 09:21:05 DEBUG: checking possible IDs for display 1 09:21:05 DEBUG: checking possible IDs for display 2 09:21:05 DEBUG: Unique key for vdu_number='1' manufacturer='AOC' is (model_name='Q27P1B' main_id='GNXKCHA123704') 09:21:05 DEBUG: Unique key for vdu_number='2' manufacturer='AOC' is (model_name='Q27P1B' main_id='GNXJ7HA015309') 09:21:05 INFO: Number of detected monitors is stable at 2 (loop=2) 09:21:05 INFO: Initializing controls for vdu_number='1' vdu_model_name='Q27P1B' self.vdu_stable_id='Q27P1B_GNXKCHA123704' 09:21:05 DEBUG: checking for config file '/home/denilson/.config/vdu_controls/Q27P1B_GNXKCHA123704.conf' 09:21:05 DEBUG: checking for config file '/home/denilson/.config/vdu_controls/Q27P1B.conf' 09:21:05 INFO: Using config file '/home/denilson/.config/vdu_controls/Q27P1B.conf' 09:21:05 DEBUG: config: Q27P1B.conf [metadata] version = 1.8.3 09:21:05 DEBUG: config: Q27P1B.conf [metadata] timestamp = 2023-01-11 09:30:00.982106+01:00 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] brightness = yes 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] contrast = yes 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-volume = yes 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-mute = no 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-treble = no 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-bass = no 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-mic-volume = no 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] input-source = no 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] power-mode = no 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] osd-language = no 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] color-temperature = yes 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] enable-vcp-codes = 14 09:21:05 DEBUG: config: Q27P1B.conf [ddcutil-parameters] sleep-multiplier = 0.75 09:21:05 DEBUG: config: Q27P1B.conf [ddcutil-parameters] ddcutil-extra-args = 09:21:05 DEBUG: config: Q27P1B.conf [ddcutil-capabilities] capabilities-override = Model: Q27P1 MCCS version: 2.1 Commands: Op Code: 01 (VCP Request) Op Code: 02 (VCP Response) Op Code: 03 (VCP Set) Op Code: 07 (Timing Request) Op Code: 0C (Save Settings) Op Code: F3 (Capabilities Request) VCP Features: Feature: 02 (New control value) Feature: 04 (Restore factory defaults) Feature: 05 (Restore factory brightness/contrast defaults) Feature: 08 (Restore color defaults) Feature: 10 (Brightness) Feature: 12 (Contrast) Feature: 14 (Select color preset) Values: 01: sRGB 05: 6500 K 06: 7500 K 08: 9300 K 0b: User 1 Feature: 16 (Video gain: Red) Feature: 18 (Video gain: Green) Feature: 1A (Video gain: Blue) Feature: 60 (Input Source) Values: 00: HDMI (read-only) 01: VGA 03: DVI 05: DisplayPort (read-only) 15: DisplayPort (switch to) 17: HDMI (switch to) Feature: 62 (Audio speaker volume) Feature: 6C (Video black level: Red) Feature: 6E (Video black level: Green) Feature: 70 (Video black level: Blue) Feature: C8 (Display controller type) Feature: C9 (Display firmware level) Feature: B0 (Settings) Feature: B6 (Display technology type) Feature: D6 (Power mode) Feature: DF (VCP Version) Feature: F8 (Manufacturer specific feature) 09:21:05 DEBUG: Removed Q27P1B audio-mute - not supported by VDU 09:21:05 DEBUG: Removed Q27P1B audio-treble - not supported by VDU 09:21:05 DEBUG: Removed Q27P1B audio-bass - not supported by VDU 09:21:05 DEBUG: Removed Q27P1B audio-mic-volume - not supported by VDU 09:21:05 DEBUG: Removed Q27P1B osd-language - not supported by VDU 09:21:05 DEBUG: Removed Q27P1B color-temperature - not supported by VDU 09:21:05 INFO: Initializing controls for vdu_number='2' vdu_model_name='Q27P1B' self.vdu_stable_id='Q27P1B_GNXJ7HA015309' 09:21:05 DEBUG: checking for config file '/home/denilson/.config/vdu_controls/Q27P1B_GNXJ7HA015309.conf' 09:21:05 DEBUG: checking for config file '/home/denilson/.config/vdu_controls/Q27P1B.conf' 09:21:05 INFO: Using config file '/home/denilson/.config/vdu_controls/Q27P1B.conf' 09:21:05 DEBUG: config: Q27P1B.conf [metadata] version = 1.8.3 09:21:05 DEBUG: config: Q27P1B.conf [metadata] timestamp = 2023-01-11 09:30:00.982106+01:00 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] brightness = yes 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] contrast = yes 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-volume = yes 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-mute = no 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-treble = no 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-bass = no 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-mic-volume = no 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] input-source = no 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] power-mode = no 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] osd-language = no 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] color-temperature = yes 09:21:05 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] enable-vcp-codes = 14 09:21:05 DEBUG: config: Q27P1B.conf [ddcutil-parameters] sleep-multiplier = 0.75 09:21:05 DEBUG: config: Q27P1B.conf [ddcutil-parameters] ddcutil-extra-args = 09:21:05 DEBUG: config: Q27P1B.conf [ddcutil-capabilities] capabilities-override = Model: Q27P1 MCCS version: 2.1 Commands: Op Code: 01 (VCP Request) Op Code: 02 (VCP Response) Op Code: 03 (VCP Set) Op Code: 07 (Timing Request) Op Code: 0C (Save Settings) Op Code: F3 (Capabilities Request) VCP Features: Feature: 02 (New control value) Feature: 04 (Restore factory defaults) Feature: 05 (Restore factory brightness/contrast defaults) Feature: 08 (Restore color defaults) Feature: 10 (Brightness) Feature: 12 (Contrast) Feature: 14 (Select color preset) Values: 01: sRGB 05: 6500 K 06: 7500 K 08: 9300 K 0b: User 1 Feature: 16 (Video gain: Red) Feature: 18 (Video gain: Green) Feature: 1A (Video gain: Blue) Feature: 60 (Input Source) Values: 00: HDMI (read-only) 01: VGA 03: DVI 05: DisplayPort (read-only) 15: DisplayPort (switch to) 17: HDMI (switch to) Feature: 62 (Audio speaker volume) Feature: 6C (Video black level: Red) Feature: 6E (Video black level: Green) Feature: 70 (Video black level: Blue) Feature: C8 (Display controller type) Feature: C9 (Display firmware level) Feature: B0 (Settings) Feature: B6 (Display technology type) Feature: D6 (Power mode) Feature: DF (VCP Version) Feature: F8 (Manufacturer specific feature) 09:21:05 DEBUG: Removed Q27P1B audio-mute - not supported by VDU 09:21:05 DEBUG: Removed Q27P1B audio-treble - not supported by VDU 09:21:05 DEBUG: Removed Q27P1B audio-bass - not supported by VDU 09:21:05 DEBUG: Removed Q27P1B audio-mic-volume - not supported by VDU 09:21:05 DEBUG: Removed Q27P1B osd-language - not supported by VDU 09:21:05 DEBUG: Removed Q27P1B color-temperature - not supported by VDU 09:21:05 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_A-darkest-0-0.conf' 09:21:05 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_B-darker-0-25.conf' 09:21:05 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_C-dark-0-50.conf' 09:21:05 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_D-medium-dark-25-50.conf' 09:21:05 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_E-medium-bright-50-50.conf' 09:21:05 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_F-bright-75-50.conf' 09:21:05 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_G-brighter-100-50.conf' 09:21:05 INFO: splash_message: 'DDC ID 1\nQ27P1B:GNXKCHA123704' 09:21:05 DEBUG: vcp_value_changed: Q27P1B_GNXKCHA123704 vcp_code='10' 0 origin=EXTERNAL 09:21:05 DEBUG: vcp_value_changed: Q27P1B_GNXKCHA123704 vcp_code='12' 50 origin=EXTERNAL 09:21:05 DEBUG: vcp_value_changed: Q27P1B_GNXKCHA123704 vcp_code='14' 5 origin=EXTERNAL 09:21:05 DEBUG: vcp_value_changed: Q27P1B_GNXKCHA123704 vcp_code='62' 100 origin=EXTERNAL 09:21:05 INFO: splash_message: 'DDC ID 2\nQ27P1B:GNXJ7HA015309' 09:21:05 DEBUG: vcp_value_changed: Q27P1B_GNXJ7HA015309 vcp_code='10' 0 origin=EXTERNAL 09:21:05 DEBUG: vcp_value_changed: Q27P1B_GNXJ7HA015309 vcp_code='12' 50 origin=EXTERNAL 09:21:05 DEBUG: vcp_value_changed: Q27P1B_GNXJ7HA015309 vcp_code='14' 5 origin=EXTERNAL 09:21:05 DEBUG: vcp_value_changed: Q27P1B_GNXJ7HA015309 vcp_code='62' 100 origin=EXTERNAL 09:21:05 INFO: splash_message: 'Checking Presets' 09:21:05 DEBUG: SingletonDialog exists SettingsEditor False 09:21:05 DEBUG: configure: released application_configuration_lock 09:21:05 INFO: Completed configuring application 09:21:13 DEBUG: restore_preset: try to obtain application_configuration_lock 09:21:13 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_B-darker-0-25.conf' 09:21:13 DEBUG: WorkerThread: init PresetTransitionWorker from thread_pid()=1046572 09:21:13 DEBUG: TransitionWorker: init preset.name='B-darker-0-25' immediately=True scheduled_activity=False 09:21:13 DEBUG: restore_preset: released application_configuration_lock 09:21:13 DEBUG: WorkerThread: class_name='PresetTransitionWorker' running in thread_pid()=1046632 > 09:21:13 DEBUG: vcp_value_changed: Q27P1B_GNXKCHA123704 vcp_code='10' 0 origin=TRANSIENT 09:21:13 DEBUG: respond vdu_stable_id='Q27P1B_GNXKCHA123704' vcp_code='10' value=0 origin.name='TRANSIENT' 09:21:13 DEBUG: vcp_value_changed: Q27P1B_GNXKCHA123704 vcp_code='12' 25 origin=TRANSIENT 09:21:13 DEBUG: respond vdu_stable_id='Q27P1B_GNXKCHA123704' vcp_code='12' value=25 origin.name='TRANSIENT' 09:21:13 DEBUG: vcp_value_changed: Q27P1B_GNXJ7HA015309 vcp_code='10' 0 origin=TRANSIENT 09:21:13 DEBUG: respond vdu_stable_id='Q27P1B_GNXJ7HA015309' vcp_code='10' value=0 origin.name='TRANSIENT' 09:21:13 DEBUG: vcp_value_changed: Q27P1B_GNXJ7HA015309 vcp_code='12' 25 origin=TRANSIENT 09:21:13 INFO: Successfully restored B-darker-0-25, elapsed time: 0.01 seconds 09:21:13 DEBUG: WorkerThread: class_name='PresetTransitionWorker' terminating thread_pid()=1046632 09:21:13 DEBUG: respond vdu_stable_id='Q27P1B_GNXJ7HA015309' vcp_code='12' value=25 origin.name='TRANSIENT' 09:21:23 DEBUG: restore_preset: try to obtain application_configuration_lock 09:21:23 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_C-dark-0-50.conf' 09:21:23 DEBUG: WorkerThread: init PresetTransitionWorker from thread_pid()=1046572 09:21:23 DEBUG: TransitionWorker: init preset.name='C-dark-0-50' immediately=True scheduled_activity=False 09:21:23 DEBUG: restore_preset: released application_configuration_lock 09:21:23 DEBUG: WorkerThread: class_name='PresetTransitionWorker' running in thread_pid()=1046633 > 09:21:23 DEBUG: vcp_value_changed: Q27P1B_GNXKCHA123704 vcp_code='10' 0 origin=TRANSIENT 09:21:23 DEBUG: respond vdu_stable_id='Q27P1B_GNXKCHA123704' vcp_code='10' value=0 origin.name='TRANSIENT' 09:21:23 DEBUG: vcp_value_changed: Q27P1B_GNXKCHA123704 vcp_code='12' 50 origin=TRANSIENT 09:21:23 DEBUG: respond vdu_stable_id='Q27P1B_GNXKCHA123704' vcp_code='12' value=50 origin.name='TRANSIENT' 09:21:23 DEBUG: vcp_value_changed: Q27P1B_GNXJ7HA015309 vcp_code='10' 0 origin=TRANSIENT 09:21:23 DEBUG: respond vdu_stable_id='Q27P1B_GNXJ7HA015309' vcp_code='10' value=0 origin.name='TRANSIENT' 09:21:23 DEBUG: vcp_value_changed: Q27P1B_GNXJ7HA015309 vcp_code='12' 50 origin=TRANSIENT 09:21:23 INFO: Successfully restored C-dark-0-50, elapsed time: 0.01 seconds 09:21:23 DEBUG: WorkerThread: class_name='PresetTransitionWorker' terminating thread_pid()=1046633 09:21:23 DEBUG: respond vdu_stable_id='Q27P1B_GNXJ7HA015309' vcp_code='12' value=50 origin.name='TRANSIENT' ```
digitaltrails commented 4 months ago

09:21:23 DEBUG: WorkerThread: class_name='PresetTransitionWorker' running in thread_pid()=1046633 <bound method PresetTransitionWorker.task_body of <main.PresetTransitionWorker object at 0x7ff343f4a950>> 09:21:23 DEBUG: vcp_value_changed: Q27P1B_GNXKCHA123704 vcp_code='10' 0 origin=TRANSIENT 09:21:23 DEBUG: respond vdu_stable_id='Q27P1B_GNXKCHA123704' vcp_code='10' value=0 origin.name='TRANSIENT' 09:21:23 DEBUG: vcp_value_changed: Q27P1B_GNXKCHA123704 vcp_code='12' 50 origin=TRANSIENT 09:21:23 DEBUG: respond vdu_stable_id='Q27P1B_GNXKCHA123704' vcp_code='12' value=50 origin.name='TRANSIENT' 09:21:23 DEBUG: vcp_value_changed: Q27P1B_GNXJ7HA015309 vcp_code='10' 0 origin=TRANSIENT 09:21:23 DEBUG: respond vdu_stable_id='Q27P1B_GNXJ7HA015309' vcp_code='10' value=0 origin.name='TRANSIENT' 09:21:23 DEBUG: vcp_value_changed: Q27P1B_GNXJ7HA015309 vcp_code='12' 50 origin=TRANSIENT 09:21:23 INFO: Successfully restored C-dark-0-50, elapsed time: 0.01 seconds 09:21:23 DEBUG: WorkerThread: class_name='PresetTransitionWorker' terminating thread_pid()=1046633 09:21:23 DEBUG: respond vdu_stable_id='Q27P1B_GNXJ7HA015309' vcp_code='12' value=50 origin.name='TRANSIENT'

On the vdu_controls side, the logging indicates VCP 0x12 (contrast) is being set to 50 for both monitors and that no errors occurred.

If 50 isn't the right value, perhaps the preset code is broken in vdu_controls. That would hopefully be easy to track down.

Maybe ddcutil-server did not call libddcutil or silently swallowed an error. Libddcutil defaults to checking that the value has been set correctly, so if the value got that far, it should have been set (unless the hardware tells fibs).

Try enabling extra logging in ddcutil-server. The following busctl command should enable more logging on a running server:

% busctl --user set-property com.ddcutil.DdcutilService /com/ddcutil/DdcutilObject com.ddcutil.DdcutilInterface ServiceInfoLogging b 1

This is just setting the value to boolean 1, set it back to 0 to turn it off.

Where the logging gets written might depend on you distro, probably to the journal. If you want to see the log in a console, just kill the server and run it manually with --log-info:

% killall ddcutil-service
% /usr/bin/ddcutil-service --log-info

The service should log all the requests and log any non-zero return codes.

Maybe we're pushing the driver or hardware too fast. I think ddcutil 2.0.0 had some over-optimistic dynamic optimisations to the sleep-multiplier which were corrected in 2.0.1+. If dynamic-sleep is set to on, perhaps try disabling it:

% busctl --user get-property com.ddcutil.DdcutilService /com/ddcutil/DdcutilObject com.ddcutil.DdcutilInterface DdcutilDynamicSleep

% busctl --user set-property com.ddcutil.DdcutilService /com/ddcutil/DdcutilObject com.ddcutil.DdcutilInterface DdcutilDynamicSleep b 1

This morning I tested a preset/profile on my desktop with a two VDU's and both brightness and contrast are being restored. But I'm using Nvidia, Nvidia's DDC code is pretty quirky (after a driver upgrade, I had to switch to all DisplayPort cables to get DDC to work). The author of ddcutil/libddcutil mainly uses AMD, AMD is solid as far as DDC is concerned. I don't know much about Intel.

There are also some libddcutil logging that can be turned on. I'd need to research that. But we don't known if the problem is coming from there yet.

So no smoking gun, just some things to explore.

denilsonsa commented 4 months ago

I also checked the Dynamic Sleep:

$ busctl --user get-property com.ddcutil.DdcutilService /com/ddcutil/DdcutilObject com.ddcutil.DdcutilInterface DdcutilDynamicSleep

b false

No matter if I passed 1 or 0 to the set-property, it was always reading back as b false.

Dynamic sleep not supported by this version of libddcutil

I have version 2.0.0 installed. (Newer versions aren't yet available in the package manager, and I don't want to manually install it.)


I could watch the logs using:

journalctl -f /usr/bin/ddcutil-service

I did these steps:

  1. Enabled logging (through that dbus command).
  2. Opened vdu_controls --debug.
  3. Loaded the Preset_A-darkest-0-0 (which sets brightness=0 and contrast=0 for both displayes).
  4. Noticed that all UI sliders changed to zero, but the monitor contrast was unchanged.
  5. Clicked on the refresh button to reload the values from the monitors.
  6. Noticed that the contrast sliders returned to 50, showing that indeed the contrast wasn't changed.
`ddcutil-service` logs ``` 14:04:37 ddcutil-service: ServiceInfoLogging enabled 14:04:43 ddcutil-service: Detect flags=1 14:04:43 ddcutil-service: Detected AOC Q27P1B GNXKCHA123704 display_num=1 edid=AP///////wAF4wEnOOMBADMdAQS1PC... 14:04:43 ddcutil-service: Detected AOC Q27P1B GNXJ7HA015309 display_num=2 edid=AP///////wAF4wEnzTsAAB0cAQS1PC... 14:04:45 ddcutil-service: Detect flags=1 14:04:45 ddcutil-service: Detected AOC Q27P1B GNXKCHA123704 display_num=1 edid=AP///////wAF4wEnOOMBADMdAQS1PC... 14:04:45 ddcutil-service: Detected AOC Q27P1B GNXJ7HA015309 display_num=2 edid=AP///////wAF4wEnzTsAAB0cAQS1PC... 14:04:45 ddcutil-service: SetSleepMultiplier value=0.750000 display_num=-1 edid=AP///////wAF4wEnOOMBADMdAQS1PC... 14:04:45 ddcutil-service: SetSleepMultiplier value=0.750000 display_num=-1 edid=AP///////wAF4wEnzTsAAB0cAQS1PC... 14:04:45 ddcutil-service: GetMultipleVcp display_num=-1, edid=AP///////wAF4wEnOOMBADMdAQS1PC... 14:04:45 ddcutil-service: GetVcpMetadata display_num=-1, edid=AP///////wAF4wEnOOMBADMdAQS1PC...vcp_code=16 14:04:45 ddcutil-service: GetVcpMetadata display_num=-1, edid=AP///////wAF4wEnOOMBADMdAQS1PC...vcp_code=18 14:04:45 ddcutil-service: GetVcpMetadata display_num=-1, edid=AP///////wAF4wEnOOMBADMdAQS1PC...vcp_code=20 14:04:45 ddcutil-service: GetVcpMetadata display_num=-1, edid=AP///////wAF4wEnOOMBADMdAQS1PC...vcp_code=98 14:04:45 ddcutil-service: GetMultipleVcp display_num=-1, edid=AP///////wAF4wEnzTsAAB0cAQS1PC... 14:04:45 ddcutil-service: GetVcpMetadata display_num=-1, edid=AP///////wAF4wEnzTsAAB0cAQS1PC...vcp_code=16 14:04:45 ddcutil-service: GetVcpMetadata display_num=-1, edid=AP///////wAF4wEnzTsAAB0cAQS1PC...vcp_code=18 14:04:45 ddcutil-service: GetVcpMetadata display_num=-1, edid=AP///////wAF4wEnzTsAAB0cAQS1PC...vcp_code=20 14:04:45 ddcutil-service: g_variant_new_string: assertion 'g_utf8_validate (string, -1, NULL)' failed 14:04:45 ddcutil-service: GetVcpMetadata display_num=-1, edid=AP///////wAF4wEnzTsAAB0cAQS1PC...vcp_code=98 14:05:02 ddcutil-service: SetVcp vcp_code=16 value=0 display_num=-1 edid=AP///////wAF4wEnOOMBADMdAQS1PC... 14:05:02 ddcutil-service: SetVcp vcp_code=18 value=0 display_num=-1 edid=AP///////wAF4wEnOOMBADMdAQS1PC... 14:05:02 ddcutil-service: SetVcp vcp_code=16 value=0 display_num=-1 edid=AP///////wAF4wEnzTsAAB0cAQS1PC... 14:05:02 ddcutil-service: SetVcp vcp_code=18 value=0 display_num=-1 edid=AP///////wAF4wEnzTsAAB0cAQS1PC... 14:05:14 ddcutil-service: ServiceEmitSignals set property to enabled 14:05:14 ddcutil-service: ServiceEmitSignals using ddcutil-service polling 14:05:14 ddcutil-service: Detect flags=1 14:05:14 ddcutil-service: Detected AOC Q27P1B GNXKCHA123704 display_num=1 edid=AP///////wAF4wEnOOMBADMdAQS1PC... 14:05:14 ddcutil-service: Detected AOC Q27P1B GNXJ7HA015309 display_num=2 edid=AP///////wAF4wEnzTsAAB0cAQS1PC... 14:05:14 ddcutil-service: GetMultipleVcp display_num=-1, edid=AP///////wAF4wEnOOMBADMdAQS1PC... 14:05:14 ddcutil-service: GetMultipleVcp display_num=-1, edid=AP///////wAF4wEnzTsAAB0cAQS1PC... ```
`vdu_controls --debug` logs ``` 14:04:43 INFO: VDU Controls 2.0.0 /usr/bin/vdu_controls 14:04:43 INFO: python-locale: ('en_GB', 'UTF-8') Qt-locale: en_GB 14:04:43 INFO: app-style: breeze (detected a dark theme) 14:04:43 INFO: Looking for config file '/home/denilson/.config/vdu_controls/vdu_controls.conf' 14:04:43 INFO: Using config file '/home/denilson/.config/vdu_controls/vdu_controls.conf' 14:04:43 WARNING: command-line debug=yes overrides vdu-controls-globals.debug-enabled=no (in /home/denilson/.config/vdu_controls/vdu_controls.conf) 14:04:43 INFO: Logging to stdout 14:04:43 DEBUG: config: vdu_controls.conf [metadata] version = 2.0.0 14:04:43 DEBUG: config: vdu_controls.conf [metadata] timestamp = 2024-02-17 08:39:09.587671+01:00 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-globals] system-tray-enabled = yes 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-globals] hide-on-focus-out = no 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-globals] translations-enabled = no 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-globals] weather-enabled = no 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-globals] schedule-enabled = yes 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-globals] lux-options-enabled = no 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-globals] splash-screen-enabled = yes 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-globals] warnings-enabled = no 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-globals] smart-window = yes 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-globals] monochrome-tray-enabled = yes 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-globals] mono-light-tray-enabled = no 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-globals] debug-enabled = yes 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-globals] syslog-enabled = no 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-globals] dbus-client-enabled = yes 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-globals] dbus-signals-enabled = yes 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-globals] location = 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-globals] adjust-for-dpi = yes 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] brightness = yes 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] contrast = yes 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-volume = yes 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-mute = yes 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-treble = no 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-bass = no 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-mic-volume = no 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] input-source = yes 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] power-mode = no 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] osd-language = yes 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] color-temperature = yes 14:04:43 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] enable-vcp-codes = 14 14:04:43 DEBUG: config: vdu_controls.conf [ddcutil-parameters] sleep-multiplier = 1.00 14:04:43 DEBUG: config: vdu_controls.conf [ddcutil-parameters] ddcutil-extra-args = 14:04:43 DEBUG: config: vdu_controls.conf [ddcutil-capabilities] capabilities-override = 14:04:43 INFO: Screen DP-1 14:04:43 INFO: Screen DP-2 14:04:43 DEBUG: Reserve shortcut 'P' 14:04:43 DEBUG: Reserve shortcut 'G' 14:04:43 DEBUG: Reserve shortcut 'S' 14:04:43 DEBUG: Reserve shortcut 'R' 14:04:43 DEBUG: Reserve shortcut 'T' 14:04:43 DEBUG: Reserve shortcut 'H' 14:04:43 DEBUG: Reserve shortcut 'Q' 14:04:43 INFO: native_font_height_pixels=18 14:04:43 INFO: Using monochrome app_icon: monochrome_tray=True mono_light_tray=False 14:04:43 INFO: Using system tray. 14:04:43 INFO: Configuring application (reconfiguring=False)... 14:04:43 DEBUG: configure: try to obtain application_configuration_lock 14:04:43 DEBUG: Holding application_configuration_lock 14:04:43 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_A-darkest-0-0.conf' 14:04:43 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_B-darker-0-25.conf' 14:04:43 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_C-dark-0-50.conf' 14:04:43 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_D-medium-dark-25-50.conf' 14:04:43 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_E-medium-bright-50-50.conf' 14:04:43 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_F-bright-75-50.conf' 14:04:43 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_G-brighter-100-50.conf' 14:04:43 DEBUG: Enabled callback for VDU-connectivity-change D-Bus signals 14:04:43 INFO: ddcutil version (2, 0, 0) (dynamic-sleep=True) - interface 1.0.0 (D-Bus ddcutil-service - libddcutil) 14:04:43 INFO: Using monochrome app_icon: monochrome_tray=True mono_light_tray=False 14:04:43 DEBUG: Detecting connected monitors, looping detection until it stabilises. 14:04:43 DEBUG: checking possible IDs for display 1 14:04:43 DEBUG: checking possible IDs for display 2 14:04:43 DEBUG: Unique key for vdu_number='1' manufacturer='AOC' is (model_name='Q27P1B' main_id='GNXKCHA123704') 14:04:43 DEBUG: Unique key for vdu_number='2' manufacturer='AOC' is (model_name='Q27P1B' main_id='GNXJ7HA015309') 14:04:45 DEBUG: checking possible IDs for display 1 14:04:45 DEBUG: checking possible IDs for display 2 14:04:45 DEBUG: Unique key for vdu_number='1' manufacturer='AOC' is (model_name='Q27P1B' main_id='GNXKCHA123704') 14:04:45 DEBUG: Unique key for vdu_number='2' manufacturer='AOC' is (model_name='Q27P1B' main_id='GNXJ7HA015309') 14:04:45 INFO: Number of detected monitors is stable at 2 (loop=2) 14:04:45 INFO: Initializing controls for vdu_number='1' vdu_model_name='Q27P1B' self.vdu_stable_id='Q27P1B_GNXKCHA123704' 14:04:45 DEBUG: checking for config file '/home/denilson/.config/vdu_controls/Q27P1B_GNXKCHA123704.conf' 14:04:45 DEBUG: checking for config file '/home/denilson/.config/vdu_controls/Q27P1B.conf' 14:04:45 INFO: Using config file '/home/denilson/.config/vdu_controls/Q27P1B.conf' 14:04:45 DEBUG: config: Q27P1B.conf [metadata] version = 1.8.3 14:04:45 DEBUG: config: Q27P1B.conf [metadata] timestamp = 2023-01-11 09:30:00.982106+01:00 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] brightness = yes 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] contrast = yes 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-volume = yes 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-mute = no 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-treble = no 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-bass = no 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-mic-volume = no 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] input-source = no 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] power-mode = no 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] osd-language = no 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] color-temperature = yes 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] enable-vcp-codes = 14 14:04:45 DEBUG: config: Q27P1B.conf [ddcutil-parameters] sleep-multiplier = 0.75 14:04:45 DEBUG: config: Q27P1B.conf [ddcutil-parameters] ddcutil-extra-args = 14:04:45 DEBUG: config: Q27P1B.conf [ddcutil-capabilities] capabilities-override = Model: Q27P1 MCCS version: 2.1 Commands: Op Code: 01 (VCP Request) Op Code: 02 (VCP Response) Op Code: 03 (VCP Set) Op Code: 07 (Timing Request) Op Code: 0C (Save Settings) Op Code: F3 (Capabilities Request) VCP Features: Feature: 02 (New control value) Feature: 04 (Restore factory defaults) Feature: 05 (Restore factory brightness/contrast defaults) Feature: 08 (Restore color defaults) Feature: 10 (Brightness) Feature: 12 (Contrast) Feature: 14 (Select color preset) Values: 01: sRGB 05: 6500 K 06: 7500 K 08: 9300 K 0b: User 1 Feature: 16 (Video gain: Red) Feature: 18 (Video gain: Green) Feature: 1A (Video gain: Blue) Feature: 60 (Input Source) Values: 00: HDMI (read-only) 01: VGA 03: DVI 05: DisplayPort (read-only) 15: DisplayPort (switch to) 17: HDMI (switch to) Feature: 62 (Audio speaker volume) Feature: 6C (Video black level: Red) Feature: 6E (Video black level: Green) Feature: 70 (Video black level: Blue) Feature: C8 (Display controller type) Feature: C9 (Display firmware level) Feature: B0 (Settings) Feature: B6 (Display technology type) Feature: D6 (Power mode) Feature: DF (VCP Version) Feature: F8 (Manufacturer specific feature) 14:04:45 DEBUG: Removed Q27P1B audio-mute - not supported by VDU 14:04:45 DEBUG: Removed Q27P1B audio-treble - not supported by VDU 14:04:45 DEBUG: Removed Q27P1B audio-bass - not supported by VDU 14:04:45 DEBUG: Removed Q27P1B audio-mic-volume - not supported by VDU 14:04:45 DEBUG: Removed Q27P1B osd-language - not supported by VDU 14:04:45 DEBUG: Removed Q27P1B color-temperature - not supported by VDU 14:04:45 INFO: Initializing controls for vdu_number='2' vdu_model_name='Q27P1B' self.vdu_stable_id='Q27P1B_GNXJ7HA015309' 14:04:45 DEBUG: checking for config file '/home/denilson/.config/vdu_controls/Q27P1B_GNXJ7HA015309.conf' 14:04:45 DEBUG: checking for config file '/home/denilson/.config/vdu_controls/Q27P1B.conf' 14:04:45 INFO: Using config file '/home/denilson/.config/vdu_controls/Q27P1B.conf' 14:04:45 DEBUG: config: Q27P1B.conf [metadata] version = 1.8.3 14:04:45 DEBUG: config: Q27P1B.conf [metadata] timestamp = 2023-01-11 09:30:00.982106+01:00 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] brightness = yes 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] contrast = yes 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-volume = yes 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-mute = no 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-treble = no 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-bass = no 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] audio-mic-volume = no 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] input-source = no 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] power-mode = no 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] osd-language = no 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] color-temperature = yes 14:04:45 DEBUG: config: Q27P1B.conf [vdu-controls-widgets] enable-vcp-codes = 14 14:04:45 DEBUG: config: Q27P1B.conf [ddcutil-parameters] sleep-multiplier = 0.75 14:04:45 DEBUG: config: Q27P1B.conf [ddcutil-parameters] ddcutil-extra-args = 14:04:45 DEBUG: config: Q27P1B.conf [ddcutil-capabilities] capabilities-override = Model: Q27P1 MCCS version: 2.1 Commands: Op Code: 01 (VCP Request) Op Code: 02 (VCP Response) Op Code: 03 (VCP Set) Op Code: 07 (Timing Request) Op Code: 0C (Save Settings) Op Code: F3 (Capabilities Request) VCP Features: Feature: 02 (New control value) Feature: 04 (Restore factory defaults) Feature: 05 (Restore factory brightness/contrast defaults) Feature: 08 (Restore color defaults) Feature: 10 (Brightness) Feature: 12 (Contrast) Feature: 14 (Select color preset) Values: 01: sRGB 05: 6500 K 06: 7500 K 08: 9300 K 0b: User 1 Feature: 16 (Video gain: Red) Feature: 18 (Video gain: Green) Feature: 1A (Video gain: Blue) Feature: 60 (Input Source) Values: 00: HDMI (read-only) 01: VGA 03: DVI 05: DisplayPort (read-only) 15: DisplayPort (switch to) 17: HDMI (switch to) Feature: 62 (Audio speaker volume) Feature: 6C (Video black level: Red) Feature: 6E (Video black level: Green) Feature: 70 (Video black level: Blue) Feature: C8 (Display controller type) Feature: C9 (Display firmware level) Feature: B0 (Settings) Feature: B6 (Display technology type) Feature: D6 (Power mode) Feature: DF (VCP Version) Feature: F8 (Manufacturer specific feature) 14:04:45 DEBUG: Removed Q27P1B audio-mute - not supported by VDU 14:04:45 DEBUG: Removed Q27P1B audio-treble - not supported by VDU 14:04:45 DEBUG: Removed Q27P1B audio-bass - not supported by VDU 14:04:45 DEBUG: Removed Q27P1B audio-mic-volume - not supported by VDU 14:04:45 DEBUG: Removed Q27P1B osd-language - not supported by VDU 14:04:45 DEBUG: Removed Q27P1B color-temperature - not supported by VDU 14:04:45 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_A-darkest-0-0.conf' 14:04:45 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_B-darker-0-25.conf' 14:04:45 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_C-dark-0-50.conf' 14:04:45 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_D-medium-dark-25-50.conf' 14:04:45 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_E-medium-bright-50-50.conf' 14:04:45 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_F-bright-75-50.conf' 14:04:45 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_G-brighter-100-50.conf' 14:04:45 INFO: splash_message: 'DDC ID 1\nQ27P1B:GNXKCHA123704' 14:04:45 DEBUG: vcp_value_changed: Q27P1B_GNXKCHA123704 vcp_code='10' 0 origin=EXTERNAL 14:04:45 DEBUG: vcp_value_changed: Q27P1B_GNXKCHA123704 vcp_code='12' 50 origin=EXTERNAL 14:04:45 DEBUG: vcp_value_changed: Q27P1B_GNXKCHA123704 vcp_code='14' 5 origin=EXTERNAL 14:04:45 DEBUG: vcp_value_changed: Q27P1B_GNXKCHA123704 vcp_code='62' 100 origin=EXTERNAL 14:04:45 INFO: splash_message: 'DDC ID 2\nQ27P1B:GNXJ7HA015309' 14:04:45 DEBUG: vcp_value_changed: Q27P1B_GNXJ7HA015309 vcp_code='10' 0 origin=EXTERNAL 14:04:45 DEBUG: vcp_value_changed: Q27P1B_GNXJ7HA015309 vcp_code='12' 50 origin=EXTERNAL 14:04:45 DEBUG: vcp_value_changed: Q27P1B_GNXJ7HA015309 vcp_code='14' 5 origin=EXTERNAL 14:04:45 DEBUG: vcp_value_changed: Q27P1B_GNXJ7HA015309 vcp_code='62' 100 origin=EXTERNAL 14:04:45 INFO: splash_message: 'Checking Presets' 14:04:45 DEBUG: SingletonDialog exists SettingsEditor False 14:04:45 DEBUG: configure: released application_configuration_lock 14:04:45 INFO: Completed configuring application 14:05:02 DEBUG: restore_preset: try to obtain application_configuration_lock 14:05:02 DEBUG: Reading preset file '/home/denilson/.config/vdu_controls/Preset_A-darkest-0-0.conf' 14:05:02 DEBUG: WorkerThread: init PresetTransitionWorker from thread_pid()=1115123 14:05:02 DEBUG: TransitionWorker: init preset.name='A-darkest-0-0' immediately=True scheduled_activity=False 14:05:02 DEBUG: restore_preset: released application_configuration_lock 14:05:02 DEBUG: WorkerThread: class_name='PresetTransitionWorker' running in thread_pid()=1115188 > 14:05:02 DEBUG: vcp_value_changed: Q27P1B_GNXKCHA123704 vcp_code='10' 0 origin=TRANSIENT 14:05:02 DEBUG: respond vdu_stable_id='Q27P1B_GNXKCHA123704' vcp_code='10' value=0 origin.name='TRANSIENT' 14:05:02 DEBUG: vcp_value_changed: Q27P1B_GNXKCHA123704 vcp_code='12' 0 origin=TRANSIENT 14:05:02 DEBUG: respond vdu_stable_id='Q27P1B_GNXKCHA123704' vcp_code='12' value=0 origin.name='TRANSIENT' 14:05:02 DEBUG: vcp_value_changed: Q27P1B_GNXJ7HA015309 vcp_code='10' 0 origin=TRANSIENT 14:05:02 DEBUG: respond vdu_stable_id='Q27P1B_GNXJ7HA015309' vcp_code='10' value=0 origin.name='TRANSIENT' 14:05:02 DEBUG: vcp_value_changed: Q27P1B_GNXJ7HA015309 vcp_code='12' 0 origin=TRANSIENT 14:05:02 INFO: Successfully restored A-darkest-0-0, elapsed time: 0.04 seconds 14:05:02 DEBUG: WorkerThread: class_name='PresetTransitionWorker' terminating thread_pid()=1115188 14:05:02 DEBUG: respond vdu_stable_id='Q27P1B_GNXJ7HA015309' vcp_code='12' value=0 origin.name='TRANSIENT' 14:05:14 INFO: Refresh commences 14:05:14 DEBUG: WorkerThread: init WorkerThread from thread_pid()=1115123 14:05:14 DEBUG: WorkerThread: class_name='WorkerThread' running in thread_pid()=1115193 .update_from_vdu at 0x7fa92871e2a0> 14:05:14 DEBUG: checking possible IDs for display 1 14:05:14 DEBUG: checking possible IDs for display 2 14:05:14 DEBUG: Unique key for vdu_number='1' manufacturer='AOC' is (model_name='Q27P1B' main_id='GNXKCHA123704') 14:05:14 DEBUG: Unique key for vdu_number='2' manufacturer='AOC' is (model_name='Q27P1B' main_id='GNXJ7HA015309') 14:05:14 DEBUG: vcp_value_changed: Q27P1B_GNXKCHA123704 vcp_code='12' 50 origin=EXTERNAL 14:05:14 DEBUG: respond vdu_stable_id='Q27P1B_GNXKCHA123704' vcp_code='12' value=50 origin.name='EXTERNAL' 14:05:14 DEBUG: vcp_value_changed: Q27P1B_GNXJ7HA015309 vcp_code='12' 50 origin=EXTERNAL 14:05:14 DEBUG: WorkerThread: class_name='WorkerThread' terminating thread_pid()=1115193 14:05:14 DEBUG: respond vdu_stable_id='Q27P1B_GNXJ7HA015309' vcp_code='12' value=50 origin.name='EXTERNAL' 14:05:14 DEBUG: Refresh - update UI view ```

If I were to guess, the second command (set contrast) was ignored by the display because it was still processing the brightness command. And, indeed, I can confirm that by creating a couple of presets that ONLY change the contrast. In such case, the contrast is indeed changed correctly.


Proposed fix 1:

Add a hard-coded small delay between sending each command to the same display. In other words, if the preset sets both brightness and contrast:

  1. Send the brightness command simultaneous to both displays.
  2. Wait a small fraction of a second.
  3. Send the contrast command to both displays.

Of course, more steps if the preset sets multiple values for each display.


Proposed fix 2:

(EDIT: I just noticed this may be redundant to "Libddcutil defaults to checking that the value has been set correctly". Still, if the library checks that, how could I refresh the values in the UI and receive back the old value?)

Alternatively, the service could try probing the display to check when the value was updated before sending the next value. Something like this:

  1. Run the following in parallel, for each display:
    1. Send the first value (brightness) to the display.
    2. Try to read back the value.
    3. If the value is not what we expect, wait a tiny fraction of a second and try again.
    4. Now that the read value is the same as what we sent, we can proceed to the next value.
    5. Send the second value (contrast) to the display.
    6. Go back to step 2 and repeat the steps above for each value.
  2. Bonus points: cache the "wait amount" so that the next time we don't have to probe as often.
  3. Double bonus: possibly report back this delay time to this project, so we could have a notion (and maybe a database) of typical delay times across multiple displays. Certainly a lot of work, though.
digitaltrails commented 4 months ago

There's bugs and limitation with enabling/disabling dynamic sleep:

I was wrong about using DdcutilDynamicSleep:

  1. libddcutil 2.0.0 doesn't provide the support needed for DdcutilDynamicSleep property.
  2. the service compilation was not checking the libddcutil capability for this correctly.
  3. when not supported, it should have at least logged a message.

Both your proposals are already implemented in ddcutil/libddcutil

By default ddcutil/libddcutil should verify setvcp (and attempt retries too).

The ddcutil/libddcutil sleep-multiplier exists to alters the delays needed to make i2c work reliably (i2c is not actually that reliable, and neither are some of the GPU drivers and VDU's).

Recent versions of ddcutil/libddcutil use the trys/retries to tune the multiplier and this is cached:

cat $HOME/.cache/ddcutil/dsa
FORMAT 2
* DEV  /dev/i2c device
* EC   EDID check sum byte
* C    current step
* I    interval remaining
* L    current lookback
* DEV EC C I L Values
* Values {tries required, step, epoch seconds}
i2c-0 3d 0 3 5 {1,7,1708367235} {1,7,1708367235} {1,7,1708367235} {1,7,1708367346} {1,7,1708367346} {1,6,1708367346} {1,5,1708367543} {1,4,1708367543} {1,3,1708367543} {1,2,1708367617} {1,1,1708367617} {1,0,1708367617}
i2c-3 9e 0 3 5 {1,7,1708367235} {1,7,1708367235} {1,7,1708367235} {1,7,1708367346} {1,7,1708367346} {1,6,1708367346} {1,5,1708367543} {1,4,1708367543} {1,3,1708367543} {1,2,1708367617} {1,1,1708367617} {1,0,1708367617}

BTW: Nothing happens simultaneously. Internally libddcutil uses locking to prevent overloading the i2c-bus. Plus all D-bus implementations only run one instance of each service, each service has a single event-loop handling only one request at a time. The event-loop also issues the signals, so a signal cannot occur while handling a method-call or property-set/get.

libddcutil 2.0.0 has bugs

Although the proposals are all done, 2.0.0 has bugs that make it more optimistic than it should be.

It's puzzling that libddcutil seems to be verifying the values set, but they aren't actually as set.

Maybe there's a bug in the libddcutil verify. Maybe the monitor sometimes doesn't tell the truth. Maybe there's a bug in vdu_controls and it isn't actually sending the request.

What to do:

Confirm whether it's libddcutil

Running these two commands might approximate what is happening:

busctl --user call com.ddcutil.DdcutilService /com/ddcutil/DdcutilObject com.ddcutil.DdcutilInterface SetVcp isyqu "1" "" "16" "50"  "0"
busctl --user call com.ddcutil.DdcutilService /com/ddcutil/DdcutilObject com.ddcutil.DdcutilInterface SetVcp isyqu "1" "" "18" "50"  "0"

If not maybe this ddcutil-qtdbus-setbc.txt python code might.

Wait-for or download dccutil 2.0.3 and hope it's fixed.

Easy, but maybe the bug will persist.

Try disabling dynamic sleep

You could try to disable dynamic-sleep. For libddcutil 2.0.0 the only way to do this is to create/edit $HOME/.config/ddcutil/ddcutilrc and populate it with:

[libddcutil]
  options : --disable-dynamic-sleep

Then remove $HOME/.cache/ddcutil/dsa. At that point the multipliers set inside vdu_cotnrols should be obeyed by the libddcutil and remain fixed.

Try adding a sleep to ddcutil-service.c

Find the function:

static void set_vcp(GVariant* parameters, GDBusMethodInvocation* invocation) {

and add a sleep(1); to the bottom. This would just be an experiment, we would not roll that out.

Try a newer libddcutil

Alternatively you could download and build the latest ddcutil and see if it works better. I normally build it under my user account, then change ddcutil-service Makefile by uncommenting the development CFLAGS_DDCUTIL, rebuild ddcutil-service, then run it with LD_LIBRARY_PATH:

LD_LIBRARY_PATH=/home/michael/Downloads/ddcutil-2.0.0/src/.libs ./ddcutil-service
Add boilerplate to vdu_controls

I'll look at adding a check that the final value in a preset is actually reached, and perhaps keep looping if it's not (with a sleep, maybe a limit on looping too).

digitaltrails commented 4 months ago

I'm still investigating, something is fishy.

In some circumstances, vdu_controls tests expected values against actual to make sure nothing else is altering the display. I would have thought that might have triggered if the value wasn't set to the expected value. I'm looking through the code.

digitaltrails commented 4 months ago

I'm still investigating, something is fishy.

In some circumstances, vdu_controls tests expected values against actual to make sure nothing else is altering the display. I would have thought that might have triggered if the value wasn't set to the expected value. I'm looking through the code.

I found it impossible to save a preset with a zero contrast. Fixed by 43b2a5e. Not sure it has anything to do with the problem though.

digitaltrails commented 4 months ago

I'm still investigating, something is fishy.

In some circumstances, vdu_controls tests expected values against actual to make sure nothing else is altering the display. I would have thought that might have triggered if the value wasn't set to the expected value. I'm looking through the code.

Ok - verification only occurs when stepping - which only happens for Presets that are set to transition. The examples referenced don't transition.

I've tentatively added a Preset-restore completion check which should emit a message if the Preset doesn't match the final values. But if this a libddcutil or ddcutil-service error, I might remove that check in favour of getting one or both of those fixed.

denilsonsa commented 4 months ago

I tried compiling the latest master code, which is equivalent to 2.1.4. I got these messages:

ddcutil-service-Message: 14:55:54.656: Running /usr/bin/ddcutil-service (ddcutil-service)
ddcutil-service-Message: 14:55:54.658: ddcutil-service 1.0.0, libddcutil 2.1.4
ddcutil-service-Message: 14:55:54.658: ServiceInfoLogging disabled
ddcutil-service-Message: 14:55:54.658: Verifying libddcutil and i2c-dev dependencies (i2c-dev kernel module and device permissions)...
ddcutil-service: ddca_redetect_displays called before ddca_init2() or ddca_init()
ddcutil-service-Message: 14:55:56.512: Detected VDU-count=2 - skipping i2c-dev verification
ddcutil-service-Message: 14:55:56.512: Calling ddca_init 9 2 ''
ddcutil-service-Message: 14:55:56.512: ConnectedDisplaysChanged signals and connectivity monitoring are disabled.
ddcutil-service-Message: 14:55:56.513: Registered /com/ddcutil/DdcutilObject
ddcutil-service-Message: 14:55:56.513: Name acquired com.ddcutil.DdcutilService
ddcutil-service-Message: 14:55:56.513: Emitting ServiceInitialized signal
$ journalctl -f /usr/bin/ddcutil-service
Feb 20 14:55:54 hpelitedesk800g2 ddcutil-service[1265945]: ddca_redetect_displays called before ddca_init2() or ddca_init()
Feb 20 14:55:54 hpelitedesk800g2 libddcutil[1265945]: Initializing libddcutil.  ddcutil version: 2.1.4, shared library: /home/denilson/otherrepos/ddcutil/PREFIX/lib/libddcutil.so.5.1.2
Feb 20 14:55:55 hpelitedesk800g2 libddcutil[1265945]: Library initialization complete.
Feb 20 14:55:55 hpelitedesk800g2 libddcutil[1265945]: Display redetection starting.
Feb 20 14:55:56 hpelitedesk800g2 libddcutil[1265945]: Display redetection finished.
Feb 20 14:55:56 hpelitedesk800g2 libddcutil[1265945]: libddcutil already initialized
Feb 20 14:55:56 hpelitedesk800g2 libddcutil[1265945]: Library initialization failed: DDCRC_INVALID_OPERATION(-3014): invalid operation

And it won't work at all. vdu_controls can't detect any of the displays. I believe it's incompatible with 2.1.4 or 2.1.x. (2.1.0 just crashed, somehow.)

Or maybe I should have recompiled ddcutil-service against the newer library version. (EDIT: Nope, didn't make any difference.)

digitaltrails commented 4 months ago

You also need the latest ddcutil-service code. Sorry should have thought to mention that.

denilsonsa commented 4 months ago

Okay, got some time to try again.

Upon running the newer versions, I see the Dynamic Sleep was enabled:

$ busctl --user get-property com.ddcutil.DdcutilService /com/ddcutil/DdcutilObject com.ddcutil.DdcutilInterface DdcutilDynamicSleep
b true

I can correctly select a preset in VDU Controls and I can observe my left display become dark and then darker, and then the same for my right display. The whole process takes about one second. Thus, I believe the newer ddcutil-related projects are finally working perfectly!

I could add the logs here, but I don't think they will be relevant.


Conclusions (and possible action points):

Thank you for your patience!

digitaltrails commented 4 months ago

Conclusions (and possible action points):

  • The latest versions work great!
  • The not-so-latest versions are buggy.

I believe the bugginess for some VDUs is in libddcutil versions between 2.0.0 - 2.1.2. Plus the 2.1.3 enforces some new requirements on the ordering of calls which I wasn't aware of, hence ddcutil-service 1.0.1 was rushed out.

Versions 1.4.1 seems OK, that's what I use as my daily driver - 1.4.1 is the official package for Manjaro and Tumbleweed. That said, various combos of VDU/GPU could well cause problems with any version (neither developer has huge numbers of VDUs/GPUs to test with).

  • VDU Controls could try detecting the ddcutil-service and the ddcutil/libddcutil versions, and fall back to older logic if they are known buggy versions. Or, at least, issue a warning, asking people to update.

Vdu_controls has an option to disable attempts to use ddcutil-service. I will at least add a note to the Readme, help, or release-notes saying that if things aren't working right, try disabling the service. I don't think any distros are officially using 2.0.0+ of ddcutil/libddcutil, so perhaps a note is all that is required.

  • Politely ask distros to ship the newer versions as the older versions are known to be buggier. (Yeah, I know, it's up to each distro to keep it up.) [Sidenote: maybe all the required packages got updated in Manjaro in the past week(s), I have to do a full system update to double-check.]

As I mentioned earlier, Official Manjaro is on 1.4.1, as is Tumbleweed. I think they're OK for many/most.

Thank you for your patience!

No problem. Thanks for taking the time to provide feedback and work through the issue.

denilsonsa commented 4 months ago

As I mentioned earlier, Official Manjaro is on 1.4.1

Actually, Arch recently updated ddcutil to 2.1.4, and so did Manjaro, despite whatever outdated version shows in their website.

digitaltrails commented 4 months ago

Actually, Arch recently updated ddcutil to 2.1.4, and so did Manjaro, despite whatever outdated version shows in their website.

Oh, OK, that's good (except for the outdated website). Tumbleweed has been stuck on 1.4.1 for some time, someone asked why, but the maintainer never replied. Anyway I don't think anyone is officially using 2.0.0-2.1.2 anymore.