1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Announce] Twonky Media Server 6.0.28 on Jac4

Discussion in 'Cisco/Linksys Network Storage Devices' started by jac_goudsmit, Jan 3, 2011.

  1. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Happy New Year everyone!

    For those who want to run the latest Twonky Media Server on the NAS200, here's a little (belated) Christmas treat. :cool:

    As you may know, the stock NAS200 firmware comes with an outdated version of the Twonky media server. Using my firmware you can update it, however most recent versions of Twonky don't work anymore because the NAS200 system libraries are too old.

    This download lets you run the latest Twonky server on your NAS200. Some Linux knowledge is required and you will need the Jac4 firmware.

    To install it, connect to the ssh server and paste the following commands: This downloads and unpacks my helper files(*) to the right location and starts a script to install everything:

    Code:
    cd $(mount | grep data | head -n 1 | awk '{ printf $3 }') \
    && wget http://www.nas200.net/jac4/nas200_twonkyupdate-6.0.28.tar.gz \
    && test "$(md5sum nas200_twonkyupdate-6.0.28.tar.gz | awk '{ printf $1 }')" = \
    "182a52343a4174ac03cf9b40cc984d0f" \
    && tar xvzf nas200_twonkyupdate-6.0.28.tar.gz \
    && cd rc.d/twonky/lib/ \
    && ./INSTALL_NAS200.sh
    
    (You may have to hit Return after you paste the commands)

    You should see in your ssh window that the NAS downloads and unpacks the tarball, and then starts a script that I wrote to set everything up. It should look somewhat like this:

    Code:
    Connecting to www.nas200.net...
    nas200_twonkyupdate- 100% |*****************************|  1126 KB...
    rc.d/twonky
    rc.d/twonky/lib
    rc.d/twonky/lib/ld-linux.so.2
    rc.d/twonky/lib/libbz2.so.1
    rc.d/twonky/lib/libc.so.6
    rc.d/twonky/lib/unzip
    rc.d/twonky/lib/INSTALL_NAS200.sh
    rc.d/twonky/lib/libpthread.so.0
    rc.d/twonky/lib/libgcc_s.so.1
    rc.d/twonky/lib/wrapup.sh
    rc.d/twonky/lib/libstdc++.so.6
    rc.d/rc.twonky
    Helper Files for Twonky Media Server for Linksys NAS200.
    (C) 2009-2011 Jac Goudsmit.
    Distributed under the GNU GPL v2.0.
    
    This script installs an updated version of Twonky Media Server
    on your Linksys NAS200...
    
    ...
    
    You will need to acknowledge that you understand that I only make the helper files, not the Twonky server, and that you are responsible for buying an updated Twonky license (It's only $20 or so). You may also have to answer a few yes/no questions during the installation.

    After the installation script is done, open the NAS web gui to configure the media server. You should set your media directories in the regular NAS web GUI so that your settings will survive a reboot. Once you click the Enable checkbox and click Save, the media server will be started.

    The tarball includes an rc.d script that changes some options for the Twonky server every time the NAS starts up (the Twonky configuration file gets regenerated every time the NAS restarts). One of the things it changes is that it enables the Twonky web configuration server so you can configure Twonky the "normal" way: by connecting a web browser to port 9000 of the NAS.

    You will have to edit the rc.d/rc.twonky script to add your license key otherwise the Twonky server will stop working after the trial period. Instructions are contained in the file. You should use an editor that's capable of handling Linux files with "LF" line endings, such as Notepad++. The built-in editor of WinSCP will also work. The regular Notepad and Wordpad will not save the file correctly.

    KNOWN PROBLEMS
    When you disable the media server from the NAS web GUI, the Twonky server should shut down, but it doesn't. One of the processes doesn't answer to the SIGTERM signal so you will have to look for it using the ps command and kill it manually using kill -HUP <pid>. The process should be easy to find, it's called /harddisk/volume_#/data/rc.d/twonky/lib/ld-linux.so.2 (where # is the number of your volume, which depends on whether you are running in RAID mode or not).

    Another problem is that the Twonky server is incapable of restarting itself. When you tell it to do so (from the Twonky web GUI), it simply stops and you will have to restart it from the ssh command line (using /etc/rc.d/twonkymedia.sh start). The web page will hang in your browser until you restart Twonky from the command line.

    I can probably come up with a way to solve these problems (for example by using a chroot) if there is enough interest.

    HOW IT WORKS
    Under Linux, it's possible to specify an override for LD_LIBRARY_PATH on the command line to force a program to use a different path for dynamic libraries. Unfortunately if the program was compiled with newer libraries, the newer C runtime startup code that's at the beginning of the program will also need updated libraries and won't be able to load. Even if you use an LD_LIBRARY_PATH override, you may still get strange errors like the infamous error while loading shared libraries: libc.so.6: cannot handle TLS data error.

    The solution is to use an updated Linux program loader, ld-linux.so.2. Instead of starting the program with LD_LIBRARY_PATH=/dir/for/updated/libraries /path/to/program, we run /path/to/ld-linux.so.2 --library-path /dir/for/updated/libraries /path/to/program.

    So what the install script does (after it downloads the updated Twonky server) is rename the binaries, and put a shell script in place of the original executable file that starts the renamed binary with the updated Linux loader as described above.

    ===Jac

    (*) The Twonky server itself is not included in the download; the installation script automatically downloads the correct file from the Twonky website.

    PS It appears that some of the binaries of Twonky 6.0.28 don't need updated libraries after all but it doesn't hurt :wink:
     
    Jules2112 likes this.
  2. pabpoo

    pabpoo Networkin' Nut Member

    The version 6.1 of twonky works without any changes (at least with the basic functionality), but consume too much ram memory.
     
  3. Runner73

    Runner73 Serious Server Member

    Loose new version after reboot


    Hi jack I've made other test an this is results.
    After installation with error
    (./INSTALL_NAS200.sh: 224: /harddisk/volume_3/data/rc.d/rc.twonky: Permission denied )
    if I start media server from web gui all funtion correctly, I also register server and configure it from web browser on 9000 port.

    When I shutdown NAS (from button on rear) and after start it from same minutes tne nas launch old version of media server instead new.
    Obvioussly I not cancel any directory or file in /harddisk/volume_3/data

    Do yuo have Idea?
    Thank you

     
  4. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I'm not sure why you're seeing the "Permission Denied" error but I will fix it. It's not a big deal, the install script just runs the startup script so you can get going right away. The install script doesn't have anything to do after the error besides show you a message about known problems.

    You say you can run the media server just fine just after installing but after a restart, it runs the on-board media server. That indicates that the scriptdirs.txt file is incorrrect. I'm not sure why it didn't get fixed (hopefully you entered "y" when the install script asked to fix it), but as a workaround, use the following command to fix it (you should do this only once):

    Code:
    echo >>/harddisk/volume_3/data/rc.d/rc.twonky "echo /harddisk/volume_3/data/rc.d >/etc/scriptdirs.txt"
    
    This should fix the scriptdirs.txt every time the system restarts, before the Twonky server gets started.

    Let us know if it works!

    ===Jac
     
  5. kiokoman

    kiokoman LI Guru Member

    same problem here
    i had to change the permission on the file rc.twonky (+x) and run the scripts INSTALL_NAS200.sh again
     
  6. Runner73

    Runner73 Serious Server Member

    Resolved

    Thank you very much to Jack and kiokoman.
    Their suggests resolve my problem. Now My nas200rm work very very very fine

    Runner73
     
  7. phan

    phan Reformed Router Member

    How to verify the twonky server version

    Hi Jac,

    Is there anywhere we can refer to, in order to check the version of Twonky server started? I executed /etc/rc.d/twonkymedia.sh start & but it told me a v4 of Twonky server was being started:

    /etc/rc.d/twonkymedia.sh start &
    [1] - Done /etc/rc.d/twonkymedia.sh start
    $ Starting /etc/twonkymediaserver ... TwonkyMedia Version 4.4.3.1

    Is there any log where I can check? In the ssh prompt, what would be the proper command to start and shutdown the v6 Twonky media server?
     
  8. Runner73

    Runner73 Serious Server Member

    Idle timeout nont function after twonky version changed

    Hi
    After modified version of twonky media server on my nas200, I noticed thath idle timeout for hard disk not function.
    Hard disks not go in standby.
    I try to shutdown and restart nas, and change to 10 minutes the idle timeout, but hard disk not go in stand by.
    I try also to disconnect nas from lan but this not change the problem
    Can you help me?
     
  9. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    You should be able to tell by running ps and checking the path of the Twonky executable. If it runs the updated version you should see at least part of the path to /harddisk/volume_*/data/rc.d/... etc. If it's running the old version you will see a path that doesn't start with /harddisk.

    /etc/rc.d/twonkymedia.sh start

    If the script doesn't start the updated Twonky server and you're using a RAID configuration, change your /etc/scriptdirs.txt file so it only contains the directory where your rc.d directory is:

    echo /harddisk/volume_3/data/rc.d >/etc/scriptdirs.txt

    Then run /etc/rc.d/twonkymedia.sh start again.

    ===Jac
     
  10. phan

    phan Reformed Router Member

    Thanks for all the tips Jac, now things are looking much better.
     
  11. Degcorp

    Degcorp Addicted to LI Member

    did you verify the scan server function? maybe the server is generating the database for your media.
     
  12. sjusto

    sjusto Reformed Router Member

    Twonky 6.0.32

    Hello everyone,

    I'm trying to update to version 6.0.32 (I have a samsung tv and I want to be able to see srt files - english is not my mother tongue-).

    I've tried several things, edit version variable at INSTALL_NAS200.sh and wrapup.sh -> didn't work.

    I renamed the zip file twonkymedia-i386-glibc-2.2.5-6.0.32.zip to twonkymedia-i386-glibc-2.2.5-6.0.28.zip - didn't work.

    I see that the latest version has been deployed but when I try to access to twonky port it says index was not found.

    Any ideas about what I'm missing?

    Thanks in advance.
     
  13. sjusto

    sjusto Reformed Router Member

    twonky 6.0.32

    Now Working.
    My mistake was to leave backup files on rc.d folder.
    Best regards,

    Santiago
     
  14. sjusto

    sjusto Reformed Router Member

    Hello,

    I have been able to install version 6.0.34; nothing wrong with the 6.0.32 but I got my new UN46D8000 and I was not able to see MKVs and SRTs files at the beginning and I thought that was related to the version. After upgrading I noticed the problem was still there, when I changed the media receiver type to Samsung TV, everything started to working fine.

    The only issue that I have so far is that when I restart the NAS200 the media receiver configuration gets lost.

    So my question is: Do you know if it’s possible to save those settings?

    Thanks and regards.

    Santiago
     
  15. Hydra Kanth

    Hydra Kanth Reformed Router Member

    HI
    I am getting this error when I try and run the script

    wget: www.nas200.net: Host name lookup failure
    $
    $ cd $(mount | grep data | head -n 1 | awk '{ printf $3 }') \
    > && wget http://www.nas200.net/jac4/nas200_twonkyupdate-6.0.28.tar.gz \
    > && test "$(md5sum nas200_twonkyupdate-6.0.28.tar.gz | awk '{ printf $1 }')" = \
    > "182a52343a4174ac03cf9b40cc984d0f" \
    > && tar xvzf nas200_twonkyupdate-6.0.28.tar.gz \
    > && cd rc.d/twonky/lib/ \
    > && ./INSTALL_NAS200.sh
    wget: www.nas200.net: Host name lookup failure
    $
    any ideas?
     
  16. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I just checked and the file is still online. Make sure your Internet connection is working and your NAS200 and your firewall are set up correctly. I can't help you with that; it's different for everyone. In most cases, if you have a router to connect your LAN to the Internet and it works for your PC and other devices, setting up the NAS in DHCP client mode should be enough.

    Note, because of the age of this thread, I don't know if this still works; I haven't tried it myself in ages, sorry.

    ===Jac
     
  17. Franklin Melo

    Franklin Melo Reformed Router Member

    Hi Jac,

    Very nice job that you had done.
    I am facing with one problem, my Twonky server is getting down after some minutes that was started, also it is losing the scans starting over and getting down again after some minutes.

    Any idea how to Solve it?
    Frank
     
  18. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Probably the program just uses up so much memory scanning for files that the kernel starts shutting tasks down (google for OOM_KILLER). Twonky and many other programs are just not designed for machines that have so little memory.

    ===Jac
     
  19. sjusto

    sjusto Reformed Router Member

    Hi Jac,
    First at all (because I forget to do it on my previous posts), thanks for your work, it's awesome.
    Right now I'm using twonky 6.0.39 (I just tweaked your INSTALL script and that did the rest).
    I would like to upgrade to twonky 7 because it has a smaller memory footprint and seems to be better to work with newer devices, and I've been trying to install it and manually run it (I can't make it run when the system starts because some start scripts has a different name).
    Before buying a new license I would like to know if there is any chance you take a look to it and release a new INSTALL script for this version.
    Thanks in advance.
    Santiago.

    P.D.: Excuse my english.
     
  20. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I haven't worked on my NAS200 software in a long time because I don't have much time, and not many people use it anymore. I think everyone has realized by now that the days of the NAS200 are over; it's been out of production for a long time, it's too slow to be really useful, it runs too hot with regular hard disks, and when it breaks down it's difficult to get the data off it. I do try to answer questions here and on the Cisco boards.

    I also don't run Twonky anymore on any of my systems. Every time I try, it tells me my (perfectly legitimate) license is already in use on another system. There are plenty of other DLNA servers out there that are free or cheap and that don't think I'm trying to rob them.

    If you can get my scripts to work with the latest Twonky, I'm sure others would appreciate if you can post them in this forum. Doesn't Twonky let you try their software for free for a while?

    It shouldn't be too hard to modify my scripts for a new Twonky, I think; even if it needs more updated libraries you can probably find a version of those libraries on a Linux that's compiled for x86 (not 686) computers (e.g. x86 Gentoo). I once started on a Gentoo for the NAS200 and kinda got it to work, and I still have all the binaries of that version so can help find files too. The only potential problem is that newer Twonky versions may be compiled for higher-level target hardware (686 vs. x86) that the RDC8610 is not compatible with.

    ===Jac
     
  21. jag_mex

    jag_mex Network Newbie Member

    Hi Jac, thanks alot for all your great work with JAC4. I still use the NAS200 with your firmware and I'm sure, that many others do so, too.

    My question to the community: It's July'12 now; does the script to update the Twonky MediaServer still work as is? Are all the files still online (NAS200.net and Twonky)? Thanks.

    Harald
     
  22. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    The script is still available, but I don't know if the Twonky download is. Either way, Twonky uses so much memory that I don't recommend running it on the NAS200.

    In these times, there are many cheap ways to replace the NAS200 by something better, with a better faster media server, faster file sharing and fewer heat problems. While I still have my NAS200, I don't really use it anymore. When I need the files on the disk, I usually just plug the disk into my router's USB port via a USB-to-SATA dongle. My router runs Linux and understands the ext2 file system just fine, and it's faster than the NAS200 although it has less features -- but I'll fix that by installing DD-WRT some day.

    ===Jac
     
  23. Jules2112

    Jules2112 New Member Member

    Hi Jac... I applied the above update to my NAS200 along with your firmware. Worked flawlessly. I'm not a Linux person so I appreciate the copy/paste steps you provided. Can you please tell me if you know if the 7.1.2 Linux version of Twonky Server is compatible with NAS200? If yes, would you be able to provide me a copy/paste method to install 7.1.2 Linux over the 6.0.28 version? Thank you so much and Happy New Year!
     
  24. marcars

    marcars Serious Server Member

    7.1.2 works for my on nas200. Just copy all files to harddiskxxx/rc.d/twonky and in url webbrowser tap http://ip-nas:9002 or 9001
     
  25. jag_mex

    jag_mex Network Newbie Member

    Hi Marcars, could you please share detailed step-by-step instructions with us?
     
  26. marcars

    marcars Serious Server Member

    naturally:)
    1. Download a new version from here Version 7.1.2 (Linux: manual installation)
    2. Create a folder rc.d on /harddisk/volume_1/data using WinSCP
    3. In folder rc.d create a new folder twonky.
    4. Copy all files from unpacking twonky.zip like cgi-bin, plugins ... to folder twonky
    5. Give a permission 0777 for all folders and files in twonky folder.
    6. Go to terminal (you must be here: /harddisk/volume_1/data/rc.d/twonky) in WinSCP and type:
    Code:
    ./twonky.sh stop
    and after that type:
    Code:
    ./twonky.sh start
    you should see something like that:
    Code:
    /harddisk/volume_1/data/rc.d/twonky$ ./twonky.sh start
    Starting ./twonkystarter ...
    Twonky Version 7.1.2
    00:11:05:832  [Startup] - LOG_SYSTEM: upnp_ini_file_init_DATA_Dir : AppData folder - /var/twonky/TwonkyServer - cannot be accessed or not writable.
    00:11:05:834  [Startup] - LOG_SYSTEM: Error: 2 No such file or directory
    
    7. Go to the root folder / and go to folder /var
    8. Create in folder /var new folder twonky
    9 . In new created folder twonky add new folder TwonkyServer
    10. Give permission 0777 for all folder twonky and TwonkyServer
    11. Go back to /harddisk/volume_1/data/rc.d/twonky
    12. make a command in terminal again
    Code:
    ./twonky.sh stop
    and
    Code:
    ./twonky.sh start
    13 . Go to /var/twonky/TwonkyServer and refresh the window with files ( right mouse click and choose refresh). You should see now new files like db, ddb_updates, device store...
    14. Now go to your browser and tap http:/ip-nas:9001 or 9002
    15. You should now see your twonky server:)
    twonky.jpg
     
  27. jag_mex

    jag_mex Network Newbie Member

    Hi Marcars, thanks a lot for the great instructions!

    Without problems I'm able to find my server at http:/ip-nas:9000, but after a restart of the NAS, the /var/twonky/TwonkyServer is always gone. How do I make that folder permanent? And how do I automate the ./twonky.sh start command? Some kind of rc. script maybe?

    Thanks
     
  28. marcars

    marcars Serious Server Member

    no problem:)
    really i don't know how can you automate a twonky autostart. Yes i know that after restart Nas server the Twonky media server is gone. You must after restart replay my instructions or Nas server do not shut down:)
    Perhaps jac_goudsmit know how can we add script to automate startup the new twonky server?
     
  29. jag_mex

    jag_mex Network Newbie Member

    Here's what I tried now:

    I created file "rc.twonkystart" with the following content in my rc.d folder:

    Code:
    #!/bin/sh
    #
    # Save this as /harddisk/volume_*/data/rc.d/rc.relocate
    # The volume number depends on your configuration
    # If running in RAID mode: volume_3
     
    mkdir -p /var/twonky/TwonkyServer
    /harddisk/volume_3/data/rc.d/twonky/twonky.sh stop
    /harddisk/volume_3/data/rc.d/twonky/twonky.sh start
    Of course the big disadvantage ist, that the library needs is be built up from scratch everytime the NAS restarts (I mentioned before, that the /var/twonky/TwonkyServer disappears after a NAS restart).

    And I don't know why, but I can't save the settings of the Twonky server (e.g. folders to scan, friendly server name, etc). I set the rc.d/twonky foldert to 0777, but settings don't save and I can't restart the Twonky server from the web console (It never finishes restarting).

    JAC, I know, that you're not into the NAS200 issues any more, but there are still some warriors out there... Some advice for us?
     
  30. hmiprueba

    hmiprueba New Member Member

    could not install until I saw your explanation! Thank you. PD. know any place where I can get one complete without license. ;)
     

Share This Page