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

Change Player Configuration #4

Open
kingleo1 opened this issue Sep 21, 2017 · 23 comments
Open

Change Player Configuration #4

kingleo1 opened this issue Sep 21, 2017 · 23 comments

Comments

@kingleo1
Copy link

kingleo1 commented Sep 21, 2017

Since you are porting the Acestream engine to the RPi, is there anyway you could change the player configuration in your port?

What I mean by player configuration is the max amount of connections and peers (current default is 50) and also add a buffer size of 30 seconds for live feeds (no current setting exist).

I've searched inside the files and found a file playerconf.pickle at acestream/androidfs/sdcard/.ACEStream which holds those configurations. I followed the syntax format of the file and added the mentioned changes, but when playing a stream on the RPi I still see only 50 connections max and no live buffer.

Any help in this area will be greatly appreciated.
Thank you.

Edit:
The syntax of the playerconf.pickle file with the required settings is:
(dp0
S'disk_cache_limit'p1L1073741824Ls
S'max_connects'p2I200s
S'max_peers'p3I100s
S'total_max_download_rate'p4I0s
S'ad_storage_limit'p5L536870912Ls
S'total_max_upload_rate'p6I0s
S'live_buffer_time'p7I30s
S'player_buffer_time'p8I30s.

@mikemyl
Copy link
Owner

mikemyl commented Sep 21, 2017

Thanks for your comments? Cool, are these going to make the playback smoother?

@WolfganP posted a link in another issue : https://twistedlinux.wordpress.com/2016/02/29/run-acestream-under-openelec-on-raspberry-pi-2/ . This guy seems to customize acestream settings, and the syntax is slightly different from what you posted above. Can you give it a try and let me know if it works? I can then merge it or give u write access to the repo so that you can merge it yourself!

Cheers!

@WolfganP
Copy link

Yes, there are other examples of playerconf.pickle around and the syntax seems to be different (ie http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=2000&page=1#pid15376)

@kingleo1
Copy link
Author

kingleo1 commented Sep 22, 2017

@sestus "Cool, are these going to make the playback smoother?"

Yes very much so. The max number of peers currently set is 50, and by increasing that number to 100 in my laptop setting I get a smoother run for the same streams. I also increased the max number of connections just in case. As for the live buffer setting, it allows the stream to load 30 seconds worth of data and then start to run it which helps in overcoming any hiccups while playing the live stream for any reason related to internet connection quality.

The links posted in the comments are not the idle settings because one has the max peer number set to only 30 and the other is the default 50. One of them has the live buffer setting set to 35 seconds which is about the same.

@WolfganP The procedure you linked is mainly for OE/LE but I'm using OSMC on the Rpi. I don't have the startup/shutdown steps at all and Acestream works just fine (aside from the constrained player config). Correct me if I'm wrong but I'm guessing the startup/shutdown steps are required because OL/LE do not have a 'proper' OS behind Kodi as opposed to OSMC which has a customized Debian distro.

@mikemyl
Copy link
Owner

mikemyl commented Sep 22, 2017 via email

@WolfganP
Copy link

@kingleo1 The start and stop scripts I borrowed from the posts are to setup the environment in raspbian (and derivatives) with chroot and the like to mimic the minimal Android run environment needed by Acestream.
I have no idea if they are needed in OSMC, sorry about that.

@kingleo1
Copy link
Author

kingleo1 commented Sep 22, 2017

@WolfganP I see. So if it's mimicing the Android run environment in Raspbian that means it doesn't make use of the Plexus addon. I think that's why I didn't need the startup/shutdown steps because I have Plexus and when I run an Acestream torrent it is actually the addon that is triggered and so it starts and ends the Acestream engine without needing it to be started in the background like in those procedures. Seems it's not a question of difference between OE/LE and OSMC but rather the presence of the Plexus addon in Kodi.

@sestus As far as I know the syntax in my first post is correct. Checking both links provided in this thread confirms it as well. I'm no programmer (I just know the basics really), but it appears to follow the following syntax:

  1. Each entry starts with a capital S and end with a small s.
  2. Each setting name is contained in a single quotation. Also, the setting names are correct (checking the links).
  3. The p is like a serial number that increases with each entry.
  4. The capital I is followed by the value of each entry.

As I said in my first post, I have those settings in the playerconf.pickle file on my OSMC setup but sadly it doesn't work. I thought may be another file needs changing in the Acestream engine files. Another possibility might be the permissions on my setup. I'm not an experienced linux user, but I know that permissions can play a big role in linux for read/write/excute of files. The way I changed my playerconf.pickle file was to log on as the default OSMC user and use "sudo nano path\filename" to make the changes. Not sure if that messed up permissions or not.

You can check for yourself by playing any acestream torrent in Kodi and then pressing the 'm' key to show the player controls. Acestream has a window that shows the download/upload bandwidth used and the number of peers currently connected. For me this number never exceeds 50 and that's how I know the settings are not really applied. To make sure it was not the stream itself, I checked the same link on my laptop (which has the same settings) and it reaches 99 after a 30 second of buffering.

I want to be of more help, but that's the extent of my knowledge really. Sorry.

@WolfganP
Copy link

The Acestream engine exports an useful status page that you can monitor from other device, it's located at http://yourserverip:8621/app/monitor and many of those parameters are shown while the engine is running.

@mikemyl
Copy link
Owner

mikemyl commented Sep 23, 2017

@kingleo1 I (think I) have successfully updated the configuration. Could you get my latest commit and verify?

@WolfganP I can't seem to access the monitor page. It denies access (Acestream engine is running on raspberry pi - i m trying to access from my laptop). IS there any setting that allows other IPs to access the monitor page?

@WolfganP
Copy link

WolfganP commented Sep 24, 2017

@sestus I believe you need to add --service-remote-access to acestream engine args when launched.

@YaPaY
Copy link

YaPaY commented Sep 24, 2017

Is there any way to use any ace link from shell with this program and broadcast to any ports. I am asking this because I am using libreelec on intelnuc and I have got a Raspi 2 wit Rasbian. I can play acestream links with your program + plexus on nuc.

@kingleo1
Copy link
Author

So to start fresh I made a new installation of OSMC with the latest Kodi ver17.4 to test. Installed Plexus, and the latest Acestream with the new configurations. Then went to install Castaway, but couldn't find the Repo for it anywhere! Searched for the addon zip file but couldn't find that either! The only thing I found was this https://github.com/kodil/kodil/tree/master/repo/plugin.video.castaway but it fails to install. Probably not the official natko release because I believe his last version was 0.2
Anyway, does anyone have the Castaway addon zip?
Any version would do, since @sestus has updates the py files for the P2P section and also the subreddit feature in castaway works with no need for updates (needed to get the acestream links to play them from other sources than the P2P section).

@WolfganP
Copy link

@kingleo1
Copy link
Author

@sestus btw, I checked the playerconf.pickle file and the 'max_connects' entry is missing. It should be at least a 100 like 'max_peers'. Also the download directory entry is a new addition and this means it will save the live stream on the sdcard of the RPi which would fill up fast as each 1 hour of streaming would cost maybe 2GB or so (depending of course on the source bitrate). Not sure if there is a setting to automatically clear the cache upon shutdown. There are also entries to allow remote access and intranet access, care to explain what these do?

In the meantime, I'm still looking for a way to install castaway (or any other addon that plays acestream links).

@kingleo1
Copy link
Author

Ok so I install an addon called Pro Sport that picks up acestream links from reddit and play them on kodi. Tried to play a stream but it started the countdown to the Acestream engine but ended without starting the job. I checked through terminal on OSMC and the engine file were successfully copied in the correct location. I used this command to copy the files:
sudo cp -ra ~/mnt/acestream ~/.kodi/userdata/addon_data/program.plexus/
and used that command to mount my NAS share folder:
sudo mount -t nfs nasIP:/shared/folder ~/mnt
It seems that Plexus doesn't recognize the acestream folder that was copied. I made sure to check that it was actually copied using the ls -a command going through the folders until the 'playerconf.pickle' file.
Is this a problem with permissions?
@sestus is there a way to provide a tar compressed file of the engine so that I can directly add it to OSMC through a wget command?

@kingleo1
Copy link
Author

kingleo1 commented Oct 3, 2017

Figured out a way to download the files directly to the RPi from github. Sadly wget won't work, but svg (subversion) works. The thing is it's not a default package in OSMC, so it needs to be installed first using:
sudo apt-get install subversion
after that to copy the files of this git, the code should be:
svg export https://github.com/sestus/acestream-openelec/trunk/acestream ~/.kodi/userdata/addon_data/program.plexus/acestream
(make sure to have the path exactly right because is will create a new path if there is any typo).

As for Castaway, couldn't find a place to install it from but found an alternate addon called Pro Sport that can pull acestream links from reddit.

I'll try to test the Acestream player configuration the first chance I get, and will update with the results.

@mikemyl
Copy link
Owner

mikemyl commented Oct 3, 2017

Cool! Regarding the parameters you asked above I just picked a random .pickle that I found on the internet :) . The remote-access related options were an attempt to be able to see the monitor page (WolfganP suggested that these options might do the trick! ). Any updates, let us know!

@kingleo1
Copy link
Author

kingleo1 commented Oct 6, 2017

Feedback after test run:

  1. The number of 'seeds' connected actually reached 100, which means it's working.
  2. The is no upload done at all! This is bad because it simply turns everyone into a 'leech' and would kill the stream if enough people use it. I think this is because the 'max_connects' entry is missing (check my previous comment). If it's using all connections to download, then there are no connections left to upload. An entry for 'max_connects' needs to be added with a value higher than 100 (min of 125 since upload to download ration on ADSL is usually 1 to 4).
  3. Trying @WolfganP command to view the engine status/monitoring details failed. IT gives an 'Access Denied' page. Not sure if authorization is required to be set in the configuration file.
  4. General performance of a 720p/2500kbps stream was NOT satisfactory. Not sure why. May be it was the live stream itself. I have streamed HD movies before using my internet and same RPi and it ran smoothly (although it was not through Acestream but rather normal file-sharing services).

Will be doing more testing in the coming days.

mikemyl added a commit that referenced this issue Oct 15, 2017
mikemyl added a commit that referenced this issue Oct 15, 2017
@kingleo1
Copy link
Author

After testing 10 different live streaming events on my RPi3 in the past couple of weeks (using wireless connection), it's clear the new settings didn't improve the viewing for HD (720p) streams. They lag and stutter just like they do in an old installation of the engine (3.15) with old settings (only 50 connections).
In fact for the very first time, I got the temperature warning (the red thermostat icon at the top right corner) while streaming 2 times. It seems increasing the connections to 100+ puts too much load on the Pi as it streams.
Opening the same streams on my old laptop (Dual Core Pentium 1,8GHz 1MB Cache - RAM DDR2 2GB - Windows 7), they ran smooth enough with very few lags each while connected wirelessly in the same spot as the Pi.
Note that the same RPi can handle playing HD content from a NAS flawlessly.
I think this is due to the Acestream engine being ported to the RPi rather than developed for it.

Anyway, thank you @sestus for you effort, and everyone for their feedback.

@WolfganP
Copy link

@kingleo1 Do you mean 10 simultaneous streams or just 1 at a time? I usually use my RasPi2 as a proxy to watch HD events, and have no issue with performance on the device at all (the only difference is that I'm not using the RasPi as a player but just a non transcoding proxy). Simultaneously I was running Plex server and file transfers via Samba.
Using htop, iotop and nethogs to monitor performance, I never observed too many resources being used (in fact, just 50% of a single processor is being used for Acestream communications + Aceproxy). Check your setup to detect what process is abnormally using resources to make the RasPi

See a sample monitor page for the my acestream setup running an actual stream:

aceenginemonitor

@kingleo1
Copy link
Author

@WolfganP
I'm using my RPi3 to stream and play videos from the internet and from my NAS. It is connected wirelessly to my local network and through HDMI to my TV. I'm guessing the difference is that in your setup the RPi is only a proxy for communication which doesn't need too much processing power.

I tried to connect to Acestream on the Pi while streaming using the "app/monitor" but it says "Access denied."

@WolfganP
Copy link

Playing video doesn't take too much resources either if you use a HW accelerated player (as everything video related is handled via the VPU). Check the RasPi documentation to check which ones support it and monitor your RasPi with the programs I suggested.

@xxx9
Copy link

xxx9 commented Mar 8, 2018

I tried to ssh the code into my RPi2/OE but it wouldnt accept it, but managed to do it manually with mixed results. The code for Castaway wont enter neither
scp *.py :~/.kodi/addons/plugin.video.castaway/resources/lib/sources/p2p_sport/ I cant access this manually as the last bit is not there on my set up? Any help for a beginner would be appreciated.

@mikemyl
Copy link
Owner

mikemyl commented Mar 10, 2018

Hey @xxx9 , I m afraid this won't work anymore. Arenavision guys have introduced some tokens for their acestream links (something like this: http://arenavision2018.ga/02?dficsadx) and my code doesn't work. I tried working their logic out but unfortunately had no luck..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants