You are here: Home » Topic » Running Two Copies of Firefly on a Single NSLU2

Running Two Copies of Firefly on a Single NSLU2

FireFly Media Server (formerly mt-daapd) Firefly Media Server Forums Firefly Media Server Setup Issues Running Two Copies of Firefly on a Single NSLU2

This topic contains 24 replies, has 7 voices, and was last updated by  Anonymous 10 years, 9 months ago.

Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
    Posts
  • #322

    Sherlock

    There was some discussion in the ‘General Discussion’ thread
    http://forums.fireflymediaserver.org/viewtopic.php?t=4683
    about ‘removing’ a drive without removing the song information from that drive from the database. After thinking about my own requirements, I decided it would be more useful for me to actually be able to run two copies of Firefly, each with their own database of music. Since I was not sure if it was technically possible, I asked and Ron replied:
    @rpedde wrote:

    Technically, yes. You’d need to make two config files, with two different db_parms (directories), different ports, different names, and different mp3_dirs. You could share admin-roots.

    Should work fine.

    — Ron

    I decided to start a new topic in the ‘Setup Issues’ thread for this specific subject. This will make it easier for anyone else interested in doing this to find this thread.

    Since I am not a Linux person, I undoubtedly will not be able to do this without help. That is the other reason I am posting this; in the hope that someone with more Linux skills may also be interested in doing this. So if anyone else has an interest in this, let me know.

    #4882

    Sherlock

    With all the stores decked out for Christmas, I decided it was time to get all my Christmas music on my NSLU2 and see about running two copies of Firefly; one for our regular music and one strictly for Christmas Music. I setup a new folder on the NSLU2’s disk called ‘xmasmp3’ and created a new config file called ‘xmas-daapd.conf’ as shown below.

    web_root        /opt/share/mt-daapd/admin-root
    port 3690
    admin_pw mt-daapd
    db_dir /opt/var/xt-daapd
    mp3_dir /share/flash/data/public/xmasmp3
    servername XMAS Music
    runas guest
    playlist /opt/etc/mt-daapd/xt-daapd.playlist
    extensions .mp3,.m4a,.m4p
    #logfile = /var/log/mt-daapd.log
    rescan_interval 600
    always_scan 0

    I then enter the following via telenet to start the second copy of Firefly:

    /opt/sbin/mt-daapd -c /opt/etc/mt-daapd/xmas-daapd.conf

    When I turn on my Soundbridge, I can now select which music library I want to listen to; either our regular library or our Christmas library.

    Since I am a Linux newbie, I would appreciate a post if anyone spots a problem with what I have done. Otherwise, I have documented what I did for anyone else that may find this useful.

    #4883

    rpedde
    Participant

    @Sherlock wrote:

    Since I am a Linux newbie, I would appreciate a post if anyone spots a problem with what I have done. Otherwise, I have documented what I did for anyone else that may find this useful.

    That looks great. Glad it works. Thanks for the feedback.

    — Ron

    #4884

    Sherlock

    @rpedde wrote:

    That looks great. Glad it works. Thanks for the feedback. — Ron

    And thanks to you, Ron, for such a great package. I hope to be able to move to a nightly, but my lack of Linux knowledge keeps holding me back. In the meantime, my wife and I are enjoying listening more to our music. Being able to listen to what we want wherever we are in the house is really great.

    #4885

    RickV
    Participant

    I’m also thinking of splitting up my music library.

    Ron said:

    Technically, yes. You’d need to make two config files, with two different db_parms (directories), different ports, different names, and different mp3_dirs. You could share admin-roots.

    Should work fine.

    — Ron

    Sherlock showed his second config-file:

    web_root /opt/share/mt-daapd/admin-root
    port 3690
    admin_pw mt-daapd
    db_dir /opt/var/xt-daapd
    mp3_dir /share/flash/data/public/xmasmp3
    servername XMAS Music
    runas guest
    playlist /opt/etc/mt-daapd/xt-daapd.playlist
    extensions .mp3,.m4a,.m4p
    #logfile = /var/log/mt-daapd.log
    rescan_interval 600
    always_scan 0

    Unfortunately the config-file shows more than just the settings which are different according to the other config-file.
    Am I right and are the following settings the settings that makes the difference:
    web-root
    port
    db-dir
    mp3-dir
    servername

    Please can someone confirm and also tell me some more about the port to be used. How can I determine wich port is free?
    Also can someone tell me more about the web-root? Will this be the web-page for the second firefly instance? [/quote]

    #4886

    rpedde
    Participant

    web-root
    port
    db-dir
    mp3-dir
    servername

    Copy your mt-daapd.conf to mt-daapd2.conf.

    edit mt-daapd2.conf, and change the following values:

    general/port (to anything different, but between 1024 – 65535. I use 9999. No reason, just do.)

    general/db_parms (I’d change it to /opt/var/mt-daapd2)

    general/mp3_dir (to wherever your other music is)

    general/servername (to whatever you want it named).

    Then do “mkdir /opt/var/mt-daapd2” (or whatever dir you used), and “chown nobody /opt/var/mt-daapd2”.

    Then go ahead and run it: “/opt/sbin/mt-daapd -c /opt/etc/mt-daapd2.conf”

    Wait for it to index, and see how it works.

    Check your syslog if you see any problems.

    And yes, the web-root is the base of the web pages for the web admin — those can be the same for both instances.

    #4887

    RickV
    Participant

    Ron,

    Thank you for the detailed description. I managed to install a second instance.

    With this second instance I wanted to serve a MP3 directory containing 13161 songs with lots of artists. In fact this are all the songs that were in the Dutch Top40 Charts from 1968 up till now. The directory is almost 60Gb, so approximately 5 Mb per song.

    When browsing-by-artist this MP3-directory I again got the message “browse failed”. Then I reduced the number of songs, for testing, to 10 songs and then it works fine.

    It looks like there has to be a limit which is exceeded.
    My other music-library contains at this moment 10101 songs. This directory is 82 Gb, almost 9 Mb per song.

    Is it possible to add another firefly instance serving a third library? What will be the drawback apart from searching for a specific song.

    I use a wired connection with a Linksys WRT54G router.

    #4888

    fizze
    Participant

    is your NSLU2 de-underclocked? or is it a recent buy, so it already runs at 266Mhz?

    the de-underclocking has a tremendous performance impact.

    Other than that, sure, you can run as much firefly instances as you want. Just repeat the steps for each instance. but be aware that the nslu2 has a limited amount of memory. I’d estimate more than probably 4 instances wouldnt work at all.

    #4889

    mas
    Participant

    If memory is the limiting factor the de-underclocking wont help. In this case he needs to fatten his slug (nasty work) or remove as many as possible running threads from the memory.

    De-underclocking will help if timeout due to excessive cpu load is the reason. Watching memory and cpu consumption while acessing the device may help to give an answer here. But IMHO (and at least for a de-undeclocked slug) the memory is often far more the limitation than CPU.

    #4890

    rpedde
    Participant

    @rickv wrote:

    When browsing-by-artist this MP3-directory I again got the message “browse failed”. Then I reduced the number of songs, for testing, to 10 songs and then it works fine.

    It looks like there has to be a limit which is exceeded.
    My other music-library contains at this moment 10101 songs. This directory is 82 Gb, almost 9 Mb per song.

    Probably timeout on waiting for browse data. You can try making an index on artist on the database — that should probably work.

    Try this:


    [email protected]:~$ cd /opt/var/mt-daapd
    [email protected]:/opt/var/mt-daapd$ sqlite songs.db
    sqlite> create index idx_artist on songs(artist);
    sqlite> .quit

    You’ll have to do that as root, probably, and then chown everything back to guest.

    See what that does.

    — Ron

    #4891

    RickV
    Participant
    [email protected]:~$ cd /opt/var/mt-daapd

    If I give this command, from the root-directory, I receive the the following error:

    # [email protected]:~$ cd /opt/var/mt-daapd2
    [email protected]:~: not found

    You said:

    You’ll have to do that as root, probably, and then chown everything back to guest.

    Sorry, I’m not very familiar with the OS on the MSS. How do you do it as root, and what files has to be chown back to guest? The songs.db and the index-file?

    #4892

    sonichouse
    Participant

    @rickv wrote:

    f[email protected]:~$ cd /opt/var/mt-daapd

    If I give this command, from the root-directory, I receive the the following error:

    # [email protected]:~$ cd /opt/var/mt-daapd2
    [email protected]:~: not found

    You said:

    You’ll have to do that as root, probably, and then chown everything back to guest.

    Sorry, I’m not very familiar with the OS on the MSS. How do you do it as root, and what files has to be chown back to guest? The songs.db and the index-file?

    you need to type

    cd /opt/var/mt-daapd2

    followed by

    sqlite songs.db

    and then the SQL commands

    #4893

    RickV
    Participant
    cd /opt/var/mt-daapd2
    sqlite songs.db

    This results in:

    sqlite: not found

    Probably a path-problem resulting in not finding the sqlite.

    As in the installation guide I tried the following:

    cd /opt/var/mt-daapd2
    LD_LIBRARY_PATH=/opt/lib /opt/bin/sqlite songs.db

    I don’t know the exact functionality of the LD_LIBRARY_PATH (if someone can explain it some more it would be very nice).

    When issueing this command there is no error but the following resonse:

    # LD_LIBRARY_PATH=/opt/lib /opt/bin/sqlite songs.db
    SIGSEGV
    #4894

    rpedde
    Participant

    @rickv wrote:

    As in the installation guide I tried the following:

    cd /opt/var/mt-daapd2
    LD_LIBRARY_PATH=/opt/lib /opt/bin/sqlite songs.db

    I don’t know the exact functionality of the LD_LIBRARY_PATH (if someone can explain it some more it would be very nice).

    The issue on the mss is that the mss is broken. Maxtor hasn’t released the source code and everything that someone needs to be able to compile a binary that works on the mss. People have used development tools that make binaries that will run on that architecture, but they are incompatible with the libraries and stuff that already run on the mss.

    I’m not sure what’s up with that, it seems like a gpl violation to me, but I haven’t really looked very closely at it. To work around it, people make replacement libraries and put them in /opt/lib. So long as programs use the libraries in /opt/lib and not the libraries in /lib, then stuff runs. Stupid situation, but that’s how it is, I guess.

    When you set a LD_LIBRARY_PATH, that basically inserts a path at the top of the library search path. So libraries get looked for in the directory specified in the LD_LIBRARY_PATH. Normally that works for applications, but if they fork, or otherwise manipulate the environment variables, it’s possible that it could lose that variable, and then the right libraries can’t be found, and then it doesn’t work any more. Gack!

    That’s what’s happening to you.

    Seems like this:


    /opt/lib/ld.so.1 /opt/bin/sqlite /opt/var/mt-daapd2/songs.db

    works better, as (I think) it uses the /opt loader to load libraries, and so it can’t forget to load the libraries from /opt/lib first. Or something. Not entirely sure myself why that works.

    In any event, try that, using the path that you have specified for your db_param to find the songs.db you want to add the index for. You should do that with the program not running, then start it afterwards.

    — Ron

    #4895

    RickV
    Participant

    Hey Ron,

    That did the job. Although the sqlite interface is awfull (no response on what is going on, and I had to use putty again) the index was made and now the browse-failed message is gone.

    I think adding this to firefly as standard functionality will be a good thing. I mean that the songs-database is automatically set up with indexes on the browsing columns (ie artist, album, genre). With a full scan I think the best thing to do is: first drop the index and then re-create it again. Then the actually full scan. With the normal-scan I think you can leave the index as it is, it will be updated because of the updated mp3-directory content.

    I will try if the browse functionality is also working if I put the MP3-directories together. I will let you know if that’s working too.

Viewing 15 posts - 1 through 15 (of 25 total)

The forum ‘Setup Issues’ is closed to new topics and replies.