yashsingh1/xdaforums huggingface dataset:
[WebOS Software and Hacking General] y=fx:
the SDL or QT applications behave the same way if you start from the shell !! however tonight I analyze better the situation .
[WebOS Software and Hacking General] xtreme_protector:
Well, good luck ! Keep us posted.

==

I'd focus on packaging apps. Then, it's interesting to know which ones work (among SDL, wayland + EGL, etc) and which don't, It's clear that for a sec it all seems fine, then something happens.

One more idea. What if you try to start an application using luna-send ? For instance:

luna-send -n 1 palm://com.palm.applicationManager/launch {"id":"com.ssiptv.app"} starts ssiptv. Just replace "com.ssiptv.app" by your application name/id.
[WebOS Software and Hacking General] xtreme_protector:
Well, just some heads up :) Some goodies (read kodi addons) work just fine here. For an example.: streaming addon, watching a 720p resolution movie, with sound (AC3, with no lag for the first time :) results in about 20% CPU occupancy (4-core arm7l Mstar2 lm15 here -- whatever that means in the LG terminology).

Edit: Audio lagging still there ;). Some more digging to do....
[WebOS Software and Hacking General] y=fx:
Ok good and bad news , I managed to start the application that used the wayland and wayland_egl calls to render a triangle, but to do that , i have add SDL2 calls at the top of the application (I call only the SDL_CreateWindow and a SDL_CreateRenderer) for obtain "the permissions" and start the application in the foreground without smoothly . In addition to this I discovered that the native web applications etc packaged as ipk are started in a sort of sanbox .

The problem is here , for the other variables it is immediately possible to solve , but for the variable containing the libraries "LD_LIBRARY_PATH" no . If you have any idea in addition to statically compiling the libraries and linking them, let me know .
[WebOS Software and Hacking General] xtreme_protector:
Well, I'd say these are good news :). Let's see:

I think it may be useful to post the exact modification which you had to do, so that others can try if interested, Have you tried running the packaged app using luna-send (see above), or maybe this starts the app sandboxed ??? In my case, I can start anything I want from shell with/without luna-send.

What do you mean by "...start the application in the foreground without smoothly" ? Does it run smoothly or not after adding the SDL stuff ?

I don't think I understand exactly what the problem with "LD_LIBRARY_PATH" is.

If you want to avoid using "LD_LIBRARY_PATH" without statically compiling libs., just try to specify them in the linker command line using -Wl,-rpath=/path/to/non-standard/lib/dir. You can also just rename a dynamic lib and link using -l:libname.so.x.x.x.etc.
[WebOS Software and Hacking General] y=fx:
The problem with the variable LD_LIBRARY_PATH is that, if not correctly set, the program can not start . Anyway , i have set a path to a shared libraries not present on the TV and needed to kodi, directly in the compilation phase .

In addition to this I started kodi even without SDL2.

to add a specific path, use ( -Wl, -R/path/tolibs ) as an optional linking flag . Unfortunately there are several problems still to be fixed, so I will update the procedure in the next days :highfive:

---------- Post added at 11:32 PM ---------- Previous post was at 11:30 PM ----------

I confirm that the input does not work !!

EDIT :

log file when booted from shell https://pastebin.com/LUPN7QNi

log file when booted from launcher ipk https://pastebin.com/Lp44yJaX

in the first case, it works well, but it is placed in the background, in the second case it is started correctly but it does not work well .
[WebOS Software and Hacking General] xtreme_protector:
Great ! So, since you don't need the SDL calls, what was actually the problem with kodi being put in background ?

Regarding the python errors, I've fixed those. In other words, if kodi starts and is stable running in foreground (albeit without input), let me know, since I'll update you to the latest version :).

Among improvements are the following:

- input should be fixed

- better PCRE library

- one of the latest stable ffmpeg (version 3.4)

- working python, so that addons can be installed :).

So, just let me know when you have a foreground, working kodi.
[WebOS Software and Hacking General] y=fx:
good job

If started from the terminal, it is always put in the background. In short, if the program is not started by the launcher, it will always be put in the background, this happens with any program that makes use of the graphics . In the case of kodi, it did not start because the variable for the additional libraries was not set . instead with the sample program EGL..WAYLAND.. I had to add the calls

if you have seen the logs well , you will have surely noticed that there are some anomalies e.g

