Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kodi/xbmc addon #2609

Closed
ghost opened this issue Nov 4, 2016 · 45 comments
Closed

Kodi/xbmc addon #2609

ghost opened this issue Nov 4, 2016 · 45 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Nov 4, 2016

Hi, i have been following Tribler since 5 years or so from distant. I am planning to do a kodi addon that will call tribler as a process and communicate it with localhost network queries. Even though kodi has a bundled python interpreter, it is not a very succedable approach directly run tribler with the embeded interpreter because cbinding of lots of underlying modules need to be compiled for each various py version and os platform.

Basically addon part of it will only provide ui and player, tribler will run p2p backend.

The point of this app is to link millions of kodi user with dispersy. i am not overrating the numbers, literaly millions of people.

But the hard part is most of the users (℅90) are running kodi in android os (not java with emdded py interpreter) with their stb boxes, or their smart tvs.

What do you suggest me about

  1. removing wx from tribler app and making localhost control?
  2. Cross compiling cbindings on android? i believe jenkins already has a limited version of this.

Thanks

@synctext
Copy link
Member

synctext commented Nov 5, 2016

Great news, love to have more dev people onboard. Yes, jenkins has an almost functional Android version. https://jenkins.tribler.org/job/Build-Tribler_Android-Python/69/
Next week the Wx support is likely to be removed from devel. Martijn has a QT gui and api to the core close to readiness.

Kodi and vlc inclusion has been on my Xmas list for years...

@synctext synctext added this to the Backlog milestone Nov 5, 2016
@synctext
Copy link
Member

synctext commented Nov 5, 2016

So 1) is already done. 2) no clue about cbindings. @devos50 any ideas?

Example of how to talk to the new core: https://github.com/boogiekodi/tribler/blob/devel/Tribler/Test/test_as_server.py#L356
Ongoing Android work: https://github.com/brussee/tribler/tree/android-app/android/TriblerService/recipes
Brussee is finishing up his thesis work this month, see his Python4Android stuff. Thread discussion of past half year: #2231 (comment)

All of the 22 students and their projects in the lab are here: https://github.com/Tribler/tribler/wiki#current-items-under-active-development (but I guess you've seen our attempts at documentation if you followed us for 5 years..)

Apologies in advance, that we're not always easy to reach and stuff is quite poorly documented.

@brussee
Copy link
Member

brussee commented Nov 5, 2016

Hi @boogiekodi good to have you on board!
Also good news for us:

  1. JSON API is already usable on localhost to control Tribler

  2. Already done for ARMv7 devices (and compatible newer devices); x86 and x64 may not be that much extra work. Tribler, VLC and FFMpeg have all been successfully cross-compiled (including all necessary bindings and all dependencies!) for Android 4.3 or newer. I used and extended P4A for this ("service_only" bootstrap): https://github.com/kivy/python-for-android
    That is part of what I've been doing the last year. See https://jenkins.tribler.org/job/Build-Tribler_Android-Python for a working debug .apk

Take a look at TriblerService here #2476 because you can run Tribler as a standalone Android service. It has 1) the JSON API and 2) CPython interpreter and all libraries inside.
TriblerApp is a normal Android app that provides a GUI around the TriblerService.
Any questions, please ask!

@ghost
Copy link
Author

ghost commented Nov 5, 2016

Thanks, for your comments and clearification, json api seems like exactly what i need.

Let me consume the solutions you propose. Also thanks for the nice attidude and open source motivation you have, considering the size of the project you are managing i think this also must be mentioned.

@devos50
Copy link
Contributor

devos50 commented Nov 5, 2016

@boogiekodi sounds good!

I'm currently in the process of completely separating the Tribler core from the GUI and a release of Tribler 7 is near (currently running into some Windows-specific issues unfortunately). I also refactored huge parts of the Tribler core the past nine months to make Tribler more friendly for developers. We provide a REST API over HTTP so you can easily fetch information from the Tribler core or control it. Note that this API is currently pre-alpha and subject to change.

We also provide our own video server (streamed over HTTP) so you can just connect VLC or any other HTTP-stream compatible video player to that.

