aiopylgtv: Can't do anything relate to calibration LG C1 OLED

2021-11-12 02:22:30 DEBUG (MainThread) [websockets.protocol] client > Frame(fin=True, opcode=<Opcode.TEXT: 1>, data=b'{"id": 12, "type": "request", "uri": "ssap://externalpq/getExternalPqData", "payload": {"picMode": "hdr_game"}}', rsv1=False, rsv2=False, rsv3=False)
2021-11-12 02:22:30 DEBUG (MainThread) [websockets.protocol] client - event = data_received(<134 bytes>)
2021-11-12 02:22:30 DEBUG (MainThread) [websockets.protocol] client < Frame(fin=True, opcode=<Opcode.TEXT: 1>, data=b'{"type":"error","id":12,"error":"500 Application error","payload":{"returnValue":false,"errorText":"no file path from tvservice"}}', rsv1=False, rsv2=False, rsv3=False)
2021-11-12 02:22:30 ERROR (MainThread) [homeassistant.components.webostv.media_player] Error calling async_command on entity media_player.my_webos_smart_tv_48c1: PyLGTVCmdError('500 Application error')

When using externalpq/getExternalPqData I got this error: “no file path from tvservice

When using externalpq/setExternalPqData I got this error: “20 "Driver error while executing the command"

I just want to change OLED brightness. I try writing the function separately, but the error will occur as soon as I start calibration. I can’t seem to figure it out.

BTW: for anyone who wants to use send command, the payload itself require a few more thing to complete for example

{"command": "BACKLIGHT_UI_DATA","picMode":"hdr_game"}

and perhaps

{"command": "BACKLIGHT_UI_DATA","picMode":"hdr_game", "data": "?WHATISIT", "dataCount": 30,"dataOpt": 1,"dataType":"float","profileNo": 0,"programID": 1}

But I still think that there’s more to it.

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 30 (3 by maintainers)

Most upvoted comments

argyllcms supports using an external command line tool to set the patches IIRC, so this might already be possible with the right command line options

About DV config in Edid: that’s for LLDV external devices, the internal one may or may not be the same (they can update it via firmware update).

About nvidia driver: I use Full range, RGB, 12 bit output, and that what appears on the Diag screen as well.

About HDR10 calibration: I haven’t heard anyone who successfully profiled a Woled and created an acceptable 3dlut from it in HDR. Even Calman only measures WRGB and generates a matrix 3dlut from.it, hencr the talk about synthetic luts in that thread. But other folks don’t even touch the 3dlut: they only create a 1dlut or adjust the 22pt WB RGB controls in calibration mode, but even the latter is highly questionable due to how instable Woled is in HDR. With the G2, I only adjusted the 22pt WB RGB values to slightly correct WB (so only chroma adjustments, not even trying to correct gamma) and I haven’t even upload any tonemapping params (or I uploaded the default 990 one with hardclip params in 1 preset), but this result is barely visible when switching between thia and an untouched preset). Read through the avs 2022 calibration thread if you are in the mood for more info: https://www.avsforum.com/threads/2022-lg-oled-calibration-and-user-settings-no-price-talk.3242257/page-45

New bscpylgtv v0.4.0 is out, it’s mostly about calibration changes, lot of new stuff has been added. Enjoy!

I’m not sure either 😃 Everyone out there (maybe apart from Calman users) use the factory 1dlut and create a 3dlut on top of it outside of calibration mode (after ddc_reset (I’ll call it bypass_modes) is set without unity 1dlut). Whether the 100 or 85 contrast is the right one, again a different topic that I don’t know the answer to, I just go for 85. 😃 But does it really matter with SDR anyway? 😃

woow, welcome back @bendavid ! 😃

Which TPG do you use? I only use madvr and madtpg for sdr profiling, and use the created 3dlut in madvr itself, let alone I use PC mode and full range 12 bit output from pc, so not an expert in internal luts of LG.

Other guys stated, who use their set in normal mode (non-PC) and limited range, that internal luts operate on: 2019 models in full range newer (>=2020) models in limited range

If you found out something worthy, you can do a PR to the readme, e.g. Tips and tricks? 😃

Good question 😃 If it works fine there then it can be used for even manual measurements for those 2 modes, since only couple of measurements need to be taken. Take a look at the iTPG part of our 2022 buglist (2 links): https://www.avsforum.com/threads/2022-lg-c2-g2-owners-thread-no-price-talk.3250717/page-69#post-61675612

Which model do you have? Eg it’s almost completely unusable with 2022 models. The other issue is that until someone integrates it into HCFR or something like that, it can only be used for manual measurements, take a look at the linked script in the readme. The gradients part is fun though 😃

since it may not be clear to some LG C1 users, you have to manually merge the “fixed parsing model names” patch for calibration to work with C1 and higher(?) models, the patch is also missing on chros73’s fork.

Yes, but it’s in progress 😃

since it may not be clear to some LG C1 users, you have to manually merge the “fixed parsing model names” patch for calibration to work with C1 and higher(?) models, the patch is also missing on chros73’s fork.

Maybe they removed it, but you set a string for setting_value that needs to be dictionary, try this:

client = await WebOsClient.create(ip_address)
await client.connect()
setting_value = {"backlight": "0"}
await client.set_current_picture_settings(setting_value)
await client.disconnect()

That command line tool auto converts JSON strings into dictionaries, hence the escaping there.

Thanks, just tested.

I can confirm that this hack still works. I thought I’ve already test it with dict, but, apparently not.

HERE IS THE FINAL CODE

async def _set_oled_light(ip_address: str, oled_backlight_value: int):
    try:
        client = await WebOsClient.create(ip_address)
        await client.disconnect()    
        await client.connect()
        setting_value = {"backlight": oled_backlight_value}
        await client.set_current_picture_settings(setting_value)
        await client.disconnect()
    except Exception as err:
        raise err
    finally:
        try:
            await client.disconnect()
        except Exception as err:
            pass

I’ve achieved my goal, but the issue with calibration still remains open.

Maybe they removed it, but you set a string for setting_value that needs to be dictionary, try this:

client = await WebOsClient.create(ip_address)
await client.connect()
setting_value = {"backlight": "0"}
await client.set_current_picture_settings(setting_value)
await client.disconnect()

That command line tool auto converts JSON strings into dictionaries, hence the escaping there.