rockowitz / ddcutil

Control monitor settings using DDC/CI and USB
http://www.ddcutil.com
GNU General Public License v2.0
944 stars 38 forks source link

AOC Q27P1B input source values #385

Open denilsonsa opened 6 months ago

denilsonsa commented 6 months ago

I'm giving some feedback regarding the AOC Q27P1B monitor. It has four video inputs:

Unfortunately, its implementation of the VCP 0x60 is… well… unique. And it probably behaves similarly to other AOC displays.

It claims to support:

Feature: 60 (Input Source)
   Values:
      01: VGA-1
      03: DVI-1
Full output of capabilities ```console $ ddcutil capabilities 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: 01: VGA-1 03: DVI-1 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) ```

But obviously it supports more values for VCP 0x60.

I also know this monitor is not yet added to any DDC database, because I get the Feature definition file not found: AOC-Q27P1B-9985.mccs message.

Limitations from my tests

I don't have any Windows system nor any way to sniff the I2C packets from a Windows system, so I cannot reverse-engineer it.

I don't have enough machines to feed both HDMI and DVI simultaneously to the display.

Given this is based on trial-and-error, there may be a few mistakes.

My findings

Here are my findings, based on trial-and-error:

To help me quickly test, I'm using this one-liner:

while read v ; do [ -n "$v" ] && ddcutil -v -d 1 setvcp 60 "$v" ; ddcutil -v -d 1 getvcp 60 ; done

Here's the full output log:

Full console output ```console $ # All lines containing "Feature definition file not found: AOC-Q27P1B-9985.mccs" are ommitted. $ ddcutil -v -d 1 setvcp 60 1 # Switching to VGA. Feature 0x60 does not support verification $ ddcutil -v -d 1 getvcp 60 # Cannot read the value back until the display has finished switching. Getting data for non-table VCP code 0x60 - Input Source: VCP code 0x60 (Input Source ): Maximum retries exceeded $ sleep 8 $ ddcutil -v -d 1 getvcp 60 # The value is available after finished switching to VGA. Getting data for non-table VCP code 0x60 - Input Source: Raw value: opcode=0x60, mh=0x00, ml=0x04, sh=0x00, sl=0x01, max_val=4 (0x0004), cur_val=1 (0x0001) VCP code 0x60 (Input Source ): VGA-1 (sl=0x01) $ sleep 8 $ ddcutil -v -d 1 setvcp 60 15 # Switching back to DP before the next test. Feature 0x60 does not support verification $ ddcutil -v -d 1 getvcp 60 # DP always reads back as 0x0305. Getting data for non-table VCP code 0x60 - Input Source: Raw value: opcode=0x60, mh=0x00, ml=0x04, sh=0x03, sl=0x05, max_val=4 (0x0004), cur_val=773 (0x0305) VCP code 0x60 (Input Source ): Composite video 1 (sl=0x05) $ sleep 8 $ ddcutil -v -d 1 getvcp 60 # DP always reads back as 0x0305. Getting data for non-table VCP code 0x60 - Input Source: Raw value: opcode=0x60, mh=0x00, ml=0x04, sh=0x03, sl=0x05, max_val=4 (0x0004), cur_val=773 (0x0305) VCP code 0x60 (Input Source ): Composite video 1 (sl=0x05) $ sleep 8 $ ddcutil -v -d 1 setvcp 60 2 # Switching to the (non-existent) second VGA. Feature 0x60 does not support verification $ ddcutil -v -d 1 getvcp 60 # Cannot read the value back until the display has finished switching. Getting data for non-table VCP code 0x60 - Input Source: VCP code 0x60 (Input Source ): Maximum retries exceeded $ sleep 8 $ ddcutil -v -d 1 getvcp 60 # The value of the first VGA is read back. Getting data for non-table VCP code 0x60 - Input Source: Raw value: opcode=0x60, mh=0x00, ml=0x04, sh=0x00, sl=0x01, max_val=4 (0x0004), cur_val=1 (0x0001) VCP code 0x60 (Input Source ): VGA-1 (sl=0x01) $ sleep 8 $ ddcutil -v -d 1 setvcp 60 3 # Switching to DVI. Feature 0x60 does not support verification $ ddcutil -v -d 1 getvcp 60 # Reads back as 0x302 while switching. Getting data for non-table VCP code 0x60 - Input Source: Raw value: opcode=0x60, mh=0x00, ml=0x04, sh=0x03, sl=0x02, max_val=4 (0x0004), cur_val=770 (0x0302) VCP code 0x60 (Input Source ): VGA-2 (sl=0x02) $ sleep 8 $ ddcutil -v -d 1 getvcp 60 # Reads back as 0x300 after finished switching. Getting data for non-table VCP code 0x60 - Input Source: Raw value: opcode=0x60, mh=0x00, ml=0x04, sh=0x03, sl=0x00, max_val=4 (0x0004), cur_val=768 (0x0300) VCP code 0x60 (Input Source ): Invalid value (sl=0x00) $ sleep 8 $ ddcutil -v -d 1 setvcp 60 1 # Switching back to VGA before the next test. Feature 0x60 does not support verification $ ddcutil -v -d 1 getvcp 60 # Somehow, this time it swtiched quickly enough. Getting data for non-table VCP code 0x60 - Input Source: Raw value: opcode=0x60, mh=0x00, ml=0x04, sh=0x00, sl=0x01, max_val=4 (0x0004), cur_val=1 (0x0001) VCP code 0x60 (Input Source ): VGA-1 (sl=0x01) $ sleep 8 $ ddcutil -v -d 1 setvcp 60 4 # Switching to DVI. Feature 0x60 does not support verification $ ddcutil -v -d 1 getvcp 60 # Reads back as 0x302 while switching. Getting data for non-table VCP code 0x60 - Input Source: Raw value: opcode=0x60, mh=0x00, ml=0x04, sh=0x03, sl=0x02, max_val=4 (0x0004), cur_val=770 (0x0302) VCP code 0x60 (Input Source ): VGA-2 (sl=0x02) $ sleep 8 $ ddcutil -v -d 1 getvcp 60 # Reads back as 0x300 after finished switching. Getting data for non-table VCP code 0x60 - Input Source: Raw value: opcode=0x60, mh=0x00, ml=0x04, sh=0x03, sl=0x00, max_val=4 (0x0004), cur_val=768 (0x0300) VCP code 0x60 (Input Source ): Invalid value (sl=0x00) $ sleep 8 $ ddcutil -v -d 1 setvcp 60 x0f # Switching to DP Feature 0x60 does not support verification $ ddcutil -v -d 1 getvcp 60 # DP always reads back as 0x0305. Getting data for non-table VCP code 0x60 - Input Source: Raw value: opcode=0x60, mh=0x00, ml=0x04, sh=0x03, sl=0x05, max_val=4 (0x0004), cur_val=773 (0x0305) VCP code 0x60 (Input Source ): Composite video 1 (sl=0x05) $ sleep 8 $ ddcutil -v -d 1 getvcp 60 # DP always reads back as 0x0305. Getting data for non-table VCP code 0x60 - Input Source: Raw value: opcode=0x60, mh=0x00, ml=0x04, sh=0x03, sl=0x05, max_val=4 (0x0004), cur_val=773 (0x0305) VCP code 0x60 (Input Source ): Composite video 1 (sl=0x05) $ sleep 8 $ ddcutil -v -d 1 setvcp 60 x11 # Switching to HDMI Feature 0x60 does not support verification $ ddcutil -v -d 1 getvcp 60 # Reads back as 0x302 while switching. Getting data for non-table VCP code 0x60 - Input Source: Raw value: opcode=0x60, mh=0x00, ml=0x04, sh=0x03, sl=0x02, max_val=4 (0x0004), cur_val=770 (0x0302) VCP code 0x60 (Input Source ): VGA-2 (sl=0x02) $ sleep 8 $ ddcutil -v -d 1 getvcp 60 # Reads back as 0x300 after finished switching. Getting data for non-table VCP code 0x60 - Input Source: Raw value: opcode=0x60, mh=0x00, ml=0x04, sh=0x03, sl=0x00, max_val=4 (0x0004), cur_val=768 (0x0300) VCP code 0x60 (Input Source ): Invalid value (sl=0x00) $ sleep 8 ```

