velum / lguf-brightness

Adjust brightness for LG UltraFine 4K display (cross platform)
49 stars 11 forks source link

General problems #5

Open Tamas-Toth-ebola opened 4 years ago

Tamas-Toth-ebola commented 4 years ago

Dear @velum !

For me the whole project is really new as I just bought my LG Ultrafine 4k (24") few months ago. In this case I could be really noobe with it's usage.

As I'm Linux user I already known that with Linux I could not reach the settings functionalities of the monitor but was very happy when I found your fork.

Sadly my tries were unsuccessful yet. After successfully build/compile the app with cmake and make the binary itself do simply nothing. I tried it on Ubuntu 19.10 and on 18.04 the build/compile process were fine on both situation but after run the binary I got nothing more just the prompt back, without any error message, without any good sign, or at least a segmentation fault:)

Could you please help me with some directions what could be my problem?

Thanks a lot for it in advance!

velum commented 4 years ago

Hi Tamas! So, you are saying that the program does nothing and exits without any message? After it exits, you are able to enter Linux commands like ls and they work? Your screen is a newer model I believe. I have the 21" model from a few years ago. The code might not be possible with the newer model. Your screen is connected directly to your computer with a USB-C cable, and no converted in-between, correct?

Tamas-Toth-ebola commented 4 years ago

Hello!

Sorry for the late answer I had became a little bit busy on last some days.

Yes you tipped correctly my model is not the same what is the old one. My model is the 24" refreshed Ultrafine 4k from 2019. And yes you understand everything correctly also. The monitor directly connected with the original Thunderbolt cable to my NUC8i7, and after run the executable there is no real answer over on the bash 255 exit code.

Here is the screenie of the process:

Peek 2020-03-02 20-44

The monitor is the:

  Unique ID: rdCR.nEw47YnehD4
  Parent ID: _Znp.xa29GW7G6OF
  Hardware Class: monitor
  Model: "LG ELECTRONICS LG UltraFine"
  Vendor: GSM "LG ELECTRONICS"
  Device: eisa 0x5b7b "LG UltraFine"
  Serial ID: "906NTAB1W544"
  Resolution: 640x480@60Hz
  Resolution: 3840x2160@60Hz
  Size: 525x295 mm
  Year of Manufacture: 2019
  Week of Manufacture: 6
  Detailed Timings #0:
     Resolution: 3840x2160
     Horizontal: 3840 3888 3920 4000 (+48 +80 +160) -hsync
       Vertical: 2160 2214 2217 2222 (+54 +57 +62) +vsync
    Frequencies: 533.28 MHz, 133.32 kHz, 60.00 Hz
  Driver Info #0:
    Max. Resolution: 3840x2160
    Vert. Sync Range: 48-60 Hz
    Hor. Sync Range: 30-135 kHz
    Bandwidth: 533 MHz

What is the LG - 24MD4KL-B model.

Currently I have realized that 'ddcutil' can control the brightness, but nothing more. This could be more then enough for me as I have a hardware monitor calibration device if I need ambient light measurement. The question is just the brightness what I can currently handle with 'ddcutil' is the same what 'lguf-brightness' can handle or a different one? :)

I mean which one can handle the real backlight of the monitor. 'lguf-brightness' and 'ddcutil' both can control real backlight or both can control just the brightness of the device or both control the brightness what is basically the real backlight? In theory backlight control would be the perfect but as I have no Mac I really do not know what can be controllable on Mac and also do not know that 'ddcutil' handle the same parameter as 'lguf-brightness' or a different one.

It is totally understandable if the new model not compatible with your app but are there any way to validate/confirm it?

Could you please help me with any direction?

Thanks a lot in advanced for your efforts!

Tamas-Toth-ebola commented 4 years ago

Hi @velum could you please check my last comment? Of course there is no problem if you have no time or the current global virus problem make you busy enough just ask it if you maybe forget my message.

Thanks in advance!

velum commented 4 years ago

Hi Tamas! Interesting to know that ddcutil can also control the brightness of the monitor. What do you mean by "control real backlight or can control just the brightness"? I am not sure I am following you. Normally, on a monitor there are two main things you can control: the brightness and the contrast. I would say lguf_brighness controls the brightness. It is strange also that the code exits without any error message on your computer. You could had this line right at the start of the main() function just to make sure that the program is able to output text properly to the terminal:

printw("Starting lguf_brighness\n");

After recompiling and running lguf_brighness, if it does output the text, you could add a few printw(..) commands here and there to see what code path is used.

Tamas-Toth-ebola commented 4 years ago

Hi Jean-François!

Thanks for your reply, here my thoughts:

What you told that monitors usually have 2 very control possibilities for it's screen is true. But sadly the brightness not always (moreover usually not) control the backlight of the monitor. The LCD foil and the background screen absolvation engine (as software and as hardware also) has 1-1 brightness and contrast parameters but those parameters usually not drive the real backlight intensity of the monitor. So the brightness control not control the real backlight parts of the monitor (for example the white LEDs or LED matrixes what make the backlight or the CCFL what for also such requirements earlier). The brightness control just drive the 'software' and 'hardware' of the LCD foil, to make it 'whiter' or 'blacker' but without controlling the backlight element just drive the foil light transmission capabilitiy. (The contrast 'slider' used also for such results.) This is what used widely by almost all cheap monitors on the market.

The problem is that witch such possibilities the LCD monitors could drop it's dynamic range as while backlight has still the same intensity the whiter/blacker parameter handle basically the contrast from 2 aspect but nothing more, while technically the minimum brightness of the screen is always the same. If in this case we turn down the brightness that will result an absolutely lack-lustre screen as the whites will be darker as the LCD foil start to transmission the lights of the white screen lessly, but the black still stay the same as the real backlight has not changed. The result is a gray, low contrast screen with very low dynamic range.

I'm pretty sure you know what I write just want to clear our thoughts.

The higher end devices usually has a capability to control not just this LCD foil brightness parameter, but the real backlight intensity, but usually that named by backlight not brightness and we can control all three parameters independently. My very old, but HQ SONY CCFL monitor also have an 'auto-brightness control', what is generally an auto-backlight control as that check the light intensity the environment and control the real backlight of the monitor accordingly for it.

In this case with low backlight we can reach really dard blacks but of course with also weak peek white lights what in dark environment could be more than enough and the dynamic range is could be almost intact (I write 'almost' as the LCD foils's transmission capability is not so high resolution to handle the same dynamic range in a 'low brightness' part of the whole range, so the result will be not perfect.)

I tried some brightness control of this LG Ultrafine monitor and there were cases where I got flat, low contrast results with still high black level. This is why I searched for real backlight control. Seems the ddcutil anyway control the real backlight but I'm not sure in it as it just just seems. The dynamic range seems just violated just very weakly while the whole screen still stay good enough. And this is why I asked you about it.


For your other question when I will have some time for it I will try to test what you suggest with debug points in the code, but sadly I have not so much time nowadays.

If we could exactly know that ddcutil can control real backlight we could forget this special application as there are further tools for it. If you could compare the results of this app and ddcutil that could be the proof of my theory.

Thanks for your words!

(Just an example for the non-backlight controlled situations: https://github.com/ojotoxy/Brightness/issues/12)

velum commented 4 years ago

Hi Tamas! Thank you for the clarification! I did not know about this backlight thing. I will look into it and check ddcutil when I have a moment to do so. I don't when that will be though.