I'm really looking forward to it and if you have any questions, please let us know!

@ghost
Copy link
Author

ghost commented Nov 8, 2016

i have managed to run tribler core with lots of effort on winx86 & win64 interpreters inside kodi. especially plyvel and leveldb caused massive pain. My current plan is to cross compile all bindings on py26 + py27. And before implementing tribler core to kodi first i need to implement a binary module installer addon, because you can not install binary modules (so,dll,pyd etc) to kodi in normal circumstances. As you can imagine this will take lots of time but i like to do it for fun. This way i can also have tribler code running actually in Kodi interpreter.

For plan B:
Also is it possible to add a command line argument to tribler main for, nogui, server only option switch.
also another runtime options to choose restapi listen ip, port, and statesdir selection. It would also be awesome if there was a portable version of V7 to call directly as a process without messing anything. Do i ask too much? :)

@synctext
Copy link
Member

synctext commented Nov 8, 2016

solid progress. congrats. module installer sounds interesting, saw the Kodi plugin and external repo mechanism is quite mature.

Is a .ini file not sufficient, versus additional cmdline switches? Guess that with no .ini on filesystem the cmdline args can determine the behavior.

@devos50
Copy link
Contributor

devos50 commented Nov 8, 2016

@boogiekodi good work! 👍

especially plyvel and leveldb caused massive pain

Yes, these are quite challenging to compile under Windows. Have you followed the guide I've written a while ago (http:https://tribler.readthedocs.io/en/latest/development/development.html#leveldb)?

My current plan is to cross compile all bindings on py26 + py27

Out of curiosity, why do you need to compile for Python 2.6? Are there devices that are only supporting an older version of Python?

Also is it possible to add a command line argument to tribler main for, nogui, server only option switch

You can run Tribler headless already using twistd (the exact command for this is twistd -n tribler). However, starting Tribler headless can also be wrapped in a script (something like run_tribler_headless.py since the twistd script is only a few lines of Python code. Note that the twistd plugin already supports various run-time options and flags (see https://github.com/Tribler/tribler/blob/devel/twisted/plugins/tribler_plugin.py#L27).

Please let me know if you have any more question and we are more than willing to help :)

@ghost
Copy link
Author

ghost commented Nov 8, 2016

@devos50 i just saw the docs, it would be much easier for me i had seen that earlier especially for leveldb.

why do you need to compile for Python

Because xbmc,13, Kodi 14,15,16(jarvis) uses py26, Kodi 17 (krypton) py27.And krypton is not even released offically yet. So py26 is mandotary.

You can run Tribler headless already using twistd

when i have the dependecy modules, running the tribler from pythonically with imports is no problem. i asked for commandline arguments because of my plan B.

if this cross compiling modules goes out of my hand, i am planning to run the released binary directly with process.Popen(*args). This is an option for:

  1. No need for binary modules, just call the prebuilt tribler binary.
  2. No need for distribution of binaries, just download tribler V7 for the platform its build for, from tribler.com or your distro site.
  3. It would be much nicer if there is a portable option with the downloaded file, if not make it portable, or install if its not installed using os,shutil,Popen etc. And call it.
  4. Write a thin rest client with asyncore or in some pure pythonic native way that communicates with the called process that i called with a specific rest port from a specific states dir that i control.

@synctext
I believe it would be much nicer to have a option argument, but if there it is not available, i think it is possible to survive with a config file too. The difference is sometimes it is possible that a user can have a tribler installation in his system, if i call it from Kodi i need to manipulate the config file of the user installation and this a very dirty method. I know you are using config obj and those variables i request is almost available in there, i think best approach would be a command line argument for triblerbinary to use a specified config file (like tribler --config path/to/config), this way i can use normal installation of user but with my config pointing that make server only, use this ip, this port, and this states directory.

@brussee
Copy link
Member

brussee commented Nov 8, 2016

@boogiekodi

if this cross compiling modules goes out of my hand, ...

This is what I managed to do for Python 2.7 on Android with P4A:
dependency_tree svg

@ghost
Copy link
Author

ghost commented Nov 9, 2016

@brussee
thanks for that graph it is insanely helpful to identify he packages, i have checked Py4A, dont have much experience on it, from what i can see from it Py4A cross compiles all C libs and generates a master library and interfaces main lib with Java (Please comment on this one, this is my assumption.), but this is not how kodi interpreter works. Interpreter is also cross compiled and interpreter itself loads the libraries.

If my assumption is correct my approach is to cross compile all Cbindings as static as possible, (except openssl, python also has openssl binding so i need to dynamic link against this one, or compliant one that wont throw seg faults). So i need to create a build system for all above and pack them as wheels, and distrubite and dynamically install those wheels to corresponding platform using the binary installer kodi addon.

before implementing tribler core to kodi first i need to implement a binary module installer addon,

It will be though but i think it is achievable.

@ghost
Copy link
Author

ghost commented Nov 9, 2016

this is why plan A is scary challanging but interesting for me :)

