hyperion-webos icon indicating copy to clipboard operation
hyperion-webos copied to clipboard

Doesn't work for webos 4.9 ...

Open Sanek78 opened this issue 3 years ago • 29 comments

Super project, thanks! But it doesn't work for me. Here is the log:

root@LGwebOSTV:/media/developer/apps/usr/palm/services/org.webosbrew.piccap.service# /media/developer/apps/usr/palm/services/org.webosbrew.piccap.service/hyperion-webos_libvt -a 192.168.1.97 [EGL] Display, major = 1, minor = 4 [EGL] Surface size: 192x108 [EGL] init complete [VT] VT_CreateVideoWindow [VT] window_id=0 [VT] VT_AcquireVideoWindowResource [VT] resource_id=85 [VT] VT_CreateContext [VT] VT_CreateContext Failed

"board_type": "K5LP_DVB", "hardware_id": "HE_DTV_W19P_AFADABAA", "product_id": "60UM7100PLB", "core_os_release": "4.9.0-53904", "webos_manufacturing_version": "05.00.15",

Can I fix it somehow?

Sanek78 avatar Dec 25 '21 12:12 Sanek78

First try changing resolution by adding these options: -x 384 -y 216 and see if it starts up properly.

Then you can try downloading latest development CI build here: https://github.com/webosbrew/hyperion-webos/actions/runs/1612798406 How to run it: https://github.com/webosbrew/hyperion-webos#running

Seems like this TV may work with --backend libdile_vt option.

Informatic avatar Dec 26 '21 08:12 Informatic

Such results:

  1. root@LGwebOSTV:~# /media/developer/apps/usr/palm/services/org.webosbrew.piccap.service/hyperion-webos_libvt -a 192.168.1.97 -x 384 -y 216 [EGL] Display, major = 1, minor = 4 [EGL] Surface size: 384x216 [EGL] init complete [VT] VT_CreateVideoWindow [VT] window_id=0 [VT] VT_AcquireVideoWindowResource [VT] resource_id=85 [VT] VT_CreateContext [VT] VT_CreateContext Failed

  2. root@LGwebOSTV:/tmp# LD_LIBRARY_PATH=. ./hyperion-webos -b libvt -a 192.168.1.97 -x 384 -y 216 [EGL] Display, major = 1, minor = 4 [EGL] Surface size: 384x216 [EGL] init complete [VT] VT_CreateVideoWindow [VT] window_id=0 [VT] VT_AcquireVideoWindowResource [VT] resource_id=85 [VT] VT_CreateContext [VT] VT_CreateContext Failed Error! capture_initialize: -1. osal_Mutexlock failed : Operation not permitted hyperion-webos: Threads.cpp:537: HRESULT osal_MutexLock(osal_mutex_t*): Assertion `0' failed. Aborted

  3. root@LGwebOSTV:/tmp# LD_LIBRARY_PATH=. ./hyperion-webos -b libdile_vt -a 192.168.1.97 -x 384 -y 216 Error! capture_start: -1. osal_Mutexlock failed : Invalid argument hyperion-webos: Threads.cpp:537: HRESULT osal_MutexLock(osal_mutex_t*): Assertion `0' failed. Aborted

root@LGwebOSTV:/usr/lib# ls -l | grep libdile_vt lrwxrwxrwx 1 root root 19 Jan 15 2021 libdile_vt.so.0 -> libdile_vt.so.0.1.0 -rwxr-xr-x 1 root root 64140 Jan 15 2021 libdile_vt.so.0.1.0

Sanek78 avatar Dec 26 '21 14:12 Sanek78

First try changing resolution by adding these options: -x 384 -y 216 and see if it starts up properly.

Then you can try downloading latest development CI build here: https://github.com/webosbrew/hyperion-webos/actions/runs/1612798406 How to run it: https://github.com/webosbrew/hyperion-webos#running

Seems like this TV may work with --backend libdile_vt option.

got the same problems. Sadly none of those seem to work... Screenshot 2021-12-27 002332

seacred avatar Dec 26 '21 23:12 seacred

Can you please check if this command creates a proper capture image, with valid Video and UI layers? (eg. simple check would be to open YouTube, start any video and pause it - paused video is still displayed on a capture)

luna-send -n 1 -f 'luna://com.webos.service.tv.capture/executeOneShot' '{"path":"/tmp/capture.png","method":"DISPLAY","format":"PNG"}'

This can later be extracted using scp from /tmp directory, eg. like so: scp root@TV:/tmp/capture.png . (downloads into current directory)

