The LG ACB8300 is a cheap monitor calibration utility. It is designed for LG monitors and is currently only supported by LG's True Color Pro software.
I bought such a device, even though I don't have a LG display. My initial thought was that the device was just another rebranded colorimeter - but it turned out it was wrong.
This page describes the USB protocol as well as the work towards integrating it into Argyll CMS.
First steps with the calibrator
At first, I poked around the installation directory of True Color Pro and - to my surprise - found a DLL called LG_ACB8300.dll. This sounds interesting. I fired up Dependency Walker to get the exported functions:
I don't know what “Signage” means, but some of the functions sound interesting. I googled them and found another project doing similar work: Calibrate Everything!. The guy over there traced True Color Pro to have some function signatures.
Thanks to his work, I could code a simple Python wrapper and later a simple C wrapper in order to debug the DLL.
Debugging the LG_ACB8300.dll
I traced parts of the LG_ACB8300.dll with OllyDBG. I built a Python and a small C wrapper around the library in order to have access to the funtions and their parameters. The wrapper simply loads the DLL entry points and calls DeviceOpen, Get_ADC, Get_XYZ, etc. in order to reverse engineer the functionality.
Inside the Get_XYZ function, a lot of floating point magic is going on. After reversing all the floating point assembly, it turns out that the conversion from ADC to XYZ is performing as follows:
- Read ADC value from device
- Do an offset correction (can be read from calibration, subract A from the USB protocol)
- Apply a correction matrix (can be read from calibration, multiply by M from the USB protocol)
- Do an offset correction (can be read from calibration, add X from the USB protocol)
- Apply a monitor correction matrix (multiply by matrix from the DLL)
The monitor correction matrix is hardcoded in the DLL. The SetMonitorType() function simply loads a different matrix into memory.
The data section contains 7 different monitor types. Monitor Type 1 is a simple unity matrix.
For my DLL, the memory locations are:
The next 9 double numbers at the memory locations define the correction matrices. They are in row-column order.
Hacking the USB protocol
The USB protocol consists of input reports and output reports, with a fixed length of 43 bytes. The host speaks first, the device responds (most of the time). The first byte is always the command byte, the remaining bytes are either payload or junk. The byte numbers of the table start with the payload, so you have to strip the first byte anyway.
They seem to not clear the send buffer before responding to a command. Thus, you always get the remaining bytes of the previous commands as well!
This seems to initialise the device. The bytes in the response are yet unknown.
Get the different calibration matrices and offset values from the device. M is a 3×3 matrix for the ADC to XYZ conversion, A is the first ADC offset, X is the second XYZ offset (both being a vector of length 3).
Read ADC values
Read ADC values from the device.
Read Firmware version
In order to derive the firmware version, divide the value by 100. My device reports
100 which corresponds to firmware version
Wait for button input
Whenever the button is pressed, the device sends
Although the device will probably be never officially supported by ArgyllCMS, I developed an initial driver for the device. You can find the patch for Argyll 1.8.3 here. Be aware that it is only tested on my colorimeter and only on Linux. The patches to the Windows .inf-files are completely untested.