Using Mopidy with a Network Share - My options for good performance?


#1

Hi!
I am currently on my quest for the best audio setup on Linux.
I landed with Mopidy because of its great integrations, and now got it setup after the usual hickups when diving into a new topic.

My main usecase would be the playback of lossless music from my FreeNAS NAS, and also MPD. Also planned but not mainly in my focus now are Subsonic and Spotify integrations.

The FreeNAS Music is shared both by SMB and WebDAV. At first i used the SMB share which i mounted as non root into a dir of my home dir, so there would be no permissions problem, as opposed to mounting “normally” as root, where non root apps and users dont have access.
Sadly that didnt work out, and mopidy gave errors, even though all other non root software dont have those problems.

This is the command i used:
sudo mount -t cifs -o username=FOO,password=FOO,uid=1000,gid=1000 //192.168.178.32/Music “/home/stele77/FOO/”

Now i mounted the music by WebDAV with davfs, and the permissions problem is gone. But it seems that this is slower than SMB, and the scan will take several days to complete.

Is there a way, with which i could enter the SMB adress into the config file directly, so i dont need to mount it into the file system first? And if yes, how do i add username and password (I dont mind to save it in config in clear text and know about the consequences).

Like this:
[file]
enabled = true
media_dirs =
//MYSERVERNAME/SHARE
show_dotfiles = false
excluded_file_extensions =
.jpg
.jpeg
follow_symlinks = false
metadata_timeout = 1000

[local]
enabled = true
library = json
//MYSERVERNAME/SHARE
and so on…

MY SYSTEM:
Desktop - Antergos (Arch based)
Server - FreeNAS 11.2

EDIT: I only moved to Linux End of last year, so please forgive me if i missed something obvious… :slight_smile:


#2

No, Mopidy cannot mount the network location for you.

Do we assume you are running Mopidy as a service and you have read the documentation page about what that means? Specifically the user and group Mopidy will run as?

What were your error messages?

You should be fine to mount as any user (or via fstab) and access the files from any user, provided you use the correct mount options. uid and gid only have effect when the file server does not support cifs Unix extensions e.g. Windows. I don’t know what freenas supports. And it’s worth remember that it’s about ownership.

If you haven’t already done so, I strongly recommend you read the mount.cifs manual. There’s lots in there about permissions. Your freenas may support cifs Unix extensions so keep that in mind. There’s also info in there regarding performance tweaks.

You should probably specify noatime if that’s not the default on your system. I’d personally mount it read-only. There’s the nounix and even noperm options if you get totally stuck (see the man page).


#3

First off, thank for your fast reply!
I just came from work, so i will have to take some time tonight to dig into this.
But some points i can answer now:
No, i am not running it as a service, i start it from my terminal as my normal user account.
I always mount all shares manually after boot, so running as a service is not an option AFAIK, because it would need access right after boot; Not after some minutes later when i mounted the shares manually into the file system.
I know i could have them mounted by fstab, but sometimes my NAS i shut down, and in this case i think it would produce problems when trying to auto mount without the NAS avaiable.
While i read the man page, the several wikis, and asked for help on stackexchange, the result was the command line i posted, but as you say access should normally work with any user, i certainly will have to look into it again.
Just some weeks (i think 2-3 months) ago i moved to linux, and i am still learning, and permissions and mounting are the part which is most complex too me… But its reassuring to hear that there must be a way for the access to work without any workarounds!
And the performance tweaks is something i didnt explore yet (mostly as i was happy to get it working at all after days and weeks of frustrating trial&error.
So thank you again for your help! It could not have helped me more, as i now have a clear idea of the way forward!
Have a nice evening!
PS: The scan is now through, a day faster than expected. So while i work my way out of the SMB problems, i can use the WebDAV solution till then to learn about Mopidy and finetune the rest of the Setup!


#4

So I now checked it all again…
I rebooted my system and mounted the music by SMB into the media dir where i had it mounted by WebDAV before.
Like it has sometimes been with my linux journey, it now works. No permissions problem, nothing.
I can browse the libary with the various GUI apps on the desktop, and even successfully remote controlled the playback with my android device!
My system is also not bogged down by webdav mounting. I just had some hickups where the playback got stuck, but i am confident to solve those minor issues.
In 1-2 months i plan to upgrade my FreeNAS to a 6C/12T Core i5 8TH Gen, and together with the SMB fine tuning you pointed me too, i think this setup could becore exactly what i wanted (Playback on Desktop with advanced Android control including libary browsing, and playback on Android directly)!
Thats what i love about Linux + FOSS: All the hard work, the frustration… And then BAM: You are rewared like no other solution possible could! :slight_smile:
Thanks again, i will now continue my journey getting Subsonic + Spotify integration to work!