Informatic avatar Dec 31 '21 12:12 Informatic

Can you please check if this command creates a proper capture image, with valid Video and UI layers? (eg. simple check would be to open YouTube, start any video and pause it - paused video is still displayed on a capture)

luna-send -n 1 -f 'luna://com.webos.service.tv.capture/executeOneShot' '{"path":"/tmp/capture.png","method":"DISPLAY","format":"PNG"}'

This can later be extracted using scp from /tmp directory, eg. like so: scp root@TV:/tmp/capture.png . (downloads into current directory)

this is the output i got: -root@LGwebOSTV:~# /media/developer/apps/usr/palm/services/org.webosbrew.piccap.service/hyperion-webos_libvt -a 192.168.178.107 -x 384 -y 216 -sh: /media/developer/apps/usr/palm/services/org.webosbrew.piccap.service/hyperion-webos_libvt: not found

-root@LGwebOSTV:~# LD_LIBRARY_PATH=. ./hyperion-webos -b libvt -a 192.168.178.107 -x 384 -y 216 -[EGL] Display, major = 1, minor = 4 [EGL] Surface size: 384x216 [EGL] init complete [VT] VT_CreateVideoWindow [VT] window_id=0 [VT] VT_AcquireVideoWindowResource [VT] resource_id=85 [VT] VT_CreateContext [VT] VT_CreateContext Failed Error! capture_initialize: -1. osal_Mutexlock failed : Operation not permitted hyperion-webos: Threads.cpp:537: HRESULT osal_MutexLock(osal_mutex_t*): Assertion `0' failed. Aborted

-root@LGwebOSTV:~# LD_LIBRARY_PATH=. ./hyperion-webos -b libdile_vt -a 192.168.178.108 -x 384 -y 216 -Error! capture_start: -1. osal_Mutexlock failed : Invalid argument hyperion-webos: Threads.cpp:537: HRESULT osal_MutexLock(osal_mutex_t*): Assertion `0' failed. Aborted

for those i needed to correct some permissions, because otherwise i just got a permission denied as root@LGwebOSTV in /tmp

-luna-send -n 1 -f 'luna://com.webos.service.tv.capture/executeOneShot' '{"path":"/tmp/capture.png","method":"DISPLAY","format":"PNG"}' { "capturedWidth": 0, "returnValue": true, "capturedHeight": 0 }

i tried using the #6 service rewrite from piccap: https://github.com/TBSniller/piccap/pull/18

unfortunatly i dont now how to uninstall piccap to try it again from scratch. i think i messed some things up here.

seacred avatar Dec 31 '21 18:12 seacred

Can you please check if this command creates a proper capture image, with valid Video and UI layers? (eg. simple check would be to open YouTube, start any video and pause it - paused video is still displayed on a capture)

luna-send -n 1 -f 'luna://com.webos.service.tv.capture/executeOneShot' '{"path":"/tmp/capture.png","method":"DISPLAY","format":"PNG"}'

This can later be extracted using scp from /tmp directory, eg. like so: scp root@TV:/tmp/capture.png . (downloads into current directory)

Used this build: https://github.com/webosbrew/hyperion-webos/actions/runs/1640930323

The result is like this: root@LGwebOSTV:/tmp# LD_LIBRARY_PATH=. ./hyperion-webos -b libvt -a 192.168.1.97 -x 384 -y 216 0.001s [INFO main ] Starting up...

root@LGwebOSTV:/tmp# LD_LIBRARY_PATH=. ./hyperion-webos -b libdile_vt -a 192.168.1.97 -x 384 -y 216 0.001s [INFO main ] Starting up...

This is good?

root@LGwebOSTV:/tmp# luna-send -n 1 -f 'luna://com.webos.service.tv.capture/executeOneShot' '{"path":"/tmp/capture.png","method":"DISPLAY","format":"PNG"}' { "capturedWidth": 0, "returnValue": true, "capturedHeight": 0 }

The image .png was captured correctly!

Sanek78 avatar Jan 01 '22 09:01 Sanek78

That build is very early WIP branch for logging refactor, and shouldn't really change anything, from the one I posted above. Let us merge everything together and we'll come back to you - is that ok? We'll likely need to reverse a little bit how your TV does screenshot capture, and that'll need some time.

Informatic avatar Jan 01 '22 09:01 Informatic

Thank you, I hope for you!

Sanek78 avatar Jan 01 '22 09:01 Sanek78

