Scanning library on NAS - much faster

This is a follow-on from a discussion in https://volumio.org/forum/artist-view-images-t5091.html. I think it needs it’s own thread.

If, like me, you often have to rescan your entire music library from a NAS, either because you have re-installed or upgraded Volumio or you have moved your collection, then the process can be very time consuming - particularly if your NAS is a little slow like mine (running samba on an $8 NanopiNEO) and of course this can be even longer if you have multiple Volumio devices to update.

One way to make this process much faster is to build the new mpd database directly on the NAS if it has the capability to run mpd and then have Volumio read the database from the NAS. I did this and in the case on my modest library which currently has: Artists:662 Albums:475 Songs:7110 I had the following results:

Creating the database locally on Volumio running on my Raspberry Pi3 Model B from a music library on my NAS took 67 minutes (106 songs/minute)

Creating the database directly on my NAS took less than 5 minutes (1,422 songs/minute)

I have been able to get Volumio to read the database from the NAS but I did run across a few problems trying to get it working. In order to do this we must do 3 major things;

  1. Install mpd (and mpc optionally) on the NAS

  2. Mount the NAS folder with the tag_cache database on the Volumio device

  3. Ensure that the tag_cache file built on the NAS is IDENTICAL to the tag_cache file that Volumio (via mpd) would build

  4. was easy.

  5. was a problem because Volumio started mpd before I could get the NAS folder mounted. I tried everything I could find to delay the mpd service until after the NAS folder was mounted but they all failed. I still haven’t completely solved this yet in the correct way so I enabled rc.local from systemd and do an mpd reload from there after a 20 second wait.

  6. Simply requires some thought to ensure that the path to music on the NAS from the music_directory is exactly the same as it is on Volumio. In my case on my NAS I added a NAS folder to /var/lib/mpd/music and a symlink in there that points to my actual music folder (media/USBHDD1/Music) then set my music_directory in mpd.conf to “/var/lib/mpd/music”

I would like to be able to mount the NAS drive before MPD starts without messing around with rc.local so any ideas would be welcome. I would also like to add a link or button somewhere on the Volumio web interface to run mpc --update on the NAS and then restart mpd on Volumio once the update is finished but I haven’t looked at that yet. If anyone else is interested in doing this or has some ideas then I’m all ears (or eyes!).


Liberator

I’m thinking the same way as you. I came upon your post after being sick of waiting an hour to get to play a new album I’ve added to my Openmediavault NAS. I might give your mod a try but I don’t like that I isn’t completely working as you and I would like it. I saw there was a feature request for this on GitHub. I think that this feature should get more attention due to the fact that Volumio was made to run its music from network shares in the first place. So why not have the option to Ave the MPD database running of that NAS?

I’m sorry I myself can’t be of much help. I might be able to start hacking away through SSH until it works but that just sounds like a bricked Volumio waiting to happen.

Hello,
I also have the same problem as you! Do you find a solution?
jp