08:32:05 T:1957638144 DEBUG: Loading settings for {"@system_native_app":true,"nid":"com.kodi","launchHidden":false}
08:32:05 T:1957638144 DEBUG: CPlayerCoreFactory::GetPlayers({"@system_native_app":true,"nid":"com.kodi","launchHidden":false})
.....
08:32:05 T:1752409104 ERROR: CDVDPlayer::eek:penInputStream - error opening [{"@system_native_app":true,"nid":"com.kodi","launchHidden":false}]
08:32:05 T:1752409104 NOTICE: CDVDPlayer::eek:nExit()
.....
.....
08:32:05 T:1957638144 ERROR: Playlist Player: skipping unplayable item: 0, path [{"@system_native_app":true,"nid":"com.kodi","launchHidden":false}]

and other.

currently I am not yet trying the input but I fear that it does not work . A quick way to test the input? I mean to make it work?

EDIT: I confirm, the applications are performed in a sort of sandbox, which lg calls "jail"
[WebOS Software and Hacking General] xtreme_protector:
Don't worry. regarding the input. It will work, since I've modified it to use the linux input system.

===

By default, once we have wayland enabled in the kodi build system, it will start listening for input events using wayland. Well, that simply doesn't work here (You've also confirmed that using the simple_egl test application.) So best test is using the simple_egl application. In principle that should output to shell though, which you may not see due to packaging, etc.

So, just test with kodi itself ,if now it starts.

Let me know what happens.

Edit: I'm now fighting the stopping audio issue (with no luck yet ;).
[WebOS Software and Hacking General] y=fx:
where did you change the input system in the kodi sources? my sources are bit different from the ones you put on the dropbox

EDIT: among the various problems, as soon as kodi starts the screensaver the application ends unexpectedly , in the logs it is not reported

---------- Post added at 04:30 PM ---------- Previous post was at 04:23 PM ----------

Interesting

Usage: jailer [-d][-D][-N][-C] [-t type] [-p homepath] [-s shellpath] [-S] -i appId program [args]
-d: debug
-D: delete the specified jail
-N: nuke (delete and remove files) the specified jail
-C: nuke all the jails
-M: make new jails
-S: setup jail environment and print out its parameters
-T: do timing
-t type: create in jail of type <type>
-p homepath: use homepath instead of default app path
-s shell override (takes the shell provided on commandline)
-i appid: appid of app to run
/etc #
[WebOS Software and Hacking General] xtreme_protector:
Right, I know about the screensaver issue. I can live without it, so I didn't look into it, I've simply disabled it...

===

Regarding the input, well, it would be nice to (re)start from the same source. What modifications did you do ???

Edit: Regarding the jail, I wouldn't play with that, since you may be kicked out from 'dev-mode'.
[WebOS Software and Hacking General] xtreme_protector:
My point is simply that it might be easier for you if you start from my modified kodi sources so that we can both move on from there. Of course, you'll need to alter the build system a bit to link to specific libraries, etc. Still, I believe it's easier than enumerating all changes I've done etc. Plus, to get ffmpeg 3.4 working, I had to apply a patch, etc. But, it;s up to you. Just let me know what you prefer...

Edit: Regarding the build system, we can modify it later so that it fits different webos versions, etc. So, you'll only need to keep a backup of your current kodi sources and when compiling my new ones, simply copy required stuff from Makefiles, etc.
[WebOS Software and Hacking General] xtreme_protector:
The stopping sound is driving me nuts, though....
[WebOS Software and Hacking General] y=fx:
Ok i try to compile your sources with the changes !!
[WebOS Software and Hacking General] xtreme_protector:
Good.

I've updated the dropbox folder. You'll find the up-to-date sources and the additional rootfs. My advise, for a quick test is somehow get the rootfs to show up under: /tmp/usb/sda/sda2/kodi_rootfs. In addition to that you''ll have to merge the 'installed' kodi stuff.

To cmpile kodi:

- make a backup copy of your current kodi sources.

- modify andy_config.sh as needed. In particular pay attention to the "--prefix" location.

- run source ./andy_config.sh

- modify makefiles to fit your libraries. Do not forget to modify xbmc/DllPaths-generated.h to fit your system (Just compare to your backed-up one).

- make. When you get some compile error, modify makefile appropriately.

===

If it all works,

- merge the kodi installation (which should be available in your 'prefix' path) with the additional rootfs libraries.

- After this probably you'll need to package it somehow...
[WebOS Software and Hacking General] y=fx:
I added the appropriate changes and compiled the version with the new input system. Now, as soon as I send an input, keyboard, mouse or remote control, the application closes unexpectedly .