So seems like the issue here is that on K5LP platform DILE_VT_CreateEx needs to be called instead (eg. with 0, 1 arguments) - this still seems to crash on someone's TV but this may be an unrelated issue! :)

Informatic avatar Jan 09 '22 13:01 Informatic

Seems like that TV also uses pixelFormat 4 (YUV422sp) we don't support yet, so needs adjusting for that. But the outlook is very positive, we'll likely have a working support for these models this week.

Informatic avatar Jan 09 '22 21:01 Informatic

But the outlook is very positive, we'll likely have a working support for these models this week.

Great news, thanks!

Sanek78 avatar Jan 10 '22 07:01 Sanek78

Managed to implement YUV422sp, but seems like that device doesn't want to update the captured texture after initial context dile_vt creation. We are still investigating this.

Changing capture region on every frame causes refreshes, however it also peaks at around 11fps. Basically useless.

Informatic avatar Jan 10 '22 21:01 Informatic

Changing capture region on every frame causes refreshes, however it also peaks at around 11fps. Basically useless.

I want to test it.

Used this build: https://github.com/webosbrew/hyperion-webos/actions/runs/1679191069

root@LGwebOSTV:/tmp# LD_LIBRARY_PATH=. ./hyperion-webos -b libvt -a 192.168.1.97 -x 384 -y 216 0.001s [INFO main ] Starting up... 0.005s [ ERR main ] Unable to register on Luna bus: Invalid permissions for org.webosbrew.piccap.service root@LGwebOSTV:/tmp# LD_LIBRARY_PATH=. ./hyperion-webos -b libdile_vt -a 192.168.1.97 -x 384 -y 216 0.001s [INFO main ] Starting up... 0.005s [ ERR main ] Unable to register on Luna bus: Invalid permissions for org.webosbrew.piccap.service

This error has not occurred before.

Sanek78 avatar Jan 11 '22 08:01 Sanek78

You can add --no-service option - then it will not try to bind to luna bus and not fail.

BTW that version does not contain "region changing" hack I mentioned, but you still can try that anyways.

Informatic avatar Jan 11 '22 09:01 Informatic

root@LGwebOSTV:/tmp# LD_LIBRARY_PATH=. ./hyperion-webos -b libvt -a 192.168.1.97 --no-service -x 384 -y 216 0.001s [INFO main ] Starting up... 0.033s [INFO capture_preinit ] Preinit called. Copying config.. 0.037s [INFO egl_init ] [EGL] Display, major = 1, minor = 4 0.042s [INFO egl_init ] [EGL] Surface size: 384x216 0.043s [INFO egl_init ] [EGL] init complete 0.044s [INFO capture_init ] [VT] VT_CreateVideoWindow 0.044s [INFO capture_init ] [VT] window_id=0 0.044s [INFO capture_init ] [VT] VT_AcquireVideoWindowResource 0.045s [INFO capture_init ] [VT] resource_id=85 0.045s [INFO capture_init ] [VT] VT_CreateContext 0.047s [ ERR capture_init ] [VT] VT_CreateContext Failed 0.048s [ ERR capture_main ] Error! capture_init: -1 0.048s [ ERR main ] ERROR: Capture main init failed! osal_Mutexlock failed : Operation not permitted hyperion-webos: Threads.cpp:537: HRESULT osal_MutexLock(osal_mutex_t*): Assertion `0' failed. Aborted

root@LGwebOSTV:/tmp# LD_LIBRARY_PATH=. ./hyperion-webos -b libdile_vt -a 192.168.1.97 --no-service -x 384 -y 216 0.001s [INFO main ] Starting up... 0.021s [INFO capture_preinit ] Preinit called. Copying config.. 0.021s [INFO capture_init ] Init called 0.021s [INFO capture_start ] Capture start called. 0.022s [WARN capture_start ] DILE_VT_Create failed, attempting DILE_VT_CreateEx 0.143s [INFO capture_start ] [DILE_VT] framerate divider: 1 0.184s [INFO capture_start ] [DILE_VT] frametime: 20133; estimated fps before divider: 49.66970 0.225s [INFO capture_start ] [DILE_VT] frametime: 20102; estimated fps after divider: 49.74629 0.225s [INFO capture_start ] [DILE_VT] vfbs: 1; planes: 2 0.226s [INFO capture_start ] [DILE_VT] pixelFormat: 4; width: 384; height: 216; stride: 384... 0.228s [INFO capture_thread_target] capture_thread_target called. 0.228s [INFO vsync_thread_target ] vsync_thread_target called. 0.228s [INFO connection_loop ] Connecting hyperion-client.. 0.229s [INFO connection_loop ] hyperion-client connected!

