Run AceStream under OpenELEC on Raspberry Pi 2 (UPD. with 3.1.6 engine)

I have Raspberry Pi 2 with OpenELEC on it. Yesterday i’ve tried to watch torrent-tv on it without success, AceStreams developers ports it only to windows, linux and android-arm. Not only Torrent-tv requires AceStream, but many of p2p kodi streaming addons and they can’t be used without it.

This is how i run AceStream standalone on my Raspberry Pi 2.
This method also works on Raspberry Pi 3!

There is nasty bug in startup script right now. Please delete or comment excess line in start_acestream.sh like this:

$PERMISSION mount -o bind /dev $ACEADDON/$ACECHROOT/dev
# $PERMISSION mount –bind /dev $ACEADDON/$ACECHROOT/dev

This guide has been updated at 28th November with newer start/stop scripts, with small note to store cache on external drive and 3.1.6 engine!

1. Download acestream-rpi2_v2.zip from here (this archive contains newer engine and scripts) and upload it to your rpi device manually or with scp like this

scp acestream-rpi2_v2.zip root@rpi_ip_address:/storage/

2. Login to rpi via ssh

ssh root@rpi_ip_address

3. Extract engine and cleanup

cd /storage
mkdir .acestream
mv acestream-rpi2_v2.zip .acestream/
cd .acestream
unzip acestream-rpi2_v2.zip
rm acestream-rpi2_v2.zip

4. Fix permission for successful chrooting

