librtmp.so crashes XBMC?
#1
Hi all,

I can't seem to locate an librtmp.so v2.4 for Android anywhere (all the links are down) so I decided to compile my own, however it crashes XBMC and I can't figure out why.

Compilation Process:
  1. Used 64bit Fedora Linux to compile
  2. Got Android NDK from: http://developer.android.com/tools/sdk/ndk/index.html
  3. Set up NDK with '/tmp/rtmpdump/android-ndk-r8e/build/tools/make-standalone-toolchain.sh platform=android-14 --install-dir=/tmp/rtmpdump/android-toolchain --system=linux-x86_64'
  4. Set my path with 'export PATH="tmp/rtmpdump/android-toolchain/bin:$PATH"'
  5. Got Polar SSL from: https://polarssl.org/download
  6. Compiled Polar SSL with 'make CC=arm-linux-androideabi-gcc APPS='
  7. Installed Polar SSL to android-toolchain with 'make install DESTDIR=/tmp/rtmpdump/android-toolchain/sysroot'
  8. Got S74ck3r's version of rtmpdump from: https://github.com/S74ck3r/rtmpdump.git
  9. Compiled with 'make SYS=android CROSS_COMPILE=arm-linux-androideabi- INC="-I/tmp/rtmpdump/android-toolchain/sysroot/include" CRYPTO=POLARSSL'

This gave me my librtmp.so.0 (librtmp.so symlink). I then copied this over to my tablet's XBMC lib folder but when starting XBMC it crashes when loading libCURL. Restoring librtmp.so fixes the issue.

Tail end of xbmc.log:
Code:
10:57:00 T:1911142352   DEBUG: ------ Window Init (Home.xml) ------
10:57:00 T:1911142352    INFO: Loading skin file: Home.xml, load type: KEEP_IN_MEMORY
10:57:00 T:1911142352   DEBUG: Load Home.xml: 171.67ms
10:57:00 T:1911142352   DEBUG: Alloc resources: 177.16ms  (171.86 ms skin load)
10:57:00 T:2034659936   DEBUG: CRecentlyAddedJob::UpdateMusic() - Running RecentlyAdded home screen update
10:57:00 T:1911142352   DEBUG:  - no profile autoexec.py (/storage/emulated/0/Android/data/org.xbmc.xbmc/files/.xbmc/userdata/autoexec.py) found, skipping
10:57:00 T:1911142352   DEBUG:  - Starting network services
10:57:00 T:1911142352  NOTICE: ES: Starting event server
10:57:00 T:1911142352    INFO: JSONRPC Server: Successfully initialized
10:57:00 T:1911142352   DEBUG: CLastfmScrobbler: Clearing session.
10:57:00 T:1911142352   DEBUG: CLibrefmScrobbler: Clearing session.
10:57:00 T:2032431648  NOTICE: ES: Starting UDP Event server on 0.0.0.0:9777
10:57:00 T:2032431648  NOTICE: UDP: Listening on port 9777
10:57:00 T:2034659936   DEBUG: GetRecentlyAddedAlbumSongs() query: SELECT songview.* FROM (SELECT idAlbum FROM albumview ORDER BY idAlbum DESC LIMIT 10) AS recentalbums JOIN songview ON songview.idAlbum=recentalbums.idAlbum
10:57:00 T:2034659936   DEBUG:  query: select * from albumview where strAlbum != '' order by idAlbum desc limit 10
10:57:00 T:2026938024   DEBUG: SECTION:LoadDLL(libcurl.so)
10:57:00 T:2026938024   DEBUG: Loading: /data/app-lib/org.xbmc.xbmc-1/libcurl.so
10:57:00 T:2026938024   ERROR: Unable to load /data/app-lib/org.xbmc.xbmc-1/libcurl.so, reason: (null)
10:57:00 T:2026938024   DEBUG: CurlFile::Open(0x79415d08) http://feeds.xbmc.org/xbmc
10:57:00 T:2026938024   DEBUG: SECTION:LoadDLL(libcurl.so)
10:57:00 T:2026938024   DEBUG: Loading: /data/app-lib/org.xbmc.xbmc-1/libcurl.so
10:57:00 T:2026938024   ERROR: Unable to load /data/app-lib/org.xbmc.xbmc-1/libcurl.so, reason: (null)
10:57:00 T:2034659936   DEBUG: CRecentlyAddedJob::UpdateVideos() - Running RecentlyAdded home screen update

Any thoughts? Or anyone have a 2.4 binary I can try?

Thanks,
Ben

Hrm, as I read what I've typed, I wonder if libCURL is compiled with OpenSSL statically and when librtmp introduces PolarSSL they conflict. No idea how to do this with OpenSSL though..
Reply
#2
Here the ones that I use and work:
https://www.dropbox.com/s/hbuqpw17snhw0tj/librtmp.so
https://www.dropbox.com/s/580bd56edq5lhj8/librtmp.so.0
Reply
#3
(2013-03-28, 18:07)Mafarricos Wrote: Here the ones that I use and work:
https://www.dropbox.com/s/hbuqpw17snhw0tj/librtmp.so
https://www.dropbox.com/s/580bd56edq5lhj8/librtmp.so.0

