digitaltrails / vdu_controls

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

TypeError: must be real number, not NoneType #53

Closed Milor123 closed 10 months ago

Milor123 commented 11 months ago

Hi guys, i am trying run this, python3 vdu_controls.py --no-splash --system-tray --show brightness --show contrast but i get this error. what should i do? i have XCFE4 and Python 3.10.10

/vdu_controls$ python3 vdu_controls.py --no-splash --system-tray --show brightness --show contrast
08:26:43 INFO: Python locale ('es_CO', 'UTF-8')
08:26:43 INFO: Looking for config file '/home/noe/.config/vdu_controls/vdu_controls.conf'
08:26:43 INFO: Logging to stdout
08:26:43 INFO: Using system tray.
08:26:43 INFO: Configuring application...
08:26:43 INFO: Use_edid=True (to disable it: export VDU_CONTROLS_USE_EDID=no)
08:26:43 INFO: ddcutil version info: ddcutil 1.2.2 [1, 2, 2]
08:26:43 INFO: Prefer dynamic sleep = False
08:26:46 INFO: Number of detected monitors is stable at 1 (loop=2)
08:26:46 INFO: Initializing controls for vdu_id='1' vdu_model_name='PA248QV' self.vdu_stable_id='PA248QV_M4LMQS006956'
08:26:46 INFO: Splash DDC ID 1
PA248QV:M4LMQS006956
08:26:46 ERROR: 
Traceback (most recent call last):
  File "/home/noe/vdu_controls/vdu_controls.py", line 7622, in <module>
    main()
  File "/home/noe/vdu_controls/vdu_controls.py", line 7451, in main
    main_window = VduAppWindow(main_config, app)
  File "/home/noe/vdu_controls/vdu_controls.py", line 6582, in __init__
    self.configure_application()
  File "/home/noe/vdu_controls/vdu_controls.py", line 6754, in configure_application
    self.create_main_control_panel()
  File "/home/noe/vdu_controls/vdu_controls.py", line 6797, in create_main_control_panel
    self.main_panel.initialise_control_panels(self.app_context_menu, self.main_config, self.vdu_controllers,
  File "/home/noe/vdu_controls/vdu_controls.py", line 3232, in initialise_control_panels
    vdu_control_panel = VduControlPanel(controller, warnings_enabled, self.display_vdu_exception)
  File "/home/noe/vdu_controls/vdu_controls.py", line 2797, in __init__
    self.refresh_data()
  File "/home/noe/vdu_controls/vdu_controls.py", line 2807, in refresh_data
    values = self.controller.get_attributes([control.vcp_capability.vcp_code for control in self.vcp_controls])
  File "/home/noe/vdu_controls/vdu_controls.py", line 1995, in get_attributes
    return self.ddcutil.get_attributes(self.vdu_id, attributes, sleep_multiplier=self.sleep_multiplier)
  File "/home/noe/vdu_controls/vdu_controls.py", line 1417, in get_attributes
    if not math.isclose(sleep_multiplier, 0.0) and not self.prefer_dynamic_sleep:
TypeError: must be real number, not NoneType

thank u very much !!

digitaltrails commented 11 months ago

Thanks for reporting this.

So far, using the very latest trunk master version of vdu_controls.py, I've had no success in reproducing this error. That makes this bug quite interesting.

Have you tried passing a sleep multiplier:

     python3 vdu_controls.py --sleep-multiplier 1.0 --no-splash --system-tray --show brightness

I can definitely see the the error has the potential to occur. I've just checked in a change to handle it. If you download the latest vdu_controls.py, it should get you past this error.

I see you are using ddcutil 1.2.2. I wrote vdu_controls for ddcutil >= 1.3, >= 1.4 recommended. Hopefully that won't cause you any issue, I have never tested with a version that old, but it is likely to be OK.

Normally vdu_controls can be started with no parameters, and the settings dialog can be used to enable/disable features such as controls and sleep multipliers. So you might clean out the config folder and try starting it with no arguments.

I develop on trunk in a attempt to always maintain a stable version that can be used as my daily-driver. However, the released versions are likely to be more stable (they're more widely used for a start). If errors persist, you might also try an officially released version. That said, I'm happy to work with you to resolve this in the trunk version.

I have XFCE desktop I can try (but I don't see XFCE being an issue at this stage).

Milor123 commented 11 months ago

Ohh thank u very much, you have reason, i am in old ddcutil version. I will test, ty very much

digitaltrails commented 11 months ago

I've taken a harder look at the issue and made a few more changes to vdu_controls.py on Trunk.

The error occurred when the code was trying to handle an error from running ddcutil. That's why I couldn't reproduce the problem, I needed to force a ddcutil error.

I've been able to test improvements to how this situation is handled. The crash was caused by an error in a change I made for the future released of ddcutil 2.0. I've cleaned up that code. Thanks for bringing this to my attention.

It looks like ddcutil errored while trying to retrieve brightness and contrast values. So you definitely might hit another problem, but it might not be too serious, it could just be a timing issue and vdu_controls will try up to three times.

It may be that your VDU is a bit slow to respond to ddcutil and needs a sleep-multiplier larger than 1.0 to slow ddcutil down a bit.

Should the error persist, you can also pass --debug to vdu_controls and see what ddcutil commands are being issued. We could then see if we can figure out why specific ddcutil commands are failing.

While tracking this down I found that --sleep-multiplier passed on the command line had stopped working (issue #54). I think no one had noticed because most people configure vdu_controls via the GUI Settings dialog. I've fixed that as well (on trunk).

Milor123 commented 11 months ago

Thank u very much bro. now it shows this error but works

image

after close error, it show this window image

Debug Ouput:

(base) noe@mate-allseries:~/vdu_controls$ python3 vdu_controls.py  --debug
08:39:10 INFO: Python locale ('es_CO', 'UTF-8')
08:39:10 INFO: Looking for config file '/home/noe/.config/vdu_controls/vdu_controls.conf'
08:39:10 INFO: Using config file '/home/noe/.config/vdu_controls/vdu_controls.conf'
08:39:10 INFO: Logging to stdout
08:39:10 DEBUG: config: vdu_controls.conf [metadata] version = 1.11.0
08:39:10 DEBUG: config: vdu_controls.conf [metadata] timestamp = 2023-08-03 08:34:09.306326-05:00
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-globals] system-tray-enabled = no
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-globals] translations-enabled = no
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-globals] prefer-dynamic-sleep-enabled = yes
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-globals] weather-enabled = no
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-globals] schedule-enabled = yes
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-globals] lux-options-enabled = no
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-globals] splash-screen-enabled = yes
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-globals] warnings-enabled = no
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-globals] debug-enabled = yes
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-globals] syslog-enabled = no
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-globals] location = 
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] brightness = yes
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] contrast = yes
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-volume = no
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-mute = no
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-treble = no
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-bass = no
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] audio-mic-volume = no
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] input-source = no
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] power-mode = no
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] osd-language = no
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] color-temperature = yes
08:39:10 DEBUG: config: vdu_controls.conf [vdu-controls-widgets] enable-vcp-codes = 
08:39:10 DEBUG: config: vdu_controls.conf [ddcutil-parameters] sleep-multiplier = 1.0
08:39:10 DEBUG: config: vdu_controls.conf [ddcutil-capabilities] capabilities-override = 
08:39:10 DEBUG: application style is fusion
08:39:10 INFO: Screen DisplayPort-1
08:39:10 INFO: Configuring application...
08:39:10 DEBUG: attempting to lock application_configuration_lock
08:39:10 DEBUG: holding application_configuration_lock
08:39:10 INFO: Use_edid=True (to disable it: export VDU_CONTROLS_USE_EDID=no)
08:39:10 DEBUG: subprocess result: success  [ddcutil --sleep-multiplier 1.00 --version] rc=0 elapsed=0.00 stdout=ddcutil 1.2.2
Built with support for USB connected displays.
Built without function failure simulation.
Built with libdrm services.