https://pastebin.com/ZttSeti1
[WebOS Software and Hacking General] xtreme_protector:
Well, the debug log looks fine to me, in that I see ffmpeg 3.4.2, and the enumeration of linux input devices. Wired that it crashes on input. I did never had that.... Could it be again an installation issues ? Anyhow, if you could, try running in gdb/strace and see what's going on. Maybe it tries opening some file (keyboard layout maybe ???).

===

I must also say that I've only used the megic remote input, so I actually have no idea if USB keyboard/mouse work.

Anyways, keep me posted. I'll also try to hook some usb device and see what happens. I need to do some shopping first, though.
[WebOS Software and Hacking General] xtreme_protector:
Any progress on getting the new version work ?
[WebOS Software and Hacking General] y=fx:
It starts correctly but the input does not work. I was thinking of using some sort of plugin that makes use of the SDL subsystem for input (since I've already tested the events with sdl2) .

What do you think about it ? I have no idea of the problem, but at the first event / input the program crashes .

ps: however I have not had the chance to do anything these days
[WebOS Software and Hacking General] xtreme_protector:
Neither had I.

Maybe it's still just some packaging problem, since I do not understand what else is different in your case, regarding the input system. I've tested with a USB mouse and it still works for me (using the Magic mote though.... )

Edit: I do not actually think it;s a packaging problem, since the log would have shown that.
[WebOS Software and Hacking General] xtreme_protector:
Btw. I was looking at the lines below in your log file::

22:02:34 T:1942138880 DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(773)

22:02:34 T:1942138880 DEBUG: Previous line repeats 1 times.

22:02:34 T:1942138880 DEBUG: Keyboard: scancode: 0x69, sym: 0x0114, unicode: 0x0000, modifier: 0x0

Did you try using a keyboard ? If so, please try using just some USB mouse and see what happens.
[WebOS Software and Hacking General] y=fx:
The packaging is correct, the app is started correctly .

---------- Post added at 02:59 PM ---------- Previous post was at 02:57 PM ----------

they are recognized and work too, but instead of producing the correct event the app crashes .

edit:

13:10:22 T:1942577152 DEBUG: Keyboard: scancode: 0x69, sym: 0x0114, unicode: 0x0000, modifier: 0x0
13:10:26 T:1746117648 DEBUG: Thread JobWorker 1746117648 terminating (autodelete)

look https://drive.google.com/file/d/1KVohTH8Rx1aLxsrFsl-1hzzjn8ZeSCvJ/view as you can see, after pressing any button, the app crashes .
[WebOS Software and Hacking General] xtreme_protector:
Ok, Could it be something wrong with the libxkbcommon ? It gets loaded though correctly, looking at the log. What else could be different ? Looks indeed like the event translation does not work somehow.

Could you try running getevent (see shared Dropbox folder, getevent-master.tgz) and see if that works ?
[WebOS Software and Hacking General] y=fx:
events are read correctly , i think it's more of a kodi problem !
[WebOS Software and Hacking General] xtreme_protector:
One more important thing I forgot about....

Seems to me that the python engine is not initialized ?

To get that running, go in kodi_rootfs/share/kodi/system/python and create the following folder links:

- DLLs should point to kodi-rootfs/lib/python2.7/lib-dynload

- Lib should point to kodi-rootfs/lib/python2.7/

- lib should point to Lib above.

Sorry, I forgot to tell you that....

Edit: Btw. kodi-rootfs is the location where you extracted the sysroot.tgs file from Dropbox.

Edit2: For comparison I also uploaded a recent kodi.log file from my TV.
[WebOS Software and Hacking General] y=fx:
yes
[WebOS Software and Hacking General] xtreme_protector:
Let me know if this changes anything :).
[WebOS Software and Hacking General] y=fx:
starting the application from the launcher, I could not see this output

Traceback (most recent call last):
File "/media/developer/apps/usr/palm/applications/com.kodi/share/kodi/system/python/Lib/site.py", line 569, in <module>
main()
File "/media/developer/apps/usr/palm/applications/com.kodi/share/kodi/system/python/Lib/site.py", line 551, in main
known_paths = addusersitepackages(known_paths)
File "/media/developer/apps/usr/palm/applications/com.kodi/share/kodi/system/python/Lib/site.py", line 278, in addusersitepackages
user_site = getusersitepackages()
File "/media/developer/apps/usr/palm/applications/com.kodi/share/kodi/system/python/Lib/site.py", line 253, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/media/developer/apps/usr/palm/applications/com.kodi/share/kodi/system/python/Lib/site.py", line 242, in getuserbase
from sysconfig import get_config_var
File "/media/developer/apps/usr/palm/applications/com.kodi/share/kodi/system/python/Lib/sysconfig.py", line 10, in <module>
'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
AttributeError: 'module' object has no attribute 'lib'