@synctext
Copy link
Member

@boogiekodi How many people roughly us your repo?

For planning ahead coming year it's good think out some scenarios. I'm especially afraid of spam and pollution. Nobody got that ever working without central servers. After 11 years of hard work with Tribler, success should not come too soon...:)

@ghost
Copy link
Author

ghost commented Nov 10, 2016

@synctext
i think there is a misunderstanding, i am not a part of teamkodi, i am 3rd party addon developer and dont have any connection with Kodi brand or foundation, i think you are referring teamkodi located ad https://github.com/xbmc/xbmc, so there is only me for my project. Sorry for disappointment :)

@synctext
Copy link
Member

Perhaps a misunderstanding on the misunderstanding :-)
Yes, saw you provide your own repo repository.boogie-x.x.xx.zip. How many monthly-active-users do you roughly have for your repo stuff and/or UMP software ? 100-ish or 1000-ish?

@ghost
Copy link
Author

ghost commented Nov 16, 2016

Even though it is up for a year , collected stats only for 2 months, about 600.000 unique device has installed in 2 months, (there is a variation of %10 of those users are VPN ghosts though). And after 1 year it started to crash any (free or non profit) http server that i used so i decided to use P2P for distro. Finally after 1 month stat service also wanted me to pay, and i had disagreements with the server guys that i used for distro so i stopped distrubuting.

And ump is just a sidewalk in KODI highyway, and also what UMP userbase is quite faitless they are exploding masses, they are flashing, KODI though is stable "nerd" heaven and those flashing crowds are actually the products of actualy kodi users.

Also another use case, nowadays, TVDB, TMDB, Fanart TV all of those free metadata providers for media is threatining KODI devs cos they are pulling TBs of data of json, even though they use local caching and etc. So dispersy can be an overlay for those as well.

@synctext
Copy link
Member

600k, nice!
Indeed, once one player proves speed and proper functionality, we hope others will copy.
We're polishing our dev docs a bit.

@synctext
Copy link
Member

@boogiepy A new master student since this month until the summer working full-time on Android/ARM compatibility of Tribler and Dispersy engine and related matters: @MaChengxin. See his nice first task on documentation: #2060 (comment)
@boogiepy we could probably provide you with an account on our jenkins.tribler.org machine for automatic building, unit testing + free 1Gbps download speed of installers from our campus network.

@ghost
Copy link
Author

ghost commented Dec 5, 2016

@synctext
i checked the documentation in the links given, however it is kind of a seperate approach with the way i have chosen. i am building a buildsystem with docker images for building cross platform .wheel following PEP-513 manylinux (when applicable) specification. This way packages need to be dynamically loaded to cpython through ABI.