On the hyperion server there is only one frame in live video...

"region changing" hack

Perhaps I missed it. Where can I read about this?

Sanek78 avatar Jan 11 '22 09:01 Sanek78

It was the matter of adding these absolutely disgusting lines at the end of capture_frame function in src/backends/libdile_vt.c:

    if (framecount % 2 == 0) {
        region.width = region.width + 1;
    } else {
        region.width = region.width - 1;
    }
    DILE_VT_SetVideoFrameOutputDeviceOutputRegion(vth, DILE_VT_DISPLAY_OUTPUT, &region);

Informatic avatar Jan 11 '22 09:01 Informatic

It turns out that things are bad... And where is the build with the change capture region? I will test it.

Sanek78 avatar Jan 11 '22 09:01 Sanek78

No need to yet, I spent whole evening yesterday testing out with one of the people on Discord. I'll post here whenever I find something out.

Informatic avatar Jan 11 '22 09:01 Informatic

Just got a report that libdile_vt works perfectly on 05.20.08 software version released for W19P devices today. That should work with RootMyTV v2 still. Said user had 05.10.25 before, which failed in an exactly the same manner as in this issue. Does anyone want to test out?

Informatic avatar Jan 23 '22 15:01 Informatic

I tested it and it works! It remains only for the LEDs to light up, but this is already in the hyperion settings. Thanks a lot!

Sanek78 avatar Jan 24 '22 11:01 Sanek78

It'd be great if (some of) you filled out a comment in that issue, whenever you have some free time :) https://github.com/webosbrew/hyperion-webos/issues/16

Informatic avatar Jan 24 '22 20:01 Informatic

I tested it and it works! It remains only for the LEDs to light up, but this is already in the hyperion settings. Thanks a lot!

Hi @Sanek78 ! How did you fix the "one frame" problem? I have the same on my setup. Thank you !

mrhackcz avatar Jan 26 '22 21:01 mrhackcz

Hi @mrhackcz! Updated to firmware 05.20.08, got root (RootMyTV v2). Everything is working now.

Sanek78 avatar Jan 27 '22 08:01 Sanek78

I just upgraded from 05.10.25 to 05.20.08 and everything works. Using libdile_vt

"board_type": "K5LP_DVB",
"hardware_id": "HE_DTV_W19P_AFADABAA",
"product_id": "65SM8200PLA",
"core_os_release": "4.9.5-8",
"webos_manufacturing_version": "05.20.08",

Tested with both DRM (netflix) and non-DRM (youtube) content

janchrillesen avatar Jan 27 '22 12:01 janchrillesen

    "board_type": "K5LP_DVB",
    "hardware_id": "HE_DTV_W19P_AFADABAA",
    "product_id": "65UM7510PLA",
    "core_os_release": "4.9.5-8",
    "webos_manufacturing_version": "05.20.08",

When I use Libdile_vt I get a capture image that will never change. So I use Old TV (libvt+libgm) and it works perfectly. It's strange that we have almost the same hardware and that it doesn't use the same libraries.

ghost avatar Jan 29 '22 08:01 ghost

It works for me with both Old TV (libvt+libgm) and libdile_vt.

Sanek78 avatar Jan 31 '22 07:01 Sanek78

@Sanek78 @janchrillesen haven't you test 05.20.15 firmware? LG shipped it and I'm afraid it may be unrootable yet.

gmelikov avatar Mar 15 '22 18:03 gmelikov

No I didn't update it, why did you update it? in any case there is a good chance that it will be patched now. we will have to wait for a new version of Rootmytv

Le mar. 15 mars 2022 à 19:15, George Melikov @.***> a écrit :

@Sanek78 https://github.com/Sanek78 @janchrillesen https://github.com/janchrillesen haven't you test 05.20.15 firmware? LG shipped it and I'm afraid it may be unrootable yet.

— Reply to this email directly, view it on GitHub https://github.com/webosbrew/hyperion-webos/issues/23#issuecomment-1068306712, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN73VY7O32IJBSDEIPVTNB3VADHS7ANCNFSM5KXY7RPQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

ghost avatar Mar 15 '22 18:03 ghost

@Stef67000 I'm on older version now, which has problems with image capture.

gmelikov avatar Mar 15 '22 18:03 gmelikov

With latest releases, we now support webOS 3.4 and above.

TBSniller avatar Sep 25 '22 12:09 TBSniller