now the input is reactive .
[WebOS Software and Hacking General] xtreme_protector:
I still believe the links are not correct. I had a similar error some time ago, which came from the fact that the python engine still tried to use the TV's python (minimal installation, useless) from /usr/lib/python2.7.

So, it's not crashing anymore ???

Edit: Please replace folder kodi_rootfs/lib/python2.7 by the one from Dropbox (see python2.7.tgz). LEt me know if you still have that python-engine error.
[WebOS Software and Hacking General] y=fx:
:) excellent performance I would say https://imgur.com/a/rAhTc

---------- Post added at 04:16 PM ---------- Previous post was at 04:15 PM ----------

no now works properly ;)
[WebOS Software and Hacking General] xtreme_protector:
Huh ! Glad you've made it. Again, sorry that I forgot about the python thing. Too many things in the last few days ;).

Anyhow, please update to the latest python libraries. You''ll get much better support when installing video addons :),

===

Regarding performance, yes, it's not bad, though I've been pulling my hairs out trying to get sound working reliably. So far I did not manage, so I'm curious how the situation will be for you.

If you want to test this, please try playing some movie (say mpeg4, 720p with AC3 encoding). In my case, sound stops working at some random moment. The only way to get it working is either restarting kodi, or at least stopping playback and restarting (According to what setting I have in the system audio settings).

Just let me know if this sound issue happens to you.
[WebOS Software and Hacking General] y=fx:
I meant that when I started the application from the launcher, I could not see that error because it was printed on the console . Now it's solved! :highfive:

---------- Post added at 04:35 PM ---------- Previous post was at 04:27 PM ----------

Yes , as soon as I can i try everything and let's see on what to work .
[WebOS Software and Hacking General] xtreme_protector:
Just let my know your findings.

Edit: A good way to start testing the python engine is by setting the yahoo weather plugin. If that works, you should be good to go :).
[WebOS Software and Hacking General] xtreme_protector:
Did you manage to test a bit ? Sound issues ? Other issues ;) ?
[WebOS Software and Hacking General] y=fx:
I've able to test some plugins, and they work fine . I have tested different resolutions and formats, with some 720p video and AC3 audio compression there are no problems and I have not detected anomalies in the audio as in your case. But with some H.264 720p or 1080p playback is problematic , videos have a loss of frames and are slowed down .
[WebOS Software and Hacking General] xtreme_protector:
Try enabling sync to vblank in kodi video settings. I've also experienced video tearing, etc. with higher resolution videos.

Interesting that you don;t have any audio issues. Could you tell me what audio, caching settings you use ?

Also, how did you install kodi ? It seems to me that you have installed it in the TV flash, right ? Where exactly ? Maybe at some stage, you could also share the packaging method....
[WebOS Software and Hacking General] xtreme_protector:
Also, in the okdi log do you spot errors like ?

ERROR: CDVDAudio::AddPacketsRenderer - timeout adding data to renderer

Edit: The error above is the audio killer in my case...
[WebOS Software and Hacking General] y=fx:
I had enabled that option .

For the audio I'm using the default settings !! Is your problem only with videos ?

In your case how much ram do you have available? although I think it is a problem related to the version of ffmpeg .

For the packaging i load the necessary information in a short time , we need to reorganize some things even if it is essentially necessary to export some variables inside the main source of kodi , recompile and pack everything with ares.. .

---------- Post added at 06:18 PM ---------- Previous post was at 06:13 PM ----------

No only notification and debug messages.

Edit:

Can check if you have this directory ?

/media/developer/apps/usr/palm/applications/
[WebOS Software and Hacking General] xtreme_protector:
Yes, although I haven;t tested thoroughly with audio-only files.

cat /proc/meminfo reports 1.5GB total. Regarding ffmpeg, it;s not specific. Also the original kodi-ffmpeg had same issues here.

Nope. I only have /media/developer/apps/usr/lib/opkg/. In /media/developer/apps/ I have .scripts/ usr/ var/

How about this error ???

DEBUG: CDVDClock::Discontinuity - CDVDPlayerAudio::HandleSyncError2 - was:1216060843.190495, should be:1216034555.641622, error:-26287.548872
[WebOS Software and Hacking General] y=fx:
OK it is not a problem . To package kodi as an ipk file, however, you must identify the directory where the applications are installed through the developer mode . In my case the path is in / media / developer / apps / usr / palm / applications / then the id of the program specified in the appinfo.json file . for example