currently buildsys is building:
cp26-cp26m-manylinux1-i686
cp26-cp26mu-manylinux1-i686
cp27-cp27m-manylinux1-i686
cp27-cp27mu-manylinux-i686
cp33-cp33m-manylinux-i686
cp33-cp34m-manylinux-i686
cp35-cp35m-manylinux-i686
cp26-cp26m-manylinux1-x64
cp26-cp26mu-manylinux1-x64
cp27-cp27m-manylinux1-x64
cp27-cp27mu-manylinux-x64
cp33-cp33m-manylinux-x64
cp33-cp34m-manylinux-x64
cp35-cp35m-manylinux-x64
cp26-cp26m-mingw32-i686
cp26-cp26mu-mingw32-i686
cp27-cp27m-mingw32-i686
cp27-cp27mu-mingw32-i686
cp33-cp33m-mingw32-i686
cp34-cp34m-mingw32-i686
cp35-cp35m-mingw32-i686
cp26-cp26m-mingw64-x64
cp26-cp26mu-mingw64-x64
cp27-cp27m-mingw64-x64
cp27-cp27mu-mingw64-x64
cp33-cp33m-mingw64-x64
cp34-cp34m-mingw64-x64
cp35-cp35m-mingw64-x64

i have only approx. 6 hours a week to invest in this project so dev. is quite complex and timeconsuming but i am managing it to work but slow. Currently trying make buildsys more universal.

later i will implement arm5,6,7,8 toolchains with manylinux variatons.

and finally will also implement android and bionic clib with ndk for android (hopefully). I have a modified distutils pretty flexible for cross compiling so i can see the light at the other end of the tunnel.

I am telling all those stuff because, this way there will be no need for CI tools (jenkins) and testing because all packages will be built once and tested once. Then they wont be updated again.

However at the end of the day there will be a need for a server to distribute the binaries (like pypa) so i would definetely appreciate for the bandwidth.

Sorry i dont have any docs or code in repo yet. I keep changing the structure of buildsys.

@thoradia
Copy link

Hello,
I am very interested in running tribler as a Kodi add-on under LibreELEC 8.0 (Kodi 17 Krypton). I have already packaged most of the Python requirements, and I am in the process of packaging the rest. To carry on, I would need to know how to start tribler (headless with system.d) and how to bind it with Kodi (is someone writing a Kodi add-on?). Thank you in advance.
I am looking forward to contributing to this project.

@devos50
Copy link
Contributor

devos50 commented Jan 17, 2017

@thoradia that's nice to hear! You should definitely get in touch with our new student who also works on Tribler as a Kodi plugin.

You can start Tribler headless using the twistd application, i.e. in bash: twistd -n tribler. Note that twistd is just a Python script with a few lines of code. I will consider adding something like --headless to the tribler.sh script.

@synctext
Copy link
Member

synctext commented Jan 17, 2017

