Moved to SourceForge

Please note, that development has moved to SourceForge.

Linux DDC/CI Tool page

Goal

The goal of this page is to get Linux (*nix) users an ability to control their DDC/CI monitors from within operating system command line/gui interface. At the time of writing (2004-07-25) Samsung has produced number of monitors which does not contain any buttons on their face to adjust their parameters. The only way available for this is using MagicTune program, which is available for Windows platforms as free download at Samsung site. According to Google search Samsung as well as NEC/Mitsibishi use DDC/CI interface for controlling their monitors. So I guess, that the things I've observed is the DDC/CI communications using the I2C bus. In fact VESA offer DDC/CI protocol specification on it's page, but I don't have an access to them, so I can't fully verify the correctness of job was done. The data was just sniffed from the I2C DDC bus. On the other hand there is indirect references available: USB Monitor Control Class 1.0 specification for control codes and ACCESS.bus (tm) Specifications Version 3.0

Status

There is no complete solution yet, the effort was made to made minimal application which can be used for testing. But at the moment of writing it features quering monitor capabilities and controls available using DDC/CI interface. Use it's on your own risk. I'm personally own Samsung SyncMaster 173T TFT monitor and has performed testing using it. Nicolas Boichat was kind enough to test it with Mitsubishi Diamond Pro 2060u CRT monitor. I've no information for other monitor types yet, but as seems it should work for modern Samsung TFTs and NEC/Mitsubishi displays.

License

This program is distributed under a GNU GPL.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Technical notice

DDC/CI device seems is a client at I2C bus address 0x37 (0x6e for write transactions, 0x6f for read). Data being sent/received is formatted in frame, each frame has a fixed prefix byte, followed by length of the payload, payload itself and checksum made of XORing submitted/received I2C message.  The initial XOR value depends on operation attempted, it's equal to I2C address submitted on the wire and seems to be fixed value for read transaction. For details see ddcci-tool sources.

My Samsung SM173T only offers DDC/CI on VGA interface, but does not on DVI. But it can adjust it settings in DVI mode via VGA interface (I've a dual head ATI Radeon 9200 card, both cables are connected to it).

Running it

At the moment this program needs I2C bus support in your kernel and I2C capable video card. I've used ATI Radeon 9200 card and the exact sequence to load appropriate modules was following:

modprobe i2c-dev && modprobe radeonfb

Your millage may vary, and probably radeonfb does not support your card (it does not if it's not ATI Radeon based). If so, try googling around looking for I2C support for your card. Some of the cards are supported by lm_sensors package, some by framebuffer modules.

According to Nicolas page he has successfully used rivafb with Nvidia card.

Once loaded it's a good idea to scan I2C busses using i2cdetect program (launch it with no args to see the list of I2C busses). Your monitor should answer at least at address 0x50 (EDID reading) and 0x37 (DDC/CI). The 0x37 is mandatory for runnig program. If it does not answer - try other busses as well. My Radeon exposes 4 busses - crt, vga, dvi and monid. It's therefore answers at 0xa0 at vga and dvi (as expected) and at 0x37 at vga bus only. So, I've used it for testing.

Once done, you can try using program by typing something like this (this will query monitor capabilities and ):

ddcci-tool /dev/i2c-2 -e -c -d

This should produce output like this:

ddcci-tool version 0.03

Reading EDID : 0x50@/dev/i2c-2
	Plug and Play ID: SAM00BA
	Input type: Analog

Using ddc/ci : 0x37@/dev/i2c-2

Capabilities:
(type(LCD)vcp(04 05 10 12 60(1 3) B0(1 2) B6 C6 C8 C9 D6(1 4) DC(1 2 3 4) DF))

Controls (valid/current/max):
Control 0x04: +/0/1	[Reset Factory Defaults]
Control 0x05: +/0/1	[SAM: Reset Brightness and Contrast]
Control 0x06: +/0/1	[Reset Factory Geometry]
Control 0x08: +/0/1	[Reset Factory Default Color]
Control 0x0e: +/60/120	[SAM: Image Lock Coarse]
Control 0x10: +/0/100	[Brightness]
Control 0x12: +/50/100	[Contrast]
Control 0x16: +/8/16	[Red Video Gain]
Control 0x18: +/8/16	[Green Video Gain]
Control 0x1a: +/8/16	[Blue Video Gain]
Control 0x1e: +/0/2	[SAM: Auto Size Center]
Control 0x20: +/50/100	[Horizontal Position]
Control 0x30: +/25/54	[Vertical Position]
Control 0x3e: +/39/50	[SAM: Image Lock Fine]
Control 0x60: +/1/3	[Input Source Select]
Control 0x62: +/0/100	[Audio Speaker Volume Adjust]
Control 0x6c: +/140/255	[Red Video Black Level]
Control 0x6e: +/127/255	[Green Video Black Level]
Control 0x70: +/121/255	[Blue Video Black Level]
Control 0xb0: +/0/2	[Settings]
Control 0xb6: +/3/8	[???]
Control 0xc6: +/1/1	[???]
Control 0xc8: +/5/16	[???]
Control 0xc9: +/1/0	[???]
Control 0xca: +/2/2	[On Screen Display]
Control 0xcc: +/2/11	[SAM: On Screen Display Language]
Control 0xd6: +/1/4	[SAM: DPMS control (1 - on/4 - stby)]
Control 0xdc: +/4/4	[SAM: MagicBright (1 - text/2 - internet/3 - entertain/4 - custom)]
Control 0xdf: +/512/0	[VCP Version]
Control 0xe0: +/0/2	[SAM: Color preset (0 - normal/1 - warm/2 - cool)]
Control 0xe1: +/1/1	[SAM: Power control (0 - off/1 - on)]
Control 0xe2: +/0/1	[???]
Control 0xed: +/108/255	[SAM: Red Video Black Level]
Control 0xee: +/101/255	[SAM: Green Video Black Level]
Control 0xef: +/103/255	[SAM: Blue Video Black Level]

If you got this - congrutulations, if not, try digging inside it. If it hangs - press Ctrl+C. At the moment I do not accept anything other than patches. ;-) The output is not decoded at the moment, but the meaning as follows - vcp section contains list of controls which can be adjusted. Some controls are descrete, i.e. they can be one of the value specified in the list which follows them. See Controls section below for decoding numbers. The caps string are depends on the mode in which monitor is being used at the time of running. I.e. the the output was produced, when I've switched my SM173T to digital (DVI) input, while analog (VGA) mode produces the following:

(type(LCD)vcp(04 05 06 08 0E 10 12 16 18 1A 1E 20 30 3E 60(1 3) 
			B0(1 2) B6 C6 C8 C9 D6(1 4) DC(1 2 3 4) DF E0(0 1 2)))

(line brake inserted for readability).

Another program options are -d for querying all available controls (which includes also "hidden" controls), -r for reading specific control, -w for writing it. For example to query current brightness execute this command:

ddcci-tool /dev/i2c-2 -r 0x10
This should produce output like this: 
Reading 0x10(Brightness)
Control 0x10: +/0/100   [Brightness]

The meaning is following - control number, validity (+ sign), current value, maximum value and symbolic name. To set brightness to 50 type this:

ddcci-tool /dev/i2c-2 -r 0x10 -w 50

Launch ddcci-tool with no args to see available options. At the moment of writing they're as follows

ddcci-tool [-a adr] [-e] [-d] [-c] [-f] [-v] [-s] [-S] [-r ctrl] [-w value] dev
        dev: device, e.g. /dev/i2c-0
        adr: base address of ddc/ci, eg 0x37 (def)
        -e : query EDID at 0x50
        	queries monitor EDID, which should be accessible at I2C address 0x50
        -c : query capability
        	queries DDC/CI capabilities string
        -d : query ctrls 0 - 255
        	dumps controls 0-255, checking validity byte, use -f to override
        -r : query ctrl
        	specifies control index to read or write (-w)
        -w : value to write to ctrl
        	value for control to be writen for index specified with -r
        -f : force (avoid validity checks)
        	avoid validity check
        -s : save settings
        	Sends DDC/CI command to save adjustments made by -w
        -v : verbosity (specify more to increase)
        	try -v and -vv (low level send/recv) for greater effect
        -S : send Samsung DDC/CI enable
        	seems some of the Samsung monitors requires this for operating

SM173T Controls

At the moment program show symbolic control names according to Samsung SyncMaster 173T functionality and info gathered from USB & ACCESS.bus specs, so they could be incorrect for your monitor.

ControlSymbolic nameComments
0x00DegaussACCESS.bus
0x01DegaussUSB
0x02Secondary DegaussACCESS.bus
0x04Reset Factory DefaultsBoth
0x05SAM: Reset Brightness and ContrastSniffed
0x06Reset Factory GeometryBoth
0x08Reset Factory Default ColorACCESS.bus
0x0aReset Factory Default PositionACCESS.bus
0x0cReset Factory Default SizeACCESS.bus
0x0eSAM: Image Lock CoarseSniffed
0x10BrightnessBoth
0x12ContrastBoth
0x14Select Color PresetACCESS.bus
0x16Red Video GainBoth
0x18Green Video GainBoth
0x1aBlue Video GainBoth
0x1cFocusACCESS.bus
0x1eSAM: Auto Size CenterSniffed
0x20Horizontal PositionBoth
0x22Horizontal SizeBoth
0x24Horizontal PincushionBoth
0x26Horizontal Pincushion BalanceBoth
0x28Horizontal MisconvergenceBoth
0x2aHorizontal LinearityBoth
0x2cHorizontal Linearity BalanceBoth
0x30Vertical PositionBoth
0x32Vertical SizeBoth
0x34Vertical PincushionBoth
0x36Vertical Pincushion BalanceBoth
0x38Vertical MisconvergenceBoth
0x3aVertical LinearityBoth
0x3cVertical Linearity BalanceBoth
0x3eSAM: Image Lock FineSniffed
0x40Parallelogram DistortionBoth
0x42Trapezoidal DistortionBoth
0x44Tilt (Rotation)Both
0x46Top Corner Distortion ControlBoth
0x48Top Corner Distortion BalanceBoth
0x4aBottom Corner Distortion ControlBoth
0x4cBottom Corner Distortion BalanceBoth
0x50HueACCESS.bus
0x52SaturationACCESS.bus
0x54Color Curve AdjustACCESS.bus
0x56Horizontal MoireBoth
0x58Vertical MoireBoth
0x5aAuto Size Center Enable/DisableACCESS.bus
0x5cLanding AdjustACCESS.bus
0x5eInput Level SelectACCESS.bus
0x60Input Source SelectBoth
0x62Audio Speaker Volume AdjustACCESS.bus
0x64Audio Microphone Volume AdjustACCESS.bus
0x66On Screen Display Enable/DisableACCESS.bus
0x68Language SelectACCESS.bus
0x6cRed Video Black LevelBoth
0x6eGreen Video Black LevelBoth
0x70Blue Video Black LevelBoth
0xa2Auto Size CenterUSB
0xa4Polarity Horizontal SynchronizationUSB
0xa6Polarity Vertical SynchronizationUSB
0xa8Synchronization TypeUSB
0xaaScreen OrientationUSB
0xacHorizontal FrequencyUSB
0xaeVertical FrequencyUSB
0xb0SettingsBoth
0xcaOn Screen DisplayUSB
0xccSAM: On Screen Display LanguageSniffed
0xd4Stereo ModeUSB
0xd6SAM: DPMS controlSniffed (1 - on/4 - stby)
0xdcSAM: MagicBrightSniffed (1 - text/2 - internet/3 - entertain/4 - custom)
0xdfVCP Version
0xe0SAM: Color presetSniffed (0 - normal/1 - warm/2 - cool)
0xe1SAM: Power controlSniffed (0 - off/1 - on)
0xedSAM: Red Video Black LevelSniffed
0xeeSAM: Green Video Black LevelSniffed
0xefSAM: Blue Video Black LevelSniffed
0xf5SAM: VCP EnableSniffed

Download

(2004-08-18)  ddcci-tool-0.03 sources.

(2004-08-23)  ddcci-tool-0.04 sources and binary compiled at Fedora Core 2 x86 box. I'm recommending you to recompiling program on your own. In this version ddcci delay code was updated to improve stability.

Reports

If you found this program useful send your report to oleg at dot cs dot msu dot su

I'm interested in running program in this way: "ddcci-tool /dev/i2c-x -e -c -d". This should produce output containing your monitor EDID, caps and registers. Try running with different input sources. Ananlyze the output according to register names.

The good idea is to write kernel module (lm_sensors style) which will provide all necessary functionality for upper layers. Treat this application as a proof of concept.