MiniDLNA indexing bug


I want to use minidlna to serve files that are placed on an USB stick which is plugged into my router. The stick is mounted to /mnt/sda1. The minidlna config is set to use that path.

The problem is that minidlna is not indexing any file that is placed in /mnt/sda1. I also tried to index files placed in /tmp/indextest just to see if the USB stick might be the problem. Tried to index sound files. Seems the path doesn't matter. Nothing gets indexed.

Checked minidlna-not-finding-any-files but this didn't lead to anything. Also de-installing and re-installing minidlna didn't help.

Is this a bug or am I missing something here?

Update: Tried to index a photo, surprisingly this worked. So does minidlna have dependencies to be able to index sound files? Wouldn't those dependencies get installed automatically when installing minidlna?

1 Like

It seems the indexing is very unreliable. It indexes one out of 20 mp3 files i have on this USB stick. Doesn't index any flac or opus files.

Meh, minidlna seems very dysfunctional.

Ok, minidlna on OpenWRT really sucks. It only takes files stored in /mnt. It doesn't take files from sub-directories. It also does not take files from other directories if you explicitly set them in the config.

That means I would have to copy all files I want to have access to into the same /mnt directory. How can minidlna have such a crappy restriction?

Is there a workaround for this issue? Or is there another elegant streaming option that works without so much pain?

Ok, I think I got it to work, however, it still sucks. Somehow, if you copy over the files via scp or if you copy them to the USB stick on a computer and then plug the stick in, minidlna is not able to detect the files.

What works is: mount the stick to /mnt and set the music folder to /mnt/media/music in the minidlna config file.
Then, copy all relevant music files to /mnt. The last step is to move the files from /mnt to /mnt/media/music via mv command or via mc.

Only then minidlna is able to index those files. Opus and flac too, so my former assumption was wrong. It's just a very weird piece of software.

You didn't say what kind of router you're using, but the issue is most likely a lack of sufficient ram for minidlna to index a bunch of files at once. I suggest you put minidlna's index files into persistent storage so that minidlna doesn't have to regenerate them when you reboot.

You can also install the package zram-swap which will set up page swapping in a compressed ram drive, effectively making your ram bigger at the expense of cpu time for compression. The tradeoff is usually worth it if it gives you the extra space you need.

Or simply avoid DLNA completely...

Well, even if I copy just one file at a time, it doesn't work if I don't follow the workaround as described. Also, my router is quite powerful, I have 512 MB RAM so this is not the issue.

DLNA is just not really working well. Besides, I just realized that searching for files via DLNA is not possible, is it?

Guess I need another solution for streaming my music library.

I've been using minidlna for years on a 10+ year old router: 256GB usb stick with a large number of mp3/flac files organized in subfolders: no issues whatsoever. Searching works as well, but is slow - I use bubbleupnp on an old tablet as control point, which is the likelier culprit.

have you checked the logs?
minidlna will tell you what it's doing and why it skipped certain files etc.

@undef Thanks for the idea about the logs. I tried to check however, I cannot find any. I tried to set it in the conf but it seems minidlna does not create any. How to get minidlna creating logs?

did you check the system logs?
e.g. with logread | grep minidlna

alternatively you can run minidlna from the cli, stop the running instance /etc/init.d/minidlna stop and run it in debug mode (-d) or non-daemonized (-S). Be sure to point it to the generated conf file though: /usr/sbin/minidlnad -S -f /var/etc/minidlna.conf

Thanks a lot for those suggestions! -S is not really helpful but -d gives a lot of debug info on every file.

Using -d I found the issue. Somehow some files and folders had the wrong permissions. So I did chmod -R 644 to my whole sound files folder including subfolders. As it seems that doesn't work well for minidlna. So I had to set -R 777 to this folder and its subfolders. Bad practice on Linux, I know. But I don't wanna dig deeper into this as it is just the music folder. Finally it works.

good that you got it working.

FWIW, not setting the execute bit (644) on folders means you prevent minidlna cd'ing into them.
This is not a minidlna issue, but a the way permissions work.
You need the 'x' on the folders, no need to give everyone/everything (i.e. your music files) 777.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.