User(s) browsing this thread: 1 Guest(s)
|
RAR streaming development..via SMB/NFS
|
|
02-26-2009, 01:08 PM
(This post was last modified: 03-02-2009 08:28 AM by chris57.)
|
|||
|
|||
|
RAR streaming development..via SMB/NFS
Even though Dune is no longer a NMT, it is virtually the same hardware. I want to add unrar support to Dune, and the best way for me to do so that I can see right now, is the LD_PRELOAD my own library to replace libc calls open/read/close/stat/lseek/opendir/readdir/closedir.
Reason I mention this is that it will be the same exact code to run on PCH as well, same uclibc, busybox, kernel etc. Perhaps others have thought about this already? Other ideas or solutions? (Also found the other forums to be really slow compared to this one!) |
|||
1 user says Thank You to lundman for this post |
|
02-27-2009, 06:49 AM
(This post was last modified: 03-02-2009 08:27 AM by chris57.)
|
|||
|
|||
|
RE: Dune RAR streaming development..
Anyway, proof of concept is done:
Code: # export LD_PRELOAD=/opt/sybhttpd/localhost.drives/HARD_DISK/Apps/librarcy/librarcy.so.1.0.1Now I just need to add the actual code. Anyone know how libc "normalises" the paths before using them, in open/stat/opendir? |
|||
|
02-28-2009, 12:32 AM
|
|||
|
|||
|
RE: Dune RAR streaming development..
Anyway, proceeding happily here. I have over-loaded opendir/readdir, and inject the media files whenever I find a RAR. I am cheating to make the development faster. I will just add the file.avi from file.rar, I could hide the .rar files, but then you can't copy or delete them.
Next is to change stat64/lstat64 to return the values I find from readdir, then open/read. The tedious one will be lseek, but should not be too bad even. Code: # ls -l |
|||
|
03-01-2009, 02:03 PM
|
|||
|
|||
|
RE: Dune RAR streaming development..
Making good progress here, although I feel I am about a day behind my schedule that I just made up.
My program does opendir/readdir64/lstat64/stat64 just fine, and expand all .rar files Although, amusingly, if I include the calls to read: Code: read: 513248-513252I don't know at all whats going on there. Whats with the backward seeks? The multiples i can ignore, but going back is a respawn. The largest negative seek I found is -0114918. This means a buffer of 112KB at least, probably 128KB. This will take some extra time. |
|||
|
03-01-2009, 05:53 PM
|
|||
|
|||
RE: Dune RAR streaming development..
Quote:I don't know at all whats going on there. Be that as it may, I still think your chances of figuring it out are greater than mine.
Media tank:A-100 & C-200 TV:Panasonic TH-50PY800MT (HDMI) Audio:Logitech Z-5500 (Coaxial) |
|||
|
03-02-2009, 08:29 AM
|
|||
|
|||
|
RE: RAR streaming development..via SMB/NFS
Thread moderated, edited and moved to Apps & Technical for better targeting.
A400: SSD+SD Card(Apps), HDMI A300: USB(Apps), HDMI C200: USB(Apps), BD SH-B083L(SB01), HDMI CAT6 Wired Network: TV TX-P42G20, HP ProCurve 1400-8G, Netgear GS-608/605, Synology CS407 |
|||
|
03-02-2009, 08:49 AM
|
|||
|
|||
|
RE: RAR streaming development..via SMB/NFS
Anyway, the basic code is done. If it is "happy-hour for lseek" I don't know how it will run (is the lseek usage based on .avi format?) but for the rest it should be enough to be functional.
One day I could extend it to work with sh in general, but currently you can't copy the files from archives out. (cat and cp uses fopen instead of open). Test code: Code: fd = open(argv[1], O_RDONLY);Test execution output: Code: $ LD_PRELOAD=./librarcy.so.1.0.1 ./tester minicom.logDebug log output: Code: looked up 'open64': 0x2ab82070 |
|||
|
03-02-2009, 08:50 AM
|
|||
|
|||
|
RE: RAR streaming development..via SMB/NFS
lundman, will this work allows RARs to be playable without LLINK? and would it make them appear and be manipulated just as AVIs? would help alot for all the jukeboxes out there
|
|||
|
03-03-2009, 11:01 AM
|
|||
|
|||
|
RE: RAR streaming development..via SMB/NFS
Hmm, well, it starts playing, for about 1 second (the first buffer of 65k) then it thinks its finished.
Code: [read] fd 6 lseek call detected: respawningNot entirely sure how it keeps playing, perhaps it hands it off somewhere, which doesn't call read()... I need to go deeper.. |
|||
|
03-03-2009, 01:47 PM
|
|||
|
|||
|
RE: RAR streaming development..via SMB/NFS
Would be amazing if you would be able to pull this one off lundman! Curiously following your steps over here, sorry I can't help you with anything but if you need testers/feedback please let me know.
|
|||
|
03-03-2009, 02:41 PM
|
|||
|
|||
|
RE: RAR streaming development..via SMB/NFS
That was actually a bug in my lseek handling, for some reason RUA loves to call lseek multiple times without read, and not just to do the weak "filesize check".
Anyway, playing just the .avi file and playing the .avi in rar, and comparing the strace, I have it so that they run as identical as expected. But for some reason when playing from RARs, it does the initial buffer load, and starts playing... However, then the plain AVI will lseek(CUR,0) and read the next buffer fill, the RAR version just says: "Reach end of file, waiting for EOS." ... which comes from play_avi_push.c, the "fill_buffer:" goto. However, there are so many ways it can land there I am not entirely sure what goes wrong. No unusual calls besides RMFileSeek and RMFileRead in that function, which are handled. Anyone know if I can turn on RMDBGLOG() so I can see what it says without recompiling? Or is it just a compile-time define? |
|||
|
03-04-2009, 09:50 AM
|
|||
|
|||
|
RE: RAR streaming development..via SMB/NFS
Code: read(6,0x2bc7b000,524288)They ask for 524288 and _just assume_ that read() will read it, or EOF! I will refrain from making comments... But yes, read of a pipe shouldn't stop at 65536 (but it does) and Sigma shouldn't assume read() will always return the full buffer (even when blocking). But anyway, I now re-call read until the buffer is full, and the video plays completely. Apart from bells & whistles, the work is done. |
|||
|
03-04-2009, 09:58 AM
|
|||
|
|||
|
RE: RAR streaming development..via SMB/NFS
Wow amazing, also close to a beta release, can't wait to test this!
|
|||
|
03-04-2009, 10:02 AM
|
|||
|
|||
|
RE: RAR streaming development..via SMB/NFS
nice work lundman
----------------------------------------------------------------------------------------------------- Syabas Technology Inc. DBA Popcornhour |
|||
|
03-04-2009, 11:22 AM
|
|||
|
|||
|
RE: RAR streaming development..via SMB/NFS
I have watched a couple of things on the Dune without any problems, seeking works too. I will try on the PCH as well just to see how it does.
but I did notice that librmavipush has: Code: /* Open with caching if it is HTTP, because we seek a lot duringSo maybe relatively little change would be needed to open with caching. Who knows. |
|||
|
« Next Oldest | Next Newest »
|

Twitter
Facebook
NMT Wiki
Search
Member List
Help
[7. June 2013] Youporn available now





![[+]](images/collapse_collapsed.gif)



