webosbrew / hyperion-webos

hyperion.ng video grabber for webOS
MIT License
153 stars 30 forks source link

Renice hyperion-webos process for lower CPU usage #94

Open TBSniller opened 2 years ago

TBSniller commented 2 years ago

Since our process is running as native service, we have encountered high CPU usage. Reason might be service register, which makes hyperion-webos able to use more CPU time than in older versions without luna bus registration. This leads to more unresponsive webOS UI and apps.

To reduce CPU usage it's currently possible to:

We should implement a priority change using setpriority(), which can be set by parameter.

EmmanuelVella commented 2 years ago

Hi, on my B6V, I use a build that was made just after the introduction of the vsync option. With it, I get 30fps (max), and very acceptable latency.

When I updated to the new release (with same config), my CPU usage increases, I get 15fps (max) and latency is a lot higher.

I would be glad to help by sharing more information I you want.

satgit62 commented 2 years ago

Ich habe 192 × 96 Auflösung auf Manuel gewählt, Priorität in PicCap 4.1 von 150 auf 100 reduziert, Sync auf aus und tatsächlich ging die CPU-Last von hyperion-webos von 73 % auf 27 % und hyperhdr von 12 % auf 3 % zurück. Ich habe die Frame rate auf 20 (max.) eingestellt. Jetzt gibt es auch keine Verzögerung mehr und die Übergänge sind fließend.

TBSniller commented 2 years ago

Thanks to @Sinergetikus. He has seen that current version is running in lower FPS as older builds and found out its because of the usage of https://github.com/openlgtv/buildroot-nc4/ toolchain in newer builds. Using the "old" toolchain from https://github.com/webosbrew/meta-lg-webos-ndk/ gives a huge performance boost, which also leads to lower CPU usage, as desired max FPS are reached with less CPU usage.

We are using https://github.com/openlgtv/buildroot-nc4/ toolchain to support older webOS versions.

EmmanuelVella commented 2 years ago

Just installed the ipk manually (not available on the TV ATM), and if I did it correctly, seems to work great ! Thank you very much !

image

TBSniller commented 2 years ago

Performance issue is fixed with https://github.com/webosbrew/hyperion-webos/pull/96 Regardless it would be nice to change the process priority of hyperion-webos, so this stays open