{
"id": "com.kodi",
"version": "0.0.1",
"vendor": "vendorName",
"type": "native", <----------- the type of application
"main": "launch", <----------- the binary file or (also works with a bash script)
"title": "kodi",
"icon": "icon.png", <--------- the application icon 80x80
"largeIcon": "largeIcon.png", <--------- the application icon 130x130
"uiRevision": 2
}

for other settings you can refer to this dump that I did weeks ago https://drive.google.com/file/d/1Dnm7pTXXiB0qmBJ6N0KjZwPW6NxdXJfo/view?usp=sharing

The directory is necessary to set the variables e.g KODI_HOME correctly, in my case I set the KODI_HOME variable in the source code of kodi, in the main . for example

int envret = setenv("KODI_HOME","/media/developer/apps/usr/palm/applications/com.kodi/share/kodi/",1);

const char *env = NULL;

if((env = getenv("KODI_HOME"))==NULL){
exit(1);
}

while for shared libraries, I specified the search path during linking with -Wl,-R /path/to/lib .

Here a template for packing kodi https://drive.google.com/file/d/1G1-4NbljRpA7CikWxmQ0VndJ9ALBZTBx/view?usp=sharing

just copy kodi inside that folder

export DESTDIR="path/to/template" ; make install
cd /path/to/template

then pack and install

ares-package .
ares-install com.kodi... -d DEVICE_NAME

EDIT: in addition to what is said before , for packaging we need to create DLLs, Lib and lib in the python directory of kodi
[WebOS Software and Hacking General] xtreme_protector:
Funny ;). I do not have such messages (hurry, etc.), instead I have lots of discontinuity errors.

In your case, you should experiment with different caching options, see https://kodi.wiki/view/HOW-TO:Modify_the_video_cache

In mine, I actually have no clue, since I've tried about everything I could think of. If you have suggestions, they are welcome :).
[WebOS Software and Hacking General] xtreme_protector:
How is going ? Any news regarding kodi ? Have you tried anything new ?
[WebOS Software and Hacking General] y=fx:
For now i'm standing still due to lack of time . The settings in kodi do not solve the problems with video playback .
[WebOS Software and Hacking General] teffd:
Can you please post more info about how to compile, for example, sopcast on TV?

Thank you!
[WebOS Software and Hacking General] NiQ1:
Could you please post your current code-base to we can join the efforts?
[WebOS Software and Hacking General] xtreme_protector:
Sorry for the very late reply. (I've been in vacation.)

===

Well, as I said before, I actually managed to cross-compile compile qemu-i386 (version 2.10.2 much better compared to 2.4) so that I can run the native sopcast linux i386 client (sp-sc-auth) on the TV itself. To compile qemu you'll most likely need to compile glib. To compile glib you need a cross-compiler and libraries extracted from the TV itself (rootfs). As cross-compiler I used a standard arm-linux-gnueabi available as a package in kubuntu (14.04). The compiler version in my case is: arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.7.3-12ubuntu1) 4.7.3

So, to start you need to obtain the rootfs. What I did was look at the kernel command line (dmesg | grep root=/dev), which gave:

Kernel command line: root=/dev/mmcblk0p26 ro rootfstype=squashfs mem=1504M ddr0mem=1024M ddr1mem=1024M ethaddr=11:11:11:11:11:11 rev=1 console=ttyAMA0,115200n81 bver=3.04.06 chip=H13B0 quiet loglevel=0 snapshot resume=/dev/mmcblk0p44 devtmpfs.mount=1 rootwait emmc_size=0x0ec000000 sbkey=0x7f5e0000 modelopt=10000101011 hwopt=201204001004002002 portProtection ToolOpt=33764:29201:25227:64797:10406:2364:35407 countryGrp=4 debugMode=5 modelName=111 serialNum=410RAJVAV108 cmdEnd

Then I dumped the rootfs (from /dev/mmcblk0p26) in an ssh session on the TV.

====

To summarize:

- get the rootfs dump

- get some toolchain up and running.

- get the sources of glib-2.34.3; try to cross-compile using something like:

./configure --host=arm-linux-gnueabi --disable-option-checking --prefix=/home/andrei/tmp/lg_tv/sopcast/build --cache=andy.cache

For reference I attached my cache file (rename andy.cache.txt to andy.cache).

Let me know how this goes.

===

Btw. what version of webos you have installed on your TV ? If you run under webos 2.x, you could try directly my binaries.