System

Action points

Can this kind of info be added to some database somewhere?

Do you need any additional information?

See also

rockowitz commented 6 months ago

There is no central database of monitor feature definitions. Given the huge and expanding range of monitors, creating and maintaining one would be a hopeless task. The message "Feature definition file not found: AOC-Q27P1B-9985.mccs" indicates that you have not created a local feature definition file for the monitor. See User Defined Features.

I suggest that you add your findings to the wiki page Notes on Specific Monitors or perhaps add a new page for AOC displays. This is also an appropriate location for people to report feature definition (mccs) file they have created.

digitaltrails commented 5 months ago

I've made this situation worse by making ddcutil-service treat SNC features strictly - after the fix for digitaltrails/vdu_controls#84, I discard the high byte.

Sanford: do you have anything to add on whether it's a good idea to generally discard the high-byte of SNC features? Discarding the high-byte fixes the SNC case where the high byte contrans a "junk" value (as in the ddcutil-service issue), but it seems that this is an example where the high-byte contains useful info.

My current proposal for ddcutil-service and vdu_controls is to allow a special qualifier in the vdu_controls metadata that would result in a flag being passed to ddcutil-service so that it returns both bytes of a particular SNC feature.

digitaltrails commented 5 months ago

Could this feature be handled by a ddcutil user defined feature, would it be CNC?

MFG_ID       AOC
MODEL        AOC Q27P1B
PRODUCT_CODE 12345
MCCS_VERSION 2.2
FEATURE_CODE 60  Input selection
    ATTRS NC RW
    VALUE 01 VGA
    VALUE 02 VGA (switch to)
    VALUE 03 DVI (switch to)
    VALUE 04 DVI (switch to)
    VALUE 0f DisplayPort (switch to)
    VALUE 11 HDMI (switch to)
    VALUE 300 DVI/HDMI (read-only)
    VALUE 301 DVI/HDMI (read-only)
    VALUE 302 DVI/HDMI (read-only)
    VALUE 305 DisplayPort (read-only)