How to use lastest librtmp with openELEC

tuxen

Banned
Mar 23, 2012
2,235
0
0
Denmark
Major overhaul!

There was some bugs that prevented the 3'rd party libs from sometimes being used depending how it was used. In fact it was very much hit and miss with a standard setup. :/
Now .profile is not used anymore instead the script will patch openELEC and wait until everything is loaded before starting XBMC. This is a much better although not pretty solution.

Any broken symlink a will also automatically be restored if broken. This hack works 100% with all unmodified versions including Gotham.

Ok let's start..
SSH to your RPi in windows use putty in host field type ipaddressofrpi the password is openelec.

1. First make a folder for library's we want to super seed openELEC's default path:
Code:
mkdir /storage/lib
2. Download the lastest librtmp.so.0 from http://www.mediafire.com/?x4cvp5hl4m9xr
(librtmp - Always with KSV's latest patch(es) such as redirects) (RedPenguin's "Repo")

3. Copy the file to /storage/lib using either winscp or samba \\openelec place it in downloads then use XBMC file manager to move it to /storage/lib/

4. Execute these two commands in SSH:
Code:
chmod 755 /storage/lib/librtmp.so.0
ln -s /storage/lib/librtmp.so.0 /storage/lib/librtmp.so
5. Download pre-written scripts to /storage/.config:
Code:
cd /storage/.config
curl -L http://is.gd/kBaTzY -o autostart.sh
curl -L http://is.gd/yQUqNm -o hacklib
6. Reboot openELEC.

Enjoy! :)

To test if its works use the command:
Code:
grep autostart.sh /var/log/messages
And you should get a success from the log in form of:

Aug 25 18:44:31 rpi512 user.notice autostart.sh: Adding 3rd Party libraries to LD_LIBRARY_PATH!
Aug 25 18:44:32 rpi512 user.notice autostart.sh: Starting XBMC using /etc/init.d/93_xbmc

Alternatively put a bogus librtmp.so.0 in /storage/lib and XBMC should crash when trying to open a live stream.

-
For the techies:
This hack involves using autostart.sh to halt the initial load of xbmc.bin, modifying LD_LIBRARY_PATH and then initiating a secondary load of xbmc.bin but now using the third party libraries (librtmp etc.). The hack will only be applied when the /storage/lib directory is present (exists), and when autostart.sh is being called during the boot sequence (when the parent process ID is 1), and when /storage/lib isn't detected at the beginning of LD_LIBRARY_PATH (and thus needs to be added). The check for PPID means it is possible to call autostart.sh without re-invoking xbmc.bin, which may be useful when testing/debugging other autostart.sh functionality...

Thanks a lot to milhouseVH!


ALWAYS EXECUTE THE COMMANDS EXACTLY AS THEY APPEAR IN THE "code:" BOXES!

To disable /storage/libs from being used:
Code:
Code:
mv /storage/lib /storage/lib.bak && sync
reboot
To enable it again rename it back again:
Code:
Code:
mv /storage/lib.bak /storage/lib && sync
Remember to reboot between either disable or enable.


Feedback welcome..
 
Last edited:

oso

New member
Sep 19, 2012
378
0
0
you mean you've only just found this out ???? Only joking, great post mate and perfect solution to a nightmare scenario.
 

Frederick_99

New member
Sep 18, 2012
452
0
0
UK
Hi

1st time i tried this it didnt work after checking with echo $LD_LIBRARY_PATH

however, i wasn't clear where the .profile file should be placed and had made it in the /storage/lib folder.

then moved it into /storage folder, rebooted checked again with echo $LD_LIBRARY_PATH, and this time it worked.


Perhaps you could just edit your sticky to reflect this in case other users try and fail

great stuff and many thanks
 

tuxen

Banned
Mar 23, 2012
2,235
0
0
Denmark
If you execute the command as it is in the code box: nano /storage/.profile the file will end up in /storage so if you follow the guide you be perfectly fine.

Always execute the commands exactly as they are written in the code boxes. :)
I edited the post to reflect that and typed in your suggestion. Thanks for the notice!

Also I'm very sorry, this is completely on me there is a extra step I forgot now called 7.
Be sure to execute these two commands also.

Again I'm sorry about that.
 
Last edited:

tuxen

Banned
Mar 23, 2012
2,235
0
0
Denmark
I don't know why but I forgot to write in a step :/ number 7.
Be sure to update if you did this fix, just execute the 2 commands they are crucial for it to work!