chmod +x androidfs/system/data/data/org.acestream.engine/files/python/bin/*
chmod +x androidfs/system/bin/*

5.a. Now add AceStream to autostart.sh

nano /storage/.config/autostart.sh

And add this text and save:

#!/bin/sh
(
/storage/.config/.acestream/start_acestream.sh --client-console --live-cache-type disk --live-buffer 60
)&

5.b. Also we must add graceful shutdown to this file:

nano /storage/.config/shutdown.sh

Add this text and save:

#!/bin/sh
(
/storage/.acestream/stop_acestream.sh
)&

6. Check permissions for start/stop scripts:

chmod +x /storage/.config/autostart.sh
chmod +x /storage/.config/shutdown.sh
chmod +x /storage/.acestream/start_acestream.sh
chmod +x /storage/.acestream/stop_acestream.sh

7. Restart and test.

8. How to move cache to external drive:
Because this approach uses chroot, you can’t use any directory above chroot directory by the design. You have to create soft-link and point acestream to this folder OR run everything directly from external drive. Hard-link can’t be used across different devices also by the design.

My suggestion is to use mount/bind:

mkdir -p /storage/.acestream/androidfs/var/media/storage/.acestream_cache
mount --bind /var/media/storage/.acestream_cache /storage/.acestream/androidfs/var/media/storage/.acestream_cache

Where /var/media/storage/.acestream_cache is the path on your external drive.

And finally, you must edit acestreams pickle configuration file (will be created after first launch).

nano androidfs/system/data/data/org.acestream.engine/files/.ACEStream/playerconf.pickle

Replace everything with:

(dp0
S'total_max_upload_rate'
p1
I0
sS'download_dir'
p2
V/var/media/storage/.acestream_cache
p3
sS'total_max_download_rate'
p4
I0
sS'disk_cache_limit'
p5
L32212254720L
sS'ad_storage_limit'
p6
L536870912L
sS'max_peers'
p7
I50
s.

This changes from step 8 are incorporated into newer start/stop scripts, except pickle file. Just fill HDDPATH variable with yours values (in start and stop scripts). But anyway you MUST fix pickle config-file. Or grab it here.

Feel free to ask questions in comments.

Run AceStream under OpenELEC on Raspberry Pi 2 (UPD. with 3.1.6 engine)

80 thoughts on “Run AceStream under OpenELEC on Raspberry Pi 2 (UPD. with 3.1.6 engine)

  1. gatto panceri says:

    Hi. can you please expand on how you execute acestream once you follow the instructions? i’m not quire following. thanks!
    I use an RPI2 on OSMC…

    Liked by 1 person

  2. autostart.sh is executed by openelec at boot time. if we speak about OSMC then at first you must try to run it manually.

    mkdir -p /tmp/test_acestream
    cd /tmp/test_acestream
    curl -LO https://github.com/tvaddonsag/plexus-dependencies/raw/master/Modules/Linux/arm/rpi2/acestream-rpi2.tar.gz
    tar xf acestream-rpi2.tar.gz

    modify ACEADDON variable as described above and then try to run it manually with

    ./start_acestream.sh --client-console --live-cache-type memory --live-cache-size 20971520 --live-buffer 60

    Liked by 1 person

  3. gatto panceri says:

    thank you. I executed it manually. no error, process running in ps aux, but not output either on screen. it only mentions that a lot of sysfs are already mounted.

    Like

  4. EVGENII says:

    Taras, could you please share you OS image for Raspberry Pi 2? I spent lots of time, but in vain. (vasserfall@hotmail.com)

    Like

  5. Sam says:

    Hi,

    Apologies, I’m a newbie and pretty confused about how to do this.

    I am on OSMC running kodi on a rpi2 version b.

    I ran through your steps in the comment that you posted for osmc, but when I got to the part where you said “modify ACEADDON variable as described above” i tried to do this by running:

    ACEADDON=”$HOME/.kodi/userdata/addon_data/program.plexus/acestream”

    and then

    ACEADDON=”`dirname \”$0\”`”

    but i got a response saying

    dirname: invalid option — ‘b’
    Try ‘dirname –help’ for more information.

    I’m probably doing this completely wrong. Is it possible for you to type out exactly what I need to do to get it working on osmc as clearly I dont know what I’m doing! Would really appreciate your help.

    Many thanks.

    Like

  6. Sam says:

    Hi,

    I’m really not having much luck with this. I have downloaded putty, connected to my rpi2 (with a fresh install of openelec on it) and ran through the steps you have listed above exactly, line by line. Yet still when I try to play an acestream link, it starts plexus but then the 40 second timer just counts down to 0. I know that the link is live because I have successfully launched it on my windows pc and laptop, but on rpi2… nothing.

    Have you any idea what might be causing this? I have literally copied and pasted what you have detailed line by line but can’t understand where I could be going wrong. Any help would be much appreciated!

    Like

  7. Sam says:

    can anyone help me? ran through all the steps as described via putty on openelec, still it times out to 0 when trying to play an acestream link (i know for sure the link is live!)

    Like

  8. Happo says:

    Hi,

    I’m trying to use it in raspbian but I’m getting this error in the log:
    Traceback (most recent call last):
    File “”, line 2, in
    File “/system/data/data/org.acestream.engine/files/python/lib/python27.zip/argparse.py”, line 92, in
    File “/system/data/data/org.acestream.engine/files/python/lib/python27.zip/gettext.py”, line 49, in
    File “/system/data/data/org.acestream.engine/files/python/lib/python27.zip/locale.py”, line 19, in
    File “/system/data/data/org.acestream.engine/files/python/lib/python27.zip/functools.py”, line 10, in
    ImportError: No module named _functools

    Thank you for your help.

    Like

  9. Denis says:

    I followed your instructions on a Raspberry Pi 3 with Openelec 6.0.3, it worked perfectly, thanks.
    But, with a Raspberry Pi2 B+, also using Openelec 6.0.3, acestream won’t start. Do you have any clue or checkpoint regarding this issue?

    Taras, same request for you, if you could share an iso image of your SD card, I’d be very grateful

    Like

    1. Aleksandar says:

      I have problems with getting it to work on my RPi 3, how are you using it? I have tried with p2p-stream and plexus but none of them works.. please help me!

      Like

  10. FilthX says:

    Thanks for your post. Had acestream working after installing plexus on my Raspberry Pi 2 running Openelec, that downloaded the right dependencies (sopcast and acestream) but in the last week I am facing problems with torrent-tv and arenavision to name a few that use acestream. Is it possible that these providers changed the acestream version and so plexus is failing to open them now? Tried your way as described on the post but the problem persists… Any ideas?
    Thanks in advance

    Like

      1. FilthX says:

        Sorry about the lack of info on my first post. Plexus is starting the acestream engine and it ends up to the message “torrent not available or invalid” and also “Acestream Can’t Connect”. The links are good, since I tried them on my windows pc. Also Sopcast is good at least for now, but acestream unfortunately not…

        Like

      2. Akul says:

        Hi thanks for the guide but this steps are not necessary.you can just install plexus addon(from tv addons) and when you go to programs and start plexus the script will automatically install this package (when you choose that you have rpi) and do this steps.but there is a problem now,ace stream require login and this package dont work anymore…maybe you can find a solution.thanks

        Like

    1. Akul says:

      Yes ,plexus downloaded acestream engine dont work any more(many users on reddit also complain),authors of acestream engine require registration now(or google login),there is now premium plans also w/o ads but free account will work normally with ads(when logged in).i gues plexus package needs updating now,maybe even this acestream package dont work any more(i will test and post results)

      Like

  11. Eddie G says:

    It looks like acestream for Android which this build is based on is now requiring users to register first and then it will stream.

    Does anyone know how specify a login and password for this build? These params aren’t even on the official acestream site.

    Like

  12. roor says:

    It seems that the problem reported by filthx is also claimed by other rpi2/rpi3 users (https://www.raspberrypi.org/forums/viewtopic.php?f=76&t=144668). The following message is in the acestreamengine logs: “You need to activate Standard or Premium plan to continue”. Apparently, it only impacts android users (not x86), and rpi users since plexus acestream program is based on the android version.

    http://palcotv.blogspot.com/2016/04/acestream-de-pago-en-su-version-para.html (sorry in spanish)
    Under android, one solution is to install the Torrent Stream Controller avaliable there; http://www.vidsoftware.ru/

    Like

  13. Hi,

    Thanks a lot for the efforts you put in explaining it for us!

    I am a complete noob on Raspberry Pi and I like probably many others have difficulties to follow your commands in SSH. I know it is a lot to ask but if you have the energy and time, it would be highly appreciated if you could put up a youtube video so that we could follow it.

    Thanks again mate!

    Like

  14. alex says:

    @FilthX says “I am facing problems with torrent-tv and arenavision to name a few that use acestream.”

    Just installed acestream/plexus yesterday. To answer to you, yes, it possible. Just tried to load other stream on mine and failed with the following message in acestream log: response={“status”: 100, “message”: “Cannot load transport file”} which accoring to wiki could be caused by mismatch between player and engine it has been created stream. I also could not find any other stream working …

    Still plexus is working with other acestreams on your side? Can you share here it’s hash for one still working? I will test it on mine and check log for comparison …

    Like

  15. stone237 says:

    First, thanks for the awesome tutorial. You really spelled things out and made things easy for n00bs like me.

    Recently, it looks like the acestream people made it mandatory to log in when using the Android version of their app. Since this installation uses that build, it’s stopped working for me since. I can’t quite figure out what the parameters are to enter the login information. Unless we have to log in through the web UI. Surely there’s a config file of some sort at the very least that we can modify.

    Like

  16. stone237 says:

    Anyone figure out a way to get acestream working on a raspberry pi again? The current plexus build doesn’t allow for login apparently.

    Like

  17. Tuga says:

    Hi. I only managed to get AceStream working on the Pi2 running OpenElec with your method.
    The issue is that it stopped working since last week or so. Still, I manage to run it on my Windoes10 laptop. As far as I know there wasn’t an update on the windoes engine since I got it on the PC.

    The counter just goes to 0 or Plexus reports it can’t play the file.

    Is there a fix for Rpi2?

    Thanks!!

    Like

    1. I’m struggling to get it working on my Rpi 2 with OSMC – followed instructions to the letter. Only thing that is different is now my acestream is counting all the way down to 0 before telling me it wont load.
      Any help/advice would be really apreceated. Thanks

      Like

    2. I have a rasp2.
      See port acestream remote service with
      cat /storage/.acestream/acestream.log
      ##############################################
      # OpenELEC #
      # http://openelec.tv #
      ##############################################

      OpenELEC (official) Version: 6.95.3
      OpenELEC:~ # cd .acestream
      OpenELEC:~/.acestream # ls
      acestream androidfs start_acestream.sh
      acestream.log chroot stop_acestream.sh
      OpenELEC:~/.acestream # cd ..
      OpenELEC:~ # cat /storage/.acestream/acestream.log
      __bionic_open_tzdata: couldn’t find any tzdata when looking for localtime!
      __bionic_open_tzdata: couldn’t find any tzdata when looking for GMT!
      __bionic_open_tzdata: couldn’t find any tzdata when looking for posixrules!
      2016-10-31 17:49:08,848|MainThread|acestream|cannot get language
      Traceback (most recent call last):
      File “core.c”, line 166, in
      File “/system/data/data/org.acestream.engine/files/python/lib/python27.zip/android.py”, line 34, in __init__
      self.conn = socket.create_connection(addr)
      File “/system/data/data/org.acestream.engine/files/python/lib/python27.zip/socket.py”, line 553, in create_connection
      for res in getaddrinfo(host, port, 0, SOCK_STREAM):
      gaierror: [Errno 8] hostname nor servname provided, or not known
      2016-10-31 17:49:08,862|MainThread|acestream|platform=android
      2016-10-31 17:49:08,867|MainThread|acestream|app=acestream
      2016-10-31 17:49:08,868|MainThread|acestream|version=3.0.6 code=3000600 revision=1420M date=2014-12-11
      2016-10-31 17:49:08,868|MainThread|acestream|use_local_db=True
      2016-10-31 17:49:08,869|MainThread|acestream|use_m2crypto=False
      2016-10-31 17:49:08,869|MainThread|acestream|enable debug: 0
      2016-10-31 17:49:08,870|MainThread|acestream.coreapp|__init__: failed to get memory class
      Traceback (most recent call last):
      File “core.c”, line 392, in
      File “/system/data/data/org.acestream.engine/files/python/lib/python27.zip/android.py”, line 34, in __init__
      self.conn = socket.create_connection(addr)
      File “/system/data/data/org.acestream.engine/files/python/lib/python27.zip/socket.py”, line 553, in create_connection
      for res in getaddrinfo(host, port, 0, SOCK_STREAM):
      gaierror: [Errno 8] hostname nor servname provided, or not known
      2016-10-31 17:49:08,873|MainThread|acestream|get_default_api_version: 2
      2016-10-31 17:49:08,878|MainThread|acestream.coreapp|use fixed i2i_port: 62062
      2016-10-31 17:49:08,895|MainThread|acestream.coreapp|cannot load session config, use default
      sh: /bin/netstat: not found
      sh: /sbin/ifconfig: not found
      2016-10-31 17:49:08,931|MainThread|acestream.SocketHandler.InterruptSocket|bound on 127.0.0.1:36299
      2016-10-31 17:49:08,932|MainThread|acestream.SocketHandler.SocketHandler|bind: socket bound: host=0.0.0.0 port=8621
      2016-10-31 17:49:08,933|MainThread|acestream.LM|listen on 8621
      2016-10-31 17:49:08,991|MainThread|dht|init_bootstrap_nodes: error
      Traceback (most recent call last):
      File “ACEStream/Core/DecentralizedTracking/pymdht/core/controller.py”, line 72, in init_bootstrap_nodes
      gaierror: [Errno 7] No address associated with hostname
      2016-10-31 17:49:08,993|MainThread|dht|init_bootstrap_nodes: error
      Traceback (most recent call last):
      File “ACEStream/Core/DecentralizedTracking/pymdht/core/controller.py”, line 72, in init_bootstrap_nodes
      gaierror: [Errno 7] No address associated with hostname
      2016-10-31 17:49:09,001|AceStreamCoreThread|acestream.LM|start_multicast: error
      Traceback (most recent call last):
      File “ACEStream/Core/APIImplementation/LaunchManyCore.py”, line 997, in start_multicast
      File “ACEStream/Core/BitTornado/RawServer.py”, line 380, in create_multicast_sockets
      File “ACEStream/Core/BitTornado/SocketHandler.py”, line 794, in create_multicast_sockets
      File “ACEStream/Core/BitTornado/SocketHandler.py”, line 898, in get_local_ips
      gaierror: [Errno 7] No address associated with hostname
      2016-10-31 17:49:09,034|MainThread|acestream.VideoServer|start: addr=127.0.0.1 port=6878
      2016-10-31 17:49:09,065|MainThread|acestream.SocketHandler.InterruptSocket|bound on 127.0.0.1:34905
      2016-10-31 17:49:09,135|MainThread|acestream.SocketHandler.SocketHandler|bind: socket bound: host=127.0.0.1 port=62062
      2016-10-31 17:49:09,136|Instance2InstanceThread-24|acestream.APIServer|run: ready to receive remote commands on 62062
      __bionic_open_tzdata: couldn’t find any tzdata when looking for GMT!
      __bionic_open_tzdata: couldn’t find any tzdata when looking for posixrules!
      Killed
      OpenELEC:~ #

      My port is 62062
      In plexus-acestream- port engine number
      type 62062.
      Work fine now.

      Like

    1. you can move whole directory with acestream to an external drive and run it from there, just check there is no fstab options like nosuid or simillar (you can use mount tool to see which volume doesn’t have this options and then fix this in automount script)

      Like

  18. iGenena says:

    it works, with the updated version, my only problem is on Pi3, the memory goes really low, especially now we are running it with autostart.

    is there a way to start acestreams, only when we need to stream? as now i have memory up to 80%, without the script, it goes only to 65%-70%

    Thanks!

    Like

  19. it works, with the updated version, my only problem is on Pi3, the memory goes really low, especially now we are running it with autostart.

    is there a way to start acestreams, only when we need to stream? as now i have memory up to 80%, without the script, it goes only to 65%-70%

    Thanks a lot!

    Like

  20. Riverlake says:

    Hi, I followed instructions here – http://pastebin.com/kVMZynzh. But still it does not work for me. The change is, that Plexus loading stream from 40 seconds to 0 seconds and then it says – invalid stream or torrent (it is not invalid, cause I tested on PC acestream before). Do you know, how to fix it?

    Raspberry Pi 3 – Libreelec

    Like

  21. kscnof says:

    Hallo,

    Thanks for the guide. The link provided by Henry and Rascas does work for me, libreelec 7.0.2. However, I find the link to bintray to be a little shady – can anyone verify where this tar file comes from?

    Like

  22. bibolo says:

    I followed the tutorial step by step but it still did not work on rpi3 running KODI.
    I had still the message “awaiting acestreamengine” with the 40s timeout.

    When running :
    sh start_acestream.sh –client-console –live-cache-type disk –live-buffer 60

    I had the error message :
    Some files is not executable (/bin/sh). Exiting

    so I had to make :
    chmod +x ~/.acestream/androidfs/system/bin/*

    reboot

    and now it works fine…

    😉

    Like

  23. Piboy says:

    I think I prefer just using Plexus to start and stop the script as it means you don’t need to have the Acestream engine running all the time. The guide for Raspberry Pi at http://pastebin.com/kVMZynzh will probably work as stated on OpenELEC/LibreELEC/OSMC but will not work out of the box if you have a Raspberry Pi running Kodi at boot on Raspbian (set to run at boot as user “kodi” by editing /etc/default/kodi ) or other distros. This is because the start_acestream.sh and stop_acestream.sh scripts require sudo permissions and user “kodi” is not in the sudoers file by default.

    A quick-and-dirty (but not recommended) way to get this working would be to “sudo visudo” and add the line “kodi ALL=(ALL) NOPASSWD: ALL” to the sudoers file. This is probably a security vulnerability as would allow any Kodi addon sudo/root access. Therefore I did the following instead to only grant sudo permissions to the acestream start/stop scripts (do not type the quotes):

    Type “sudo vi sudo” to edit the sudoers file. Then add the following two lines:
    kodi ALL= NOPASSWD: /bin/sh /home/kodi/.kodi/userdata/addon_data/program.plexus/acestream/start_acestream.sh –client-console
    kodi ALL= NOPASSWD: /bin/sh /home/kodi/.kodi/userdata/addon_data/program.plexus/acestream/stop_acestream.sh

    Then edit /home/kodi/.kodi/addons/program.plexus/resources/plexus/acecore.py and find the following code:
    if “arm” in os.uname()[4]:
    try:
    command = [“sh”,os.path.join(pastaperfil,”acestream”,”start_acestream.sh”),”–client-console”]

    Change the last line to:
    command = [“sudo”,”sh”,os.path.join(pastaperfil,”acestream”,”start_acestream.sh”),”–client-console”]

    Then find the code:
    if “arm” in os.uname()[4]:
    os.system(“sh “+os.path.join(pastaperfil,”acestream”,”stop_acestream.sh”))

    Change the last line to:
    os.system(“sudo sh “+os.path.join(pastaperfil,”acestream”,”stop_acestream.sh”))

    Liked by 1 person

  24. Rascas says:

    That is correct, if you another user than the default “pi” in Raspbian. Unfortunately, using an Android chroot is the only I know to run acestream on Pi, and the chroot command needs sudo/root permission to run by default.
    But don’t forget that in that matter, OSMC and Open/LibreELEC are worse because in OSMC the default user also doesn’t require password for sudo, and the ELECs run as root without password by default.

    Like

  25. ordnael says:

    Hi,
    thanks to your guide I’m able to see acestram channels 🙂

    I have only 1 issue since when I configured it; if I try to connect via SSH, I have following error:
    “Server refused to allocate pty ”

    after running following command, SSH conenction works fine again
    — ssh root@192.168.1.5 “mount devpts /dev/pts -t devpts”

    any Idea?

    Like

    1. There is nasty bug in old startup script, which introduce this strange behavior. IIRC there is excess/duplicated mount command. You can find it yourself or just re-download latest engine from this topic and replace.

      PS. Open start_acestream.sh and remove last one line from this two:
      $PERMISSION mount -o bind /dev $ACEADDON/$ACECHROOT/dev
      $PERMISSION mount –bind /dev $ACEADDON/$ACECHROOT/dev

      Like

Leave a comment