@thoradia wow, you have been busy! (https://github.com/thoradia/LibreELEC.tv/branches)
I'm a decade long Debian user, LibreELEC is quite interesting. Could you share your repo of ongoing Tribler/Tribler dependencies work?

@boogiepy Browsed through the PEP-513 and CentOS 5 build environment, quite a complex route to understand; but very impressive.

At Delft university students @EinNarr @MaChengxin are now working full-time in our lab on getting Android and Kodi support operational. @devos50 is our chief-of-code, he knows the broader stuff.

@EinNarr
Copy link
Contributor

EinNarr commented Feb 7, 2017

@boogiepy @thoradia started playing with Kodi for few weeks. Having problem importing the dependencies and modules.
Could you please share your code and progress?

13:58:56 T:140014943517504  NOTICE: Running the application...
13:58:57 T:140014943517504  NOTICE: starting zeroconf publishing
13:58:57 T:140014943517504  NOTICE: starting upnp client
13:58:57 T:140013199136512  NOTICE: ES: Starting UDP Event server on 127.0.0.1:9777
13:58:57 T:140013199136512  NOTICE: UDP: Listening on port 9777
13:59:07 T:140013249492736   ERROR: CCurlFile::FillBuffer - Failed: Timeout was reached(28)
13:59:07 T:140013249492736   ERROR: CCurlFile::Open failed with code 0 for https://offshoregit.com/tvaresolvers/tva-common-repository/raw/master/addons.xml.md5
13:59:07 T:140013249492736   ERROR: Open - failed to open source <https://offshoregit.com/tvaresolvers/tva-common-repository/raw/master/addons.xml.md5>
13:59:07 T:140013249492736   ERROR: CRepositoryUpdateJob[repository.xbmchub] failed read checksum for directory 'https://offshoregit.com/tvaresolvers/tva-common-repository/raw/master/addons.xml'
13:59:27 T:140013777966848  NOTICE: INDIGO NOTICE: STARTING INDIGO SERVICE
13:59:27 T:140012905555712   ERROR: CPythonInvoker(2, /home/einnarr/.kodi/addons/plugin.program.xbmchub.notifications/service.py): /home/einnarr/.kodi/addons/plugin.program.xbmchub.notifications/service.py not found!
13:59:27 T:140012905555712   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.IOError'>
                                            Error Contents: (2, 'No such file or directory', '/home/einnarr/.kodi/addons/plugin.program.xbmchub.notifications/service.py')
                                            IOError: (2, 'No such file or directory', '/home/einnarr/.kodi/addons/plugin.program.xbmchub.notifications/service.py')
                                            -->End of Python script error report<--
13:59:27 T:140013777966848  NOTICE: INDIGO NOTICE: Indigo has NOT ran before
13:59:27 T:140013777966848  NOTICE: INDIGO NOTICE: STARTUP CLEAR CACHE ACTIVATED
13:59:27 T:140013777966848  NOTICE: INDIGO NOTICE: STARTUP PURGE PACKAGES ACTIVATED
13:59:27 T:140013777966848  NOTICE: INDIGO NOTICE: SCRIPT BLOCKER ON
13:59:27 T:140013777966848  NOTICE: INDIGO NOTICE: Checking for Malicious scripts
13:59:28 T:140013761181440   ERROR: GetDirectory - Error getting zip:https://special%3a%2f%2fhome%2faddons%2fpackages%2fscript.module.twisted-13.2.1.zip/script.module.twisted/
13:59:28 T:140013761181440   ERROR: CAddonInstallJob[script.module.twisted]: could not read addon description of special:https://home/addons/script.module.twisted
14:06:55 T:140013249492736   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ImportError'>
                                            Error Contents: No module named Tribler.Core.Modules.process_checker
                                            Traceback (most recent call last):
                                              File "/home/einnarr/.kodi/addons/plugin.video.tribler/tribler.py", line 2, in <module>
                                                from lib.tribler.TriblerGUI.core_manager import CoreManager
                                              File "/home/einnarr/.kodi/addons/plugin.video.tribler/lib/tribler/TriblerGUI/core_manager.py", line 18, in <module>
                                                from .Tribler.Core.Modules.process_checker import ProcessChecker
                                            ImportError: No module named Tribler.Core.Modules.process_checker
                                            -->End of Python script error report<--
14:06:55 T:140014261257984  NOTICE: PulseAudio: Opened device Default in pcm mode with Buffersize 150 ms
14:06:55 T:140014943517504   ERROR: GetDirectory - Error getting plugin:https://plugin.video.tribler/
14:06:55 T:140014943517504   ERROR: CGUIMediaWindow::GetDirectory(plugin:https://plugin.video.tribler/) failed
14:07:12 T:140013249492736   ERROR: EXCEPTION: Non-Existent Control 1
14:07:14 T:140013249492736 WARNING: Attempt to use invalid handle -1
14:11:45 T:140014261257984 WARNING: Previous line repeats 2 times.
14:11:45 T:140014261257984  NOTICE: PulseAudio: Opened device Default in pcm mode with Buffersize 150 ms

@hbiyik
Copy link

hbiyik commented Feb 10, 2017

@EinNarr i haven't been looking at this project for a while and my code is totally pseudo right now, (as discussed above i was trying to make cross platform support). But looking at the traces, it seems like

import sys
sys.path.append("path to tribler core dir")

will fix your problem. I dont exactly remember how triblerGui initializes the paths, and you can also add this dir to path with < extension library="path to dir" > tag in addon.xml.

Sorry for my cloudy statements :) (i am boogie btw)

@EinNarr
Copy link
Contributor

EinNarr commented Feb 10, 2017

Thanks for help. I was trying to make tribler a script module of Kodi, but your way is definitely more efficient.
How did you make tribler in the back ground? Seems that the main function will be executed every time your click something in the add-on. It works like a state machine. How did you manage to make tribler run continuously in the background?

@hbiyik
Copy link

hbiyik commented Feb 11, 2017

@EinNarr Best practice is to run tribler core as a service addon service.triblercore,

http:https://kodi.wiki/view/Service_add-ons

service addons are run whenever kodi is launched or Kodi user is logged in. This way you can talk with rpc from another client addon like plugin.video.triblerclient.

@EinNarr
Copy link
Contributor

EinNarr commented Feb 17, 2017

@hbiyik Thx for your advice. I am trying service add-on, it should be what I need.
Have you ever experienced the problem when shutting down tribler core in Kodi? I tried send request"shutdown", it works when I run tribler core in terminal, but not in Kodi. The sender process will deadlock after sending the request. Seems that it can communicate on port 8085, but cannot receive any reply.

@synctext
Copy link
Member

Good job to post on their forum: http:https://forum.kodi.tv/showthread.php?tid=306246

@synctext
Copy link
Member

synctext commented Mar 6, 2017

Cool! Tribler downloading is working.
No need to implement "My Channel", just focus on streaming and keyword search...

@hbiyik
Copy link

hbiyik commented Apr 18, 2017

@synctext @brussee @devos50 @EinNarr @thoradia

Hi
Good news, Tribler Core works under kodi/xbmc in standalone now. Left me with red eyes for some nights but i liked the end result.

I have tested for windows and android 5.1.1 myself and verify that it works, also works on 32bit linuxes if i havent broken some stuff in latest commits, but can be fixed easily so consider it done too.

I have also done some small modifiactions on Tribler.Core* and used a modified twisted & zope & pywintypes also.

See:
http:https://forum.kodi.tv/showthread.php?tid=312515

All repos:
https://github.com/hbiyik?tab=repositories

@EinNarr
Copy link
Contributor

EinNarr commented Apr 18, 2017

@hbiyik It is sooo awesome. Sounds like you brought a brand new possibility for all kinds of Kodi add-ons! How shall I install that? Cloning all the your repos of tribler/ triblerCore/ and all the script add-ons?

@hbiyik
Copy link

hbiyik commented Apr 18, 2017

i have just tested under linux, yes linuxes also work like a charm, just make sure your kodi is 32bit. 64 bits not yet compiled.

@EinNarr
Yeah just clone them under addons folder, see below if you face issues
How to setup a develeopment environment under kodi/xbmc.
https://github.com/hbiyik/script.module.triblercore/issues/1

@hbiyik
Copy link

hbiyik commented Apr 19, 2017

Here is the overall dependency map
https://github.com/hbiyik/script.module.triblercore/issues/2

@synctext
Copy link
Member

@hbiyik can you help us out compiling everything from scratch?
Ideally we would like to integrate this work into Jenkins.tribler.org continous build environment.

@hbiyik
Copy link

hbiyik commented Sep 14, 2017

@synctext let me update the latest in a few weeks, long story short, running tribler pythonically under kodi
environment is possible but is a biiiiig biiig pain, i think best case would be create a server binary and not mess with all the complicated stuff and call the binary with popen. I will update my current status in a few days.

@EinNarr
Copy link
Contributor

EinNarr commented Sep 15, 2017

@hbiyik
Great thanks for responding.
Looking forward to your update.
I have be working on fixing the automatic seeding module called credit-mining for the past few month. Struggling to get it work on low-cost Kodi devices.

@hbiyik
Copy link

hbiyik commented Sep 19, 2017

@EinNarr @synctext @brussee

hi,

long time no see, so my final approach was to import tribler pythonically to embedded python interpreter, i have developed some good addon to achieve that, but some problems arrised. Not gonna go much in detail about it, because it will take pages of execuses :), the biggest ones are, kodi runtime dependencies are varrying too many after a while, and the 2nd biggest one, tribler seriously does not stop sometimes, generally when dispersy is busy. This causes kodi to raise SytemExit Exception by force, and this causes twisted (also minitwisted) to crash. I found my self patching twisted against SystemExit and realized something was wrong. To move on with this approach, tribler and dispersy need to be heavily modified imho, and this causes time/ resource and wasted energy and too much effort for less gain.

The new (actually old) approach is create a standalone binary: triblerd.

https://github.com/hbiyik/tribler/commit/f2ff221ffce335ba3e5a760d8fd4e373c225b0f8

See commit above, it is ready pythonically, and builadable on windows, also comforst the @brussee environment variables for his android addon. But it is not specific for for headless tribler only it actually is a commandline wrapper for twisted plugins. So with this binary now you run tribler headless, market plugin, trustchain crawler, and tunnel helper plugin. This also comforst for future twisted plugins as well, following a very basic structure.

For android there is already a build setup for it, all needs to be done create 2 apks, 1 android client, 1 android triblerd app, client will require triblderd app to be installed and communicate with rest.

For kodi, everything will be done as android apk, kodi will require triblerd app to be installed and connect to it with rest through loopback local adapter.

There are some other situations to consider here like, what is going to happen if 2 clients want to connect same triblerd etc but first i would like hear your feedback before moving on

https://github.com/hbiyik/distro/tree/master/dataserver/tribler

you can download the windows binary to play from the above link (hope it works and some dlls are not missing)

@hbiyik
Copy link

hbiyik commented Sep 19, 2017

for android triblerd, here is a very nice gui for reference.
https://play.google.com/store/apps/details?id=org.acestream.media&hl=en

@synctext
Copy link
Member