Must be the heat.. Sorry mates. <embarrassed>
 
Last edited:

Frederick_99

New member
Sep 18, 2012
452
0
0
UK
If you execute the command as it is in the code box: nano /storage/.profile the file will end up in /storage so if you follow the guide you be perfectly fine.

Always execute the commands exactly as they are written in the code boxes. :)
I edited the post to reflect that. Thanks for the notice!

Also I'm very sorry, this is completely on me there is a extra step I forgot now called 7.
Be sure to execute these two commands also.

Again I'm sorry about that.
No worries, probably the reason i didn't get it right is because i did everything inside of winscp as my knowledge of nano is non existent.

ie i created the folder and the .profile using winscp but i did set the permissions to 755
 

tuxen

Banned
Mar 23, 2012
2,235
0
0
Denmark
You need to set permissions on liprtmp.so.0 AND just as important make the symbolic link called librtmp.so (the second command) otherwise it will not work! So there no way around SSH to make the link.

After that if you do a ls /storage/lib there should be 2 files : librtmp.so.0 (green) and librtmp.so (lightblue)

Also you should get familiar with nano its very simple txt editor and I even wrote which buttons to press although they are written in the editor. I only say this because it will make things easier. :)
 
Last edited:

Frederick_99

New member
Sep 18, 2012
452
0
0
UK
You need to set permissions on liprtmp.so.1 AND just as important make the symbolic link called librtmp.so (the second command) otherwise it will not work! So there no way around SSH to make the link.

After that if you do a ls /storage/lib there should be 2 files : librtmp.so.1 (green) and librtmp.so (lightblue)

Also you should get familiar with nano its very simple txt editor and I even wrote which buttons to press although they are written in the editor. I only say this because it will make things easier. :)
OK, but where does librtmp.so.1 come from.

If i do your commands but for librtmp.so.0 ( which is the file i downloaded and placed into /storage/lib ) then when i do ls /storage/lib there are 2 files : librtmp.so.0 (green) and librtmp.so (lightblue)
 

tuxen

Banned
Mar 23, 2012
2,235
0
0
Denmark
Sorry I meant librtmp.so.0 of cause. Doh (Edited my posts) Thanks a lot for pointing that out!
I can understand the confusion. It's so hot my brain is boiling lol.

Yep sounds good. You are set. :) No more odd streams that stop after a minute.
Plus all the other patches I don't know much about. Heh
 
Last edited:

Frederick_99

New member
Sep 18, 2012
452
0
0
UK
Sorry I meant librtmp.so.0 of cause. Doh (Edited my posts) Thanks a lot for pointing that out!
I can understand the confusion. It's so hot my brain is boiling lol.

Yep sounds good. You are set. :) No more odd streams that stop after a minute.
Plus all the other patches I don't know much about. Heh
Its all good now......rain pouring down here (UK) so may on its way to cool you down ?
 

Norsemon

New member
May 15, 2013
30
0
0
I've been reading every post made in this Pi forum since getting a Pi in May.
No I didn't read all the previous posts before this period (can only read so much) and the newer threads have taught me quite a bit..
especially "Can someone help an idiot ? New owner with raspbmc." ((initiated by Dunkle.... thanks guy, you asked most of the questions swirling around in my head)) - og tak Tuxan, for at tage sig tid til at besvare dummies som os i læringsprocessen
og ikke gøre os lyst idioter....


But what the heck is "librtmp" and what does it do for us?
 

tuxen

Banned
Mar 23, 2012
2,235
0
0
Denmark
Hey en skør dansker mere.. :) velkommen..

Librtmp is being used primary for live streams, chances are if you don't know what it is you don't need it. :)
I myself don't need it but I understand some payed sports streams want it or if the stream stops after a minute. So as you can hear I myself isn't a expert in this field. I just know some requested it.
 
Last edited:

Norsemon

New member
May 15, 2013
30
0
0
tusind tak

Jeg er en skør dansker, men jeg har boet i Canada i de sidste 56 år
 
Last edited:

ncube2

New member
May 29, 2012
9
0
0
A small correction i guess,
Execute these two commands in SSH:

Code:
chmod 755 /storage/librtmp.so.0 ---> chmod 755 /storage/lib/librtmp.so.0

Wud u mind adding steps to revert back to the /usr/lib also if needed.
 

oso

New member
Sep 19, 2012
378
0
0
as previous poster said, you have a typo that needs correcting :

chmod 755 /storage/librtmp.so.0

should be

chmod 755 /storage/lib/librtmp.so.0