Hrm, I get the exact same error with libcurl.so using those. I'm using Android 4.2.2 on a Nexus 10. Did you do anything specific other than copying the .so file over?

Thanks,
Ben
Reply
#4
I got this same problem, http://forum.xbmc.org/showthread.php?tid=160248 yet oddly unlike yours mine got no replies.

Anyway, we did an "adb logcat" on the Nexus 7 4.2.2 and found it claims the reason you get a libcurl.so error is because when loading compiled librtmp's like you mentioned above, even though that method works on many other systems (obviously not using Android NDK), the Android claims "undefined symbol 'sqrt'"..... which means the Android is having issues with libm for some reason, thus refusing to load librtmp.so and then libcurl.so gets annoyed because it appearntly depends on librtmp.so.

I purposely tried putting -lm into my compile and still no go.
Reply
#5
(2013-03-28, 22:27)Fmstrat Wrote:
(2013-03-28, 18:07)Mafarricos Wrote: Here the ones that I use and work:
https://www.dropbox.com/s/hbuqpw17snhw0tj/librtmp.so
https://www.dropbox.com/s/580bd56edq5lhj8/librtmp.so.0

Hrm, I get the exact same error with libcurl.so using those. I'm using Android 4.2.2 on a Nexus 10. Did you do anything specific other than copying the .so file over?

Thanks,
Ben


I dont have 4.2.2, only 4.1.
Probably the problem is related with different OS versions...
Reply
#6
(2013-03-31, 23:50)Mafarricos Wrote:
(2013-03-28, 22:27)Fmstrat Wrote:
(2013-03-28, 18:07)Mafarricos Wrote: Here the ones that I use and work:
https://www.dropbox.com/s/hbuqpw17snhw0tj/librtmp.so
https://www.dropbox.com/s/580bd56edq5lhj8/librtmp.so.0

Hrm, I get the exact same error with libcurl.so using those. I'm using Android 4.2.2 on a Nexus 10. Did you do anything specific other than copying the .so file over?

Thanks,
Ben



I dont have 4.2.2, only 4.1.
Probably the problem is related with different OS versions...

Thanks for your reply, seems we are getting closer and closer to the solution. At least we know now why I seen many ppl like other librtmp's yet we keep getting failure. Maybe if somebody finds the exact commands used to compile the offical librtmp.so in Android we can get somewhere Smile.
Reply
#7
Ok, I got a temporary fix for your solution. Use the librtmp.so file in Dropbox posted earlier in the thread.

https://www.dropbox.com/s/hbuqpw17snhw0tj/librtmp.so

Go to /data/data/org.xbmc.xbmc/lib
Replace the old librtmp with the new one.
Then change the permission to rwx r-x r-x or the same permission as all the other files in that folder
A simple permision chart:
(read write execute)
User (x x x )
Group (x _ x )
Other (x _ x )

Once you have done that, open XBMC and it will work. I used this with great success on Amazon plugin for Nexus 7, Nexus 10, and Galaxy S3 all running cyanogenmod rom. However, it won't work on Twitch TV, not sure why. Maybe some other bugs in that addon. Have not look it up yet.

WARNING: you have to redo this every time you reboot the device because Android will replace the new librtmp file with the old file from the XBMC apk file.

I am trying to repackage the XBMC.apk so it could install a new librtmp file instead of the old file but I am having problem with signature verification. I will post update once I got it working.

Hope this work for you.
Reply
#8
A stupid question: I have replaced the file and it works, but when reboot my device the file is gone. Why is that?
Reply
#9
I wanted to tell you that I have already Seller LIBRTMP XBMC running on a computer in ANDROID (Minix X5)



MORE INFO
Reply
#10
(2013-04-08, 17:10)ropoman Wrote: A stupid question: I have replaced the file and it works, but when reboot my device the file is gone. Why is that?

Its because of apk signing on the Android. Muself and S74ck3r are producing a librtmp.so with all fixes and then I am going to place it in the libstagefright apk so that it remains on boot and I will host it on my Mediafire.

Should only be a few more days.
Reply
#11
Thanks for fixing librtmp. Will this also solve the problem that the streams are out-of-synch? The video is too slow. Even in the low quality videos of ustvnow
Reply
#12
(2013-04-10, 06:58)ropoman Wrote: Thanks for fixing librtmp. Will this also solve the problem that the streams are out-of-synch? The video is too slow. Even in the low quality videos of ustvnow

AFAIK, my buddy has tested the file numerous times on his Nexus 7 and his videos have had no problems at all.

My USTVNow refuses to work on any of my XBMCs Sad.
Reply
#13
I have created an Android APK with another signature meaning it will not install over-top the current XBMC you would have on your Android but should work where the file is not replaced over and over.

To read more, read my other post:

http://forum.xbmc.org/showthread.php?tid...pid1395470
Reply
#14
I just try and not installed.

I deleted the previous version of XBMC and tried to install this, but get the message "Application Not Installed".
Reply
#15
Laser76, answered on release post.
Reply

Logout Mark Read Team Forum Stats Members Help
librtmp.so crashes XBMC?1