impressive work as always!
Please help us out to create .apk releases of your Triblerd approach on jenkins.tribler.org
btw By the end of the year we aim to gut at least half the code of Dispersy..

@hbiyik
Copy link

hbiyik commented Sep 20, 2017

@synctext ok, ill skip linux part and jump to android directly. will not cause much problem because @brussee 's work already is there. When i finish the dev env, ill integrate to jenkins.

@hbiyik
Copy link

hbiyik commented Oct 15, 2017

@devos50 @EinNarr
do we really need psutil, it does not play well on android, needs to be ported.

@synctext
Copy link
Member

@hbiyik appologies for not seeing your post earlier.
@EinNarr is depending on Android or Kodi to finish his thesis work coming weeks/month.

We are getting ready to erase Dispersy from Tribler.. IPv8 by @qstokkink will replace a large part of existing code for upcoming V7.1 release. It will take a few release to completely die obviously. We need to move channels to our Trustchain fabric (our core blockchain research). We have some very fancy crypto now operational: #2778 (comment)

Trying to get my head around your "commandline wrapper for twisted plugins" based triblerd work.
For Android "client will require triblerd app to be installed and communicate with rest". That sounds like solid progress! Please help @EinNarr with replicating your environment to build for Android on possibly Jenkins.tribler.org . Perhaps our new expert @xoriole can help.

About psutil, this is a new tool for debugging stats only. Is optional in my opinion, certainly for headless mode.

@hbiyik
Copy link

hbiyik commented Oct 19, 2017

@synctext
as long as no new c/c++ modules with the changes, it wont affect triblerd, it just is a wrapper anyways.

@EinNarr
Please check standalone_server branch.

  • rebased with 7.0.rc3
  • x86 & arm7 recipes ported to android (building but may run segfaults, did not test throughly)
  • using buildozer only, no need to deal with p4a gizmos.
  • I havent pushed my commits lately i have to push this weekend or sooner

https://github.com/hbiyik/tribler/tree/standalone_server

@xoriole Hi i am using a very old version (0.6.1-found it on previous ports of p4a) of psutil on android, but Process related modules seems to be working. Problem is android ndk does not have all linux headers (ndk<21), to support psutil fully there must be kernel level porting, which is too much pain for little gain. Do you have a suggestion about this?

@thoradia
Copy link

thoradia commented Nov 9, 2017

After nearly a year I finally found a way to easily build Python packages for LibreELEC (aarch64/arm/x86_64). I could now wrap Tribler in a native add-on for LibreELEC. Where do I find the source of Tribler for Kodi?

@ichorid
Copy link
Contributor

ichorid commented Jun 12, 2020

continued in #2694

@ichorid ichorid closed this as completed Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants