Environment
Hosts
I'm using ddcutil on a Raspbery Pi 4 and a Raspbery Pi Zero WH.
Both of them did not work properly due to the following problems.
#97
However, by using bangom's workarround below, I am able to use it without any problems.
raspberrypi/linux#3152 (comment)
According to the latest comments on the above issue, it looks like this Raspbery Pi issue has just been resolved. Excellent.
Monitor
My monitor is a Philips 328P6VUBREB/11.
https://www.philips.co.jp/c-p/328P6VUBREB_11/brilliance-lcd-monitor-with-usb-c-dock
The monitor has the following four input sources
- HDMI-1
- HDMI-2
- DisplayPort-1
- USB-C
ddcutil
Using the latest commit from the 1.0.0-dev branch as of today.
https://github.com/rockowitz/ddcutil/commits/1.0.0-dev
https://github.com/rockowitz/ddcutil/tree/c2c9d0a3472926c1fc2762d3cdb3d031a6eea079
Problem
I have been using the above environment with almost no problem, but I noticed that each VCP code may or may not work properly.
Example of both getvcp and setvcp working properly 0x62 (Audio speaker volume)
[sat@rp4:~/work/ddcutil]
$ ddcutil getvcp 0x62
VCP code 0x62 (Audio speaker volume ): Fixed (default) level (0x00)
[sat@rp4:~/work/ddcutil]
$ ddcutil setvcp 0x62 0x01
(app_set_vcp_value ) Starting. feature=0x62, new_value=0x01, value_type=VALUE_TYPE_ABSOLUTE, force=false
(app_set_vcp_value ) Done. Returning: NULL
[sat@rp4:~/work/ddcutil]
$ ddcutil getvcp 0x62
VCP code 0x62 (Audio speaker volume ): Volume level: 1 (00x01)
Example of neither getvcp nor setvcp working properly 0x60 (Input Source)
[sat@rp4:~/work/ddcutil]
$ ddcutil getvcp 0x60
VCP code 0x60 (Input Source ): Unsupported feature code (DDC NULL Message)
[sat@rp4:~/work/ddcutil]
$ ddcutil setvcp 0x60 0x12
(app_set_vcp_value ) Starting. feature=0x60, new_value=0x12, value_type=VALUE_TYPE_ABSOLUTE, force=false
Invalid hex value
(app_set_vcp_value ) Done. Returning: Error_Info[DDCRC_ARG in app_set_vcp_value]
Invalid hex value
[sat@rp4:~/work/ddcutil]
$ ddcutil setvcp 0x60 12
(app_set_vcp_value ) Starting. feature=0x60, new_value=12, value_type=VALUE_TYPE_ABSOLUTE, force=false
(app_set_vcp_value ) Done. Returning: NULL
Investigation
VCP version 3.0
I started investigating from the source code about the 0xnn notation not being available when using setvcp. Then I noticed that when using that monitor, it seems to be processed for VCP version 3.0, which is not used very often. In fact, the VCP version obtained by ddcutil detect was 3.0.
[sat@rp4:~/work/ddcutil]
$ ddcutil detect
Display 1
I2C bus: /dev/i2c-1
EDID synopsis:
Mfg id: PHL
Model: PHL 328P6VU
Product code: 2343
Serial number:
Binary serial number: 417 (0x000001a1)
Manufacture year: 2019
EDID version: 1.3
VCP version: 3.0
So I assumed that the monitor was actually running on 2.2 or something like that, and investigated the rest on that assumption.
(supplementary) After I finished the whole investigation, I noticed that the output of ddcutil interrogate seems to be 2.2 in the MCCS version obtained by ddcutil capabilities.
--mccs option
I tried to specify 2.2 with the --mccs option, and the option itself was accepted, but from the source code, it seems to work only with vcpinfo.
[sat@rp4:~/work/ddcutil]
$ ddcutil --mccs 2.2 getvcp 0x60
VCP code 0x60 (Input Source ): Unsupported feature code (DDC NULL Message)
Force change to VCP version 2.2 by hard coding
[sat@rp4:~/work/ddcutil]
$ git diff
diff --git a/src/ddc/ddc_vcp_version.c b/src/ddc/ddc_vcp_version.c
index b9108745..23fba4b5 100644
--- a/src/ddc/ddc_vcp_version.c
+++ b/src/ddc/ddc_vcp_version.c
@@ -49,6 +49,9 @@
* could not be retrieved (pre MCCS v2)
*/
DDCA_MCCS_Version_Spec get_vcp_version_by_display_handle(Display_Handle * dh) {
+ // for debug
+ return DDCA_VSPEC_V22;
+
assert(dh);
bool debug = false;
// TMI
This made getvcp/setvcp 0x60 work as expected.
[sat@rp4:~/work/ddcutil]
$ ddcutil getvcp 0x60
VCP code 0x60 (Input Source ): HDMI-1 (sl=0x11)
[sat@rp4:~/work/ddcutil]
$ ddcutil getvcp 0x60
VCP code 0x60 (Input Source ): HDMI-2 (sl=0x12)
[sat@rp4:~/work/ddcutil]
$ ddcutil getvcp 0x60
VCP code 0x60 (Input Source ): DisplayPort-1 (sl=0x0f)
[sat@rp4:~/work/ddcutil]
$ ddcutil getvcp 0x60
VCP code 0x60 (Input Source ): Invalid value (sl=0x00)
[sat@rp4:~/work/ddcutil]
$ ddcutil setvcp 0x60 0x11
(app_set_vcp_value ) Starting. feature=0x60, new_value=0x11, value_type=VALUE_TYPE_ABSOLUTE, force=false
(app_set_vcp_value ) Done. Returning: NULL
[sat@rp4:~/work/ddcutil]
$ ddcutil setvcp 0x60 0x12
(app_set_vcp_value ) Starting. feature=0x60, new_value=0x12, value_type=VALUE_TYPE_ABSOLUTE, force=false
(app_set_vcp_value ) Done. Returning: NULL
[sat@rp4:~/work/ddcutil]
$ ddcutil setvcp 0x60 0x0f
(app_set_vcp_value ) Starting. feature=0x60, new_value=0x0f, value_type=VALUE_TYPE_ABSOLUTE, force=false
(app_set_vcp_value ) Done. Returning: NULL
[sat@rp4:~/work/ddcutil]
$ ddcutil setvcp 0x60 0x13
(app_set_vcp_value ) Starting. feature=0x60, new_value=0x13, value_type=VALUE_TYPE_ABSOLUTE, force=false
(app_set_vcp_value ) Done. Returning: NULL
(Supplemental) Invalid Value in getvcp 0x60
When USB-C is the input source, getvcp 0x60 returns Invalid value. I haven't been able to track it properly, but it looks like the monitor is actually returning 0x00, so there's nothing I can do about it.
Breakpoint 1, ddc_write_read (dh=0x4cb9d0, request_packet_ptr=0x4cb7e0, read_bytewise=false, max_read_bytes=20, expected_response_type=2 '\002', expected_subtype=96 '`', response_packet_ptr_loc=0xbefff20c) at ddc_packet_io.c:570
570 if (psc >= 0) {
(gdb) x/20bx readbuf
0x4cbea8: 0x6e 0x88 0x02 0x00 0x60 0x00 0x20 0x0e
0x4cbeb0: 0x00 0x00 0xfa 0x28 0x31 0x29 0x61 0x73
0x4cbeb8: 0x73 0x65 0x74 0x5f
Address 0x4cbeb1 in readbuf after ddc_write_read_raw() is set to 0x00.
|
psc = ddc_write_read_raw( |
|
dh, |
|
request_packet_ptr, |
|
read_bytewise, |
|
max_read_bytes, |
|
readbuf, |
|
&bytes_received |
|
); |
Request
It would be nice to be able to force the VCP version to be used for getvcp and setvcp using options such as --mccs.
However, since this seems to be a problem specific to the monitor, and not many users may be affected by it, and since passing --mccs may affect many functions, I don't intend to make such a strong request.
Attachment
Environment
Hosts
I'm using ddcutil on a Raspbery Pi 4 and a Raspbery Pi Zero WH.
Both of them did not work properly due to the following problems.
#97
However, by using bangom's workarround below, I am able to use it without any problems.
raspberrypi/linux#3152 (comment)
According to the latest comments on the above issue, it looks like this Raspbery Pi issue has just been resolved. Excellent.
Monitor
My monitor is a Philips 328P6VUBREB/11.
https://www.philips.co.jp/c-p/328P6VUBREB_11/brilliance-lcd-monitor-with-usb-c-dock
The monitor has the following four input sources
ddcutil
Using the latest commit from the 1.0.0-dev branch as of today.
https://github.com/rockowitz/ddcutil/commits/1.0.0-dev
https://github.com/rockowitz/ddcutil/tree/c2c9d0a3472926c1fc2762d3cdb3d031a6eea079
Problem
I have been using the above environment with almost no problem, but I noticed that each VCP code may or may not work properly.
Example of both getvcp and setvcp working properly 0x62 (Audio speaker volume)
Example of neither getvcp nor setvcp working properly 0x60 (Input Source)
Investigation
VCP version 3.0
I started investigating from the source code about the
0xnnnotation not being available when usingsetvcp. Then I noticed that when using that monitor, it seems to be processed for VCP version 3.0, which is not used very often. In fact, the VCP version obtained byddcutil detectwas 3.0.So I assumed that the monitor was actually running on 2.2 or something like that, and investigated the rest on that assumption.
(supplementary) After I finished the whole investigation, I noticed that the output of
ddcutil interrogateseems to be 2.2 in theMCCS versionobtained byddcutil capabilities.--mccsoptionI tried to specify 2.2 with the
--mccsoption, and the option itself was accepted, but from the source code, it seems to work only withvcpinfo.Force change to VCP version 2.2 by hard coding
This made getvcp/setvcp 0x60 work as expected.
(Supplemental)
Invalid Valueingetvcp 0x60When USB-C is the input source,
getvcp 0x60returnsInvalid value. I haven't been able to track it properly, but it looks like the monitor is actually returning0x00, so there's nothing I can do about it.Address
0x4cbeb1inreadbufafterddc_write_read_raw()is set to0x00.ddcutil/src/ddc/ddc_packet_io.c
Lines 562 to 569 in c2c9d0a
Request
It would be nice to be able to force the VCP version to be used for getvcp and setvcp using options such as
--mccs.However, since this seems to be a problem specific to the monitor, and not many users may be affected by it, and since passing
--mccsmay affect many functions, I don't intend to make such a strong request.Attachment
ddcutil interrogatewith vanilla ddcutilddcutil interrogatewith the patch to force VCP version 2.2 mentioned above.