Copyright (C) 2015-2021 Sanford Rockowitz
License GPLv2: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

08:39:10 INFO: ddcutil version info: ddcutil 1.2.2 [1, 2, 2]
08:39:10 INFO: Prefer dynamic sleep = False
08:39:10 DEBUG: Detecting connected monitors, looping detection until it stabilises.
08:39:10 DEBUG: subprocess result: success  [ddcutil --sleep-multiplier 1.00 detect --verbose] rc=0 elapsed=0.48 stdout=Display 1
   I2C bus:  /dev/i2c-8
      I2C address 0x50 (EDID) responsive: true 
      Is eDP device:                      false
      Is LVDS device:                     false
      /sys/bus/i2c/devices/i2c-8/name:   AMDGPU DM aux hw bus 1
   EDID synopsis:
      Mfg id:               AUS
      Model:                PA248QV
      Product code:         9216
      Serial number:        M4LMQS006956
      Binary serial number: 16843009 (0x01010101)
      Manufacture year:     2021,  Week: 14
      EDID version:         1.4
      Extra descriptor:        
      Video input definition:    0xa5 - Digital Input (DisplayPort), Bit depth: 8
      Supported features:
         DPMS active-off
         Digital display type: RGB 4:4:4 + YCrCb 4:2:2
         Standard sRGB color space: True
      White x,y:        0.313, 0.329
      Red   x,y:        0.653, 0.338
      Green x,y:        0.308, 0.626
      Blue  x,y:        0.146, 0.054
      Extension blocks: 1
   EDID hex dump:
              +0          +4          +8          +c            0   4   8   c   
      +0000   00 ff ff ff ff ff ff 00 06 b3 00 24 01 01 01 01   ...........$....
      +0010   0e 1f 01 04 a5 34 20 78 3b 6d b5 a7 56 4e a0 25   .....4 x;m..VN.%
      +0020   0d 50 54 bf 6f 00 71 4f 81 80 81 40 81 c0 a9 40   .PT.o.qO...@...@
      +0030   95 00 b3 00 d1 c0 28 3c 80 a0 70 b0 23 40 30 20   ......(<..p.#@0 
      +0040   36 00 06 44 21 00 00 1a 00 00 00 fd 00 31 4b 5f   6..D!........1K_
      +0050   5f 19 01 0a 20 20 20 20 20 20 00 00 00 fc 00 50   _...      .....P
      +0060   41 32 34 38 51 56 0a 20 20 20 20 20 00 00 00 ff   A248QV.     ....
      +0070   00 4d 34 4c 4d 51 53 30 30 36 39 35 36 0a 01 06   .M4LMQS006956...
   VCP version:         2.1
   Controller mfg:      RealTek
   Firmware version:    0.1
   Monitor returns DDC Null Response for unsupported features: false

08:39:10 DEBUG: checking possible ID's for display 1
08:39:10 DEBUG: edid='00ffffffffffff0006b30024010101010e1f0104a53420783b6db5a7564ea0250d5054bf6f00714f8180814081c0a9409500b300d1c0283c80a070b023403020360006442100001a000000fd00314b5f5f19010a202020202020000000fc00504132343851560a2020202020000000ff004d344c4d51533030363935360a0106'
08:39:10 DEBUG: Unique key for vdu_id='1' manufacturer='AUS' is (model_name='PA248QV' main_id='M4LMQS006956')
08:39:12 DEBUG: subprocess result: success  [ddcutil --sleep-multiplier 1.00 detect --verbose] rc=0 elapsed=0.48 stdout=Display 1
   I2C bus:  /dev/i2c-8
      I2C address 0x50 (EDID) responsive: true 
      Is eDP device:                      false
      Is LVDS device:                     false
      /sys/bus/i2c/devices/i2c-8/name:   AMDGPU DM aux hw bus 1
   EDID synopsis:
      Mfg id:               AUS
      Model:                PA248QV
      Product code:         9216
      Serial number:        M4LMQS006956
      Binary serial number: 16843009 (0x01010101)
      Manufacture year:     2021,  Week: 14
      EDID version:         1.4
      Extra descriptor:        
      Video input definition:    0xa5 - Digital Input (DisplayPort), Bit depth: 8
      Supported features:
         DPMS active-off
         Digital display type: RGB 4:4:4 + YCrCb 4:2:2
         Standard sRGB color space: True
      White x,y:        0.313, 0.329
      Red   x,y:        0.653, 0.338
      Green x,y:        0.308, 0.626
      Blue  x,y:        0.146, 0.054
      Extension blocks: 1
   EDID hex dump:
              +0          +4          +8          +c            0   4   8   c   
      +0000   00 ff ff ff ff ff ff 00 06 b3 00 24 01 01 01 01   ...........$....
      +0010   0e 1f 01 04 a5 34 20 78 3b 6d b5 a7 56 4e a0 25   .....4 x;m..VN.%
      +0020   0d 50 54 bf 6f 00 71 4f 81 80 81 40 81 c0 a9 40   .PT.o.qO...@...@
      +0030   95 00 b3 00 d1 c0 28 3c 80 a0 70 b0 23 40 30 20   ......(<..p.#@0 
      +0040   36 00 06 44 21 00 00 1a 00 00 00 fd 00 31 4b 5f   6..D!........1K_
      +0050   5f 19 01 0a 20 20 20 20 20 20 00 00 00 fc 00 50   _...      .....P
      +0060   41 32 34 38 51 56 0a 20 20 20 20 20 00 00 00 ff   A248QV.     ....
      +0070   00 4d 34 4c 4d 51 53 30 30 36 39 35 36 0a 01 06   .M4LMQS006956...
   VCP version:         2.1
   Controller mfg:      RealTek
   Firmware version:    0.1
   Monitor returns DDC Null Response for unsupported features: false

08:39:12 DEBUG: checking possible ID's for display 1
08:39:12 DEBUG: edid='00ffffffffffff0006b30024010101010e1f0104a53420783b6db5a7564ea0250d5054bf6f00714f8180814081c0a9409500b300d1c0283c80a070b023403020360006442100001a000000fd00314b5f5f19010a202020202020000000fc00504132343851560a2020202020000000ff004d344c4d51533030363935360a0106'
08:39:12 DEBUG: Unique key for vdu_id='1' manufacturer='AUS' is (model_name='PA248QV' main_id='M4LMQS006956')
08:39:12 INFO: Number of detected monitors is stable at 1 (loop=2)
08:39:12 INFO: Initializing controls for vdu_id='1' vdu_model_name='PA248QV' self.vdu_stable_id='PA248QV_M4LMQS006956'
08:39:12 DEBUG: checking for config file '/home/noe/.config/vdu_controls/PA248QV_M4LMQS006956.conf'
08:39:12 DEBUG: checking for config file '/home/noe/.config/vdu_controls/PA248QV.conf'
08:39:12 DEBUG: subprocess result: success Display-1 [ddcutil --sleep-multiplier 1.00 capabilities --edid 00ffffffffffff0006b30024010101...] rc=0 elapsed=0.33 stdout=Model: PA248QV
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: E3 (Capabilities Reply)
   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:
         04: 5000 K
         05: 6500 K
         08: 9300 K
         0b: User 1
   Feature: 16 (Video gain: Red)
   Feature: 18 (Video gain: Green)
   Feature: 1A (Video gain: Blue)
   Feature: 52 (Active control)
   Feature: 60 (Input Source)
      Values:
         01: VGA-1
         11: HDMI-1
         0f: DisplayPort-1
   Feature: 62 (Audio speaker volume)
   Feature: AC (Horizontal frequency)
   Feature: AE (Vertical frequency)
   Feature: B6 (Display technology type)
   Feature: C0 (Display usage time)
   Feature: C6 (Application enable key)
   Feature: C8 (Display controller type)
   Feature: C9 (Display firmware level)
   Feature: CC (OSD Language)
      Values:
         01: Chinese (traditional, Hantai)
         02: English
         03: French
         04: German
         05: Italian
         06: Japanese
         07: Korean
         08: Portuguese (Portugal)
         09: Russian
         0a: Spanish
         0c: Turkish
         0d: Chinese (simplified / Kantai)
         11: Croatian
         12: Czech
         14: Dutch
         1a: Hungarian
         1e: Polish
         1f: Romanian 
         23: Thai
   Feature: D6 (Power mode)
      Values:
         01: DPM: On,  DPMS: Off
         04: DPM: Off, DPMS: Off
         05: Write only value to turn off display
   Feature: DC (Display Mode)
      Values:
         00: Standard/Default mode
         0b: Unrecognized value
         0d: Unrecognized value
         0e: Unrecognized value
         0f: Unrecognized value
         17: Unrecognized value
         18: Unrecognized value
         21: Unrecognized value
         22: Unrecognized value
   Feature: DF (VCP Version)

08:39:12 INFO: Splash DDC ID 1
PA248QV:M4LMQS006956
08:39:13 DEBUG: subprocess result: error  Display-1 ddcutil --sleep-multiplier 1.00 --brief getvcp 10 12 --edid 00ffffffffffff0006b30024010101... stderr='Too many arguments
', exception=Command '['ddcutil', '--sleep-multiplier', '1.00', '--brief', 'getvcp', '10', '12', '--edid', '00ffffffffffff0006b30024010101010e1f0104a53420783b6db5a7564ea0250d5054bf6f00714f8180814081c0a9409500b300d1c0283c80a070b023403020360006442100001a000000fd00314b5f5f19010a202020202020000000fc00504132343851560a2020202020000000ff004d344c4d51533030363935360a0106']' returned non-zero exit status 1.
08:39:13 DEBUG: TRACEBACK:   File "/home/noe/vdu_controls/vdu_controls.py", line 7631, in <module>
    main()
  File "/home/noe/vdu_controls/vdu_controls.py", line 7460, in main
    main_window = VduAppWindow(main_config, app)
  File "/home/noe/vdu_controls/vdu_controls.py", line 6591, in __init__
    self.configure_application()
  File "/home/noe/vdu_controls/vdu_controls.py", line 6763, in configure_application
    self.create_main_control_panel()
  File "/home/noe/vdu_controls/vdu_controls.py", line 6806, in create_main_control_panel
    self.main_panel.initialise_control_panels(self.app_context_menu, self.main_config, self.vdu_controllers,
  File "/home/noe/vdu_controls/vdu_controls.py", line 3241, in initialise_control_panels
    vdu_control_panel = VduControlPanel(controller, warnings_enabled, self.display_vdu_exception)
  File "/home/noe/vdu_controls/vdu_controls.py", line 2806, in __init__
    self.refresh_data()
  File "/home/noe/vdu_controls/vdu_controls.py", line 2816, in refresh_data
    values = self.controller.get_attributes([control.vcp_capability.vcp_code for control in self.vcp_controls])
  File "/home/noe/vdu_controls/vdu_controls.py", line 2000, in get_attributes
    return self.ddcutil.get_attributes(self.vdu_id, attributes, sleep_multiplier=self.sleep_multiplier)
  File "/home/noe/vdu_controls/vdu_controls.py", line 1393, in get_attributes
    from_ddcutil = self.__run__(*args, sleep_multiplier=sleep_multiplier, log_id=vdu_id)
  File "/home/noe/vdu_controls/vdu_controls.py", line 1254, in __run__
    log_debug("subprocess result: error ", log_id, self.format_args_diagnostic(process_args),
  File "/home/noe/vdu_controls/vdu_controls.py", line 1145, in log_debug
    log_wrapper(syslog.LOG_DEBUG, *args, trace=trace)
  File "/home/noe/vdu_controls/vdu_controls.py", line 1140, in log_wrapper
    log_debug("TRACEBACK:", ''.join(traceback.format_stack()))

08:39:15 DEBUG: subprocess result: error  Display-1 ddcutil --sleep-multiplier 1.00 --brief getvcp 10 12 --edid 00ffffffffffff0006b30024010101... stderr='Too many arguments
', exception=Command '['ddcutil', '--sleep-multiplier', '1.00', '--brief', 'getvcp', '10', '12', '--edid', '00ffffffffffff0006b30024010101010e1f0104a53420783b6db5a7564ea0250d5054bf6f00714f8180814081c0a9409500b300d1c0283c80a070b023403020360006442100001a000000fd00314b5f5f19010a202020202020000000fc00504132343851560a2020202020000000ff004d344c4d51533030363935360a0106']' returned non-zero exit status 1.
08:39:15 DEBUG: TRACEBACK:   File "/home/noe/vdu_controls/vdu_controls.py", line 7631, in <module>
    main()
  File "/home/noe/vdu_controls/vdu_controls.py", line 7460, in main
    main_window = VduAppWindow(main_config, app)
  File "/home/noe/vdu_controls/vdu_controls.py", line 6591, in __init__
    self.configure_application()
  File "/home/noe/vdu_controls/vdu_controls.py", line 6763, in configure_application
    self.create_main_control_panel()
  File "/home/noe/vdu_controls/vdu_controls.py", line 6806, in create_main_control_panel
    self.main_panel.initialise_control_panels(self.app_context_menu, self.main_config, self.vdu_controllers,
  File "/home/noe/vdu_controls/vdu_controls.py", line 3241, in initialise_control_panels
    vdu_control_panel = VduControlPanel(controller, warnings_enabled, self.display_vdu_exception)
  File "/home/noe/vdu_controls/vdu_controls.py", line 2806, in __init__
    self.refresh_data()
  File "/home/noe/vdu_controls/vdu_controls.py", line 2816, in refresh_data
    values = self.controller.get_attributes([control.vcp_capability.vcp_code for control in self.vcp_controls])
  File "/home/noe/vdu_controls/vdu_controls.py", line 2000, in get_attributes
    return self.ddcutil.get_attributes(self.vdu_id, attributes, sleep_multiplier=self.sleep_multiplier)
  File "/home/noe/vdu_controls/vdu_controls.py", line 1393, in get_attributes
    from_ddcutil = self.__run__(*args, sleep_multiplier=sleep_multiplier, log_id=vdu_id)
  File "/home/noe/vdu_controls/vdu_controls.py", line 1254, in __run__
    log_debug("subprocess result: error ", log_id, self.format_args_diagnostic(process_args),
  File "/home/noe/vdu_controls/vdu_controls.py", line 1145, in log_debug
    log_wrapper(syslog.LOG_DEBUG, *args, trace=trace)
  File "/home/noe/vdu_controls/vdu_controls.py", line 1140, in log_wrapper
    log_debug("TRACEBACK:", ''.join(traceback.format_stack()))

08:39:17 DEBUG: subprocess result: error  Display-1 ddcutil --sleep-multiplier 1.00 --brief getvcp 10 12 --edid 00ffffffffffff0006b30024010101... stderr='Too many arguments
', exception=Command '['ddcutil', '--sleep-multiplier', '1.00', '--brief', 'getvcp', '10', '12', '--edid', '00ffffffffffff0006b30024010101010e1f0104a53420783b6db5a7564ea0250d5054bf6f00714f8180814081c0a9409500b300d1c0283c80a070b023403020360006442100001a000000fd00314b5f5f19010a202020202020000000fc00504132343851560a2020202020000000ff004d344c4d51533030363935360a0106']' returned non-zero exit status 1.
08:39:17 DEBUG: TRACEBACK:   File "/home/noe/vdu_controls/vdu_controls.py", line 7631, in <module>
    main()
  File "/home/noe/vdu_controls/vdu_controls.py", line 7460, in main
    main_window = VduAppWindow(main_config, app)
  File "/home/noe/vdu_controls/vdu_controls.py", line 6591, in __init__
    self.configure_application()
  File "/home/noe/vdu_controls/vdu_controls.py", line 6763, in configure_application
    self.create_main_control_panel()
  File "/home/noe/vdu_controls/vdu_controls.py", line 6806, in create_main_control_panel
    self.main_panel.initialise_control_panels(self.app_context_menu, self.main_config, self.vdu_controllers,
  File "/home/noe/vdu_controls/vdu_controls.py", line 3241, in initialise_control_panels
    vdu_control_panel = VduControlPanel(controller, warnings_enabled, self.display_vdu_exception)
  File "/home/noe/vdu_controls/vdu_controls.py", line 2806, in __init__
    self.refresh_data()
  File "/home/noe/vdu_controls/vdu_controls.py", line 2816, in refresh_data
    values = self.controller.get_attributes([control.vcp_capability.vcp_code for control in self.vcp_controls])
  File "/home/noe/vdu_controls/vdu_controls.py", line 2000, in get_attributes
    return self.ddcutil.get_attributes(self.vdu_id, attributes, sleep_multiplier=self.sleep_multiplier)
  File "/home/noe/vdu_controls/vdu_controls.py", line 1393, in get_attributes
    from_ddcutil = self.__run__(*args, sleep_multiplier=sleep_multiplier, log_id=vdu_id)
  File "/home/noe/vdu_controls/vdu_controls.py", line 1254, in __run__
    log_debug("subprocess result: error ", log_id, self.format_args_diagnostic(process_args),
  File "/home/noe/vdu_controls/vdu_controls.py", line 1145, in log_debug
    log_wrapper(syslog.LOG_DEBUG, *args, trace=trace)
  File "/home/noe/vdu_controls/vdu_controls.py", line 1140, in log_wrapper
    log_debug("TRACEBACK:", ''.join(traceback.format_stack()))

08:39:17 ERROR: PA248QV:M4LMQS006956 get_attributes 10,12 Command '['ddcutil', '--sleep-multiplier', '1.00', '--brief', 'getvcp', '10', '12', '--edid', '00ffffffffffff0006b30024010101010e1f0104a53420783b6db5a7564ea0250d5054bf6f00714f8180814081c0a9409500b300d1c0283c80a070b023403020360006442100001a000000fd00314b5f5f19010a202020202020000000fc00504132343851560a2020202020000000ff004d344c4d51533030363935360a0106']' returned non-zero exit status 1.

And works very nice

Milor123 commented 11 months ago

Question bro, do you know how can get something that allow me change color spaces of monitor in linux?, in windows i have a program, the Asus chroma tune, but it dont work in linux, neither in wine, i would like use can use something similar than it.

image Its only is avaible for windows :/

digitaltrails commented 11 months ago

Thank u very much bro. now it shows this error but works

At some point in the past I broke compatibility with ddcutil versions earlier than 1.2. I did ask in the readme for anyone interested in using earlier version to contact me, but no one did (until yesterday).

In earlier versions of ddcutil the getvcp command only supports one vcp-code argument. Later versions support requesting multiple arguments, this speeds getting values from the monitor.

I've checked in a new vdu_controls.py that checks for ddcutil version < 1.3 and behaves appropriately. It falls back to making multiple calls to ddcutil getvcp passing one code each time.

I don't have ddcutil 1.2 to test with, but I think it should work now.

digitaltrails commented 11 months ago

Question bro, do you know how can get something that allow me change color spaces of monitor in linux?, in windows i have a program, the Asus chroma tune, but it dont work in linux, neither in wine, i would like use can use something similar than it.

I think you'd need to search out color management in Linux. However, if you already have the monitor configured, it the nine listed modes in Chroma Tune might correspond to the nine listed modes listed by ddcutil capabilities for the Feature: DC (Display Mode):

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: E3 (Capabilities Reply)
   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:
         04: 5000 K
         05: 6500 K
         08: 9300 K
         0b: User 1
   Feature: 16 (Video gain: Red)
   Feature: 18 (Video gain: Green)
   Feature: 1A (Video gain: Blue)
   Feature: 52 (Active control)
   Feature: 60 (Input Source)
      Values:
         01: VGA-1
         11: HDMI-1
         0f: DisplayPort-1
   Feature: 62 (Audio speaker volume)
   Feature: AC (Horizontal frequency)
   Feature: AE (Vertical frequency)
   Feature: B6 (Display technology type)
   Feature: C0 (Display usage time)
   Feature: C6 (Application enable key)
   Feature: C8 (Display controller type)
   Feature: C9 (Display firmware level)
   Feature: CC (OSD Language)
      Values:
         01: Chinese (traditional, Hantai)
         02: English
         03: French
         04: German
         05: Italian
         06: Japanese
         07: Korean
         08: Portuguese (Portugal)
         09: Russian
         0a: Spanish
         0c: Turkish
         0d: Chinese (simplified / Kantai)
         11: Croatian
         12: Czech
         14: Dutch
         1a: Hungarian
         1e: Polish
         1f: Romanian 
         23: Thai
   Feature: D6 (Power mode)
      Values:
         01: DPM: On,  DPMS: Off
         04: DPM: Off, DPMS: Off
         05: Write only value to turn off display
   Feature: DC (Display Mode)
      Values:
         00: Standard/Default mode
         0b: Unrecognized value
         0d: Unrecognized value
         0e: Unrecognized value
         0f: Unrecognized value
         17: Unrecognized value
         18: Unrecognized value
         21: Unrecognized value
         22: Unrecognized value
   Feature: DF (VCP Version)

Although DC isn't out-of-the box enabled in vdu_controls, it can be enabled via the Settings Dialog. My LG monitor has a similar feature, feature 15, which I've manually enabled in Settings->enable vcp code (which is a CSV list):

image

Note: You have to be comfortable with enabling this feature, it seems harmless enough. But I read that someone bricked a monitor by trying to find out what every feature did.

So you would enable vcp-code DC and save settings, at which point it should appear as a control on the main panel.

Once enabled, all but one option will show as Unrecognized value. I had the same problem with my LG. But I tired each one and matched it to what was listed in the monitors own menu, then I edited the text in Settings->capabilities override and replaced Unrecognized value with a description of each. (Capability editing can be done directly in the GUI or using an editor on the saved file)

Milor123 commented 11 months ago

Thank u very much bro. I will be test it ! Love u!!!

digitaltrails commented 11 months ago

Depending on when you pulled from trunk, you may encounter the a first-run issue and Settings-Dialog missing options The latest trunk has have addressed those. (I've been trying to unify/simply code for command-line anc settings-file parsing, that introduced a few bugs.)

Milor123 commented 11 months ago

Only works the firts color space, the anothers dont work. image

By the way, I had forgotten to tell you, since some of the updates you made, the program is working perfectly for me. It now opens without any errors. Thank you so much for all the effort you put into helping us!!

image

My monitor is connecting to my GPU and they have a USB connection too.

digitaltrails commented 11 months ago

Only works the first color space, the anothers dont work.

I suspect that 18, 18, and 22 might work. I think the hex is causing issues.

Using ddcutil directly, I think this might work:

% ddcutil --display 1 setvcp DC x0e

Some background: ddcutil expects CNC-attributes (Complex Non-Continuous attributes) to be passed with x as a hex prefix (so passed as x0e) and SNC-attributes (Simple Non-Continuous) to be passed without an x (passed as 0e). So vdu_controls has to figure out which format to use with each attribute, and maybe it's getting it wrong for this case.

Vdu_controls will figure out the format based on what is output for:

% ddcutil --display 1 --brief getvcp DC

So could you please post the output from the above getvcp.

I suspect we're dealing with some kind of special case, where the output is not giving the right hints or vdu_controls isn't parsing it right. It may also be a bug with the changes I made for ddcutil 1.2.

I may also raise this as an issue with ddcutil. It's a bit of pain to have to pass hex in two different ways. It's caused problems before.

digitaltrails commented 11 months ago

If the output from:

% ddcutil --display 1 --brief getvcp DC

contains the letters SNC, please download and try the very latest vdu_controls.

After some experiments with ddcutil I've made a change (a4c95e8) that unifies the formatting of SNC/CNC values passed to ddcutil. I think I had previously misinterpreted what was allowed to be passed.

digitaltrails commented 11 months ago

Thank you so much for all the effort you put into helping us!!

I've made quite a lot of changes in preparation for ddcutil 2.0. It's been quite helpful to receive some feedback on the latest code. Thanks for taking the time to give some feedback.

Milor123 commented 11 months ago

Ohh thank u very much brooo! Now it works, dont have name but works

I have now the same states that in windows.

a great idea could be configure it like in Asus chroma tune, there i can change the color space according to the program.

For example: Photoshop -> set standard color space and while change the window for see my Firefox -> it change the color space for other more relaxing for my eyes.

But I love the idea of simply custom shorcuts, Could help to configure it with shorcuts in my keys? for example

Uffff bro a favour more!!! Please could help me to do custom shorcuts for Brightness and Blue filter or Temperature. Actualy i have a kde plugin for plasma but only have shorcut for brightness and work so so.

in windows for example I use autohotkey for use:

image

Thank u very much for all bro !!!!

PD: my output for ddcutil --display 1 --brief getvcp DC is: VCP DC SNC x0d

digitaltrails commented 11 months ago
  • How can i set a name for each color space?

You can edit the Unrecognised values values in the capabilities override text-area - see below. (That's why it's called override, it overrides the ddcutil supplied definitions).

If you prefer, you can also use an editor (vi/emacs/kate) and edit the config file in the config folder: ~/.config/vdu_controls/PA248*.conf

image

  • I would like have it in a customizable key shortcut

Yes, that would be nice, but I've struck a problem with that, see https://github.com/digitaltrails/vdu_controls/issues/13#issuecomment-1208689352

So the bottom line is: I can't figure out how to get shortcuts to work on any of the desktops via the Qt library. One issue is shortcuts when focused in vdu_controls. The other issue is global desktop shortcuts that work even when vdu_controls is minimised in the taskbar - I suspect this isn't possible (at least not in a portable desktop-neutral way).

change the color space according to the program

I suspect that would be hard to achieve, I don't think there is a mechanism to hook into the desktop to do that.

KDE does allow each application to have Configured special application settings (right-mouse in the title bar). If you could get that to run a script, you could have it run ddcutil.

Vdu_controls is written to be portable across KDE/gnome/deepin/xfce. It tends to be confined to what's offered in the Linux desktop standard the https://www.freedesktop.org/wiki/.

digitaltrails commented 11 months ago

I've done further research on keyboard shortcuts. Please see latest comments in #13 and add any related thoughts.

Milor123 commented 9 months ago

I've done further research on keyboard shortcuts. Please see latest comments in #13 and add any related thoughts.

Ohhhh greeat!! Thank u very much dude !! I will update it.