What's new

Minidlna with Custom Icon, Rescan & Video Thumbnails through New Generation Optware

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Works fine on my TV

  • Samsung C Series TV

    Votes: 0 0.0%
  • Samsung D Series TV

    Votes: 0 0.0%
  • Samsung J Series TV

    Votes: 0 0.0%

  • Total voters
    4

TeHashX

Very Senior Member
Hi all, we have a special version of minidlna with Custom Icon, Bookmarks & Video Thumbnails through New Generation Optware.
This version has a special scan mechanism. On rescan, any directories and files which cannot be access are removed. Any files with different timestamps are removed, then reinserted. New files and directories are added as long as they are readable.
Step by step guide is here https://www.hqt.ro/minidlna-media-server-with-thumbnails-through-optware-ng/
Please test, complete the poll and leave feedback.
Thanks @allexx
 
Last edited:
The biggest problems that I see in the minidlna shipped with asuswrt/merlin is that:

1) seems database is not persisted to storage. So on every startup, minidlna crawls folders and builds the database from scratch. This is plain silly.. and inefficient.

2) new file notifications seem only work for folders in a disk physically attached to the router through USB.

If there is a version that copes with the above two, that'll be great. Icons/thumbnails are nice. Will find time to give it a trial.
 
The biggest problems that I see in the minidlna shipped with asuswrt/merlin is that:

1) seems database is not persisted to storage. So on every startup, minidlna crawls folders and builds the database from scratch. This is plain silly.. and inefficient.

Then ask the minidlna author to implement code to allow updating an existing database. Otherwise, there's no way for minidlna to reuse an existing database without knowing if it's up-to-date or not.
 
1) seems database is not persisted to storage. So on every startup, minidlna crawls folders and builds the database from scratch. This is plain silly.. and inefficient.
You can shut off the scan at every boot by entering the following via telnet/ssh

nvram set dms_rescan=0
nvram commit
 
You can shut off the scan at every boot by entering the following via telnet/ssh

nvram set dms_rescan=0
nvram commit

Nice, I didn't know it. This apparently works*.

Now regarding this..
2) new file notifications seem only work for folders in a disk physically attached to the router through USB.

To be fair, file insert/delete notifications depend on the kernel feature inotify. It works as long as the file operations (create/delete/etc) are performed on the router so that the kernel is aware of. If a file is done outside the router then it breaks down.

In my case, I mount NFS shares from PC to the router. And I read elsewhere there is a trick to trigger inotify with touch. Apparently this doesn't work with the stock NFS in Asuswrt/Merlin. Not sure if I'll have better luck with the NFS from Entware. Haven't got the time to try.

*It didn't work on first tries. I guess I'm the minority...that I put db_dir under a dot directory (e.g. /mnt/usb_disk/.mini_db). Seems miniDLNA is not happy with it. Remove and create the whole db_dir on every restart regardless of force rescan or not. It works eventually (with dms_rescan=0) without the dot i.e. /mnt/usb_disk/mini_db. Looks like a bug..
 
*It didn't work on first tries. I guess I'm the minority...that I put db_dir under a dot directory (e.g. /mnt/usb_disk/.mini_db). Seems miniDLNA is not happy with it. Remove and create the whole db_dir on every restart regardless of force rescan or not. It works eventually (with dms_rescan=0) without the dot i.e. /mnt/usb_disk/mini_db. Looks like a bug..
I also use a hidden directory and it works for me on my fork (in fact the default is to use a hidden directory).
 
I also use a hidden directory and it works for me on my fork (in fact the default is to use a hidden directory).

Indeed, dot file is not the issue.

I store my config in /jffs/configs/minidlna.conf (which I created by copying from /etc/minidlna.conf) so that I can deal less with WebUI. Checking further, when the wipe-out happens, I have "db_dir=/mnt/usb_disk/.minidlna" in /jffs/configs/minidlna.conf.

Also in nvram, I can see "dms_dbcwd=/tmp/mnt/usb_disk/.minidlna" and "dms_dbdir=/tmp/mnt/usb_disk/.minidlna". i.e. the same location as above.

With above setup, force rescan or not, the whole directory "/mnt/usb_disk/.minidlna" is wiped out on startup. If I change db_dir in /jffs/configs/minidlna.conf to something not ending with ".minidlna", the db_dir won't be wiped out.

I think that's the case. Seems reproducible..
 
I've build minidlna with Non-destructive update rescan patch test packages:
http://optware-ng.zyxmon.org/test/minidlna-rescan/
Please test and give feedback. If it works, I can either add these packages to the repos, or alternatively apply the patch to minidlna and minidlna-thumbnail packages
I tested minidlna-rescan-thumbnail_1.1.4+git20150805-1_mipsel
Started a full scan then stopped minidlna, added 2 new video files and started minidlna again, db was not updated.
Then I remembered about -r flag and I added -r to /opt/etc/init.d/S98minidlna script
Code:
-$DAEMONIZE -a -c /opt/sbin -e $LOG_FILE -o $LOG_FILE $DAEMON $DAEMON_OPTS -d
+$DAEMONIZE -a -c /opt/sbin -e $LOG_FILE -o $LOG_FILE $DAEMON $DAEMON_OPTS -d -r
Restarted minidlna and the 2 video files was there :)
Stopped again and removed 5 video files, after restart the 5 video files was not there anymore :)
So I made more test and patch seams to work, will see after some days of usage.
Now it's up to you if the rescan patch should be integrated or make multiple builds.
Thanks @alllexx
 
This post is the first I've heard of O-NG. I see there is something in the wiki now a couple of weeks ago, but there really isn't any explanation of what this is or why it would be better than Entware. So, add my cluelessness to my hesitancy. My knowledge of this is limited to Optware is old, Entware is a newer version.
 
  • Like
Reactions: bmi
This post is the first I've heard of O-NG. I see there is something in the wiki now a couple of weeks ago, but there really isn't any explanation of what this is or why it would be better than Entware. So, add my cluelessness to my hesitancy. My knowledge of this is limited to Optware is old, Entware is a newer version.

I can't say that Optware-ng is better than Entware. Optware-ng is an attempt to upgrade Optware by using modern toolchains and upgrading, fixing and adding multiple packages. Entware, on the other hand, has some packages specific to it, but is mostly based on OpenWrt code. Some packages in Entware aren't there in Optware-ng, and vice-versa. It's hard to compare the numbers of packages available, since Entware follows OpenWrt approach to package many ipk's from one built sourcecode. Optware rarely does this. The same goes for package versions: some package in Entware are newer, others --- older. Entware has more users, is based on OpenWrt, so it's more tested. However, if you find a bug in Optware-ng, please open an issue in github, and I'll do my best to fix it. If you want a new package not yet in Optware-ng, create an issue too, and I'll add it if it's not too time-consuming to do this (or even if it is, in case this new package is interesting for me).

One thing that is certainly unique to Optware-ng is X11 and GTK+-2/3. It has some working GUI apps, like deluge-gtk, thunar, rox-filer, mousepad, transmission-gtk and some more. You can run them using an X11 server on your PC with SSH X11 forwarding (see http://www.dd-wrt.com/phpBB2/viewtopic.php?t=280188 for instructions).

Finally, you can always backup your existing setup and try. You'll be able to easily roll back if you like.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top