DLNA Server sorting

Discussion in 'Tomato Firmware' started by Arjen, Sep 29, 2013.

  1. Arjen

    Arjen Networkin' Nut Member

    Hi everybody, first of all I would like to thank the people behind TomatoUSB, it's really awesome. I have had it running on a Asus RT-N66U for a few months. I'm using shibby 1.28.

    I use the media server a lot and it runs pretty good but I have problems with the file sorting. I have a Panasonic and apparently these TVs don't specify a type of sorting when they request the list of files from the DLNA server. This makes the list of files show by creation date which kind of sucks.

    Some DLNA servers have the option of "forced sorting" for Panasonic TVs, is there a way to enable this on Shibby's TomatoUSB DLNA Server?

    Thanks for reading :D
  2. rs232

    rs232 Network Guru Member

    Does your TV allow folder browsing?
    If so you might just want to organise your media in folders
  3. Arjen

    Arjen Networkin' Nut Member

    Hi, thanks for your reply. I do use folder browsing and I have my media in folders, but once in the folder, let's say for a tv show, the episodes show out of order.

    I have found a workaround for this. I downloaded a software to change timestamps on files. I'm using "eXpress TimeStamp Toucher". I used it to make every single file on my media library have the same date and time for creation date and modification date. After this, it seems that the Panasonic uses the file name as a second sorting criteria. It's not the best solution but it works. Wish the miniDLNA on Tomato had forced sorting thou.

    Thanks again!
  4. rs232

    rs232 Network Guru Member

    I believe sorting is something that is done on the final device. Think when you access files on a NAS, samba doesn't have any understanding of sorting it's a client function.
    I have a Samsung TV and have on "MOVIE" parent directory, then for each video a subdirectory e.g. "wedding" "lord of the rings" a.s.o Samsung does allow for sorting though but the default (Alphabetically) is good enough and I have never touched it

    P.S. Are you running an updated TV firmware?
  5. Arjen

    Arjen Networkin' Nut Member

    Sorting is done by the DLNA server as specified by the final device. If the final device doesn't request an specific sorting, the DLNA server sends the file list in the order it wants. This is a problem on some Panasonic TVs. There is no option to select the sorting. Some DLNA servers have the option of "forced sorting" to fix this issue. I believe TomatoUSB uses MiniDLNA. I have found that MiniDLNA or ReadyMedia (new name for the same) has the option of forced sorting, but I can't find this option in TomatoUSB. Maybe the feature is too new or something.

    1.1.0 - Released 04-April-2013
    - Add forced sorting support for Panasonic devices.

    My TV is a Panasonic 42E5A, it's really not so smart. I have the latest firmware.
  6. rs232

    rs232 Network Guru Member

    The config file is located under: /tmp/etc/minidlna.conf but I wouldn't know what it needs to be added (if any!)

    NOTE: tomato runs 1.0.26 which has been released the same day as readydlna 1.1.0 thus I guess they are the same.
  7. Arjen

    Arjen Networkin' Nut Member

    I don't know either. I can't find the option =/

  8. koitsu

    koitsu Network Guru Member

    A release date of the same day means absolutely jack squat.

    I'm not sure why anyone hasn't gone and looked at the relevant TomatoUSB code for this third-party software:

    Toastman 1.28.0503: minidlna 1.0.24 -- http://repo.or.cz/w/tomato.git/blob...9ed282311bf:/release/src/router/minidlna/NEWS
    Toastman 1.28.7503: minidlna 1.0.24 -- http://repo.or.cz/w/tomato.git/blob...5eed250ce55:/release/src/router/minidlna/NEWS

    tomato-shibby branch: minidlna 1.0.26 -- http://repo.or.cz/w/tomato.git/blob/refs/heads/tomato-shibby:/release/src/router/minidlna/NEWS
    tomato-shibby-RT-N branch: minidlna 1.0.26 -- http://repo.or.cz/w/tomato.git/blob/refs/heads/tomato-shibby-RT-N:/release/src/router/minidlna/NEWS

    I see no mention there in the NEWS file (equivalent of ChangeLog) in Shibby for "forced Panasonic sorting".

    In English: ReadyMedia 1.1.0 has some fixes/changes in it which minidlna 1.0.26 does not.

    Here is ReadyMedia/minidlna's master (meaning "work in progress" branch) NEWS file:


    Now here's the same file but for the v1.0.26 tag:


    And here's the History (within master):


    You won't find any mention of v1.0.26 there. Ever. That's because it looks like the project "forked" or "spun off" in some way; meaning minidlna 1.0.26 is something different than ReadyMedia 1.1.0.

    Solution: bring this up with the ReadyMedia/minidlna folks. Ask them about this. Point it out to them. Ask them for a patch for minidlna 1.0.26 if needed. Ask them for something. If you want me to go dig up the diff/changes, I can try to do so. Edit: I found the commit -- it's major/extremely large:


    The important part: this is not something the TomatoUSB folks should fix, it's something that needs to get hashed out further downstream with the third-party software author(s) of ReadyMedia/minidlna. If the solution is simply "have Shibby et al upgrade from minidlna 1.0.26 to ReadyMedia 1.1.0" then so be it, but it's fairly obvious ReadyMedia 1.1.0 is not out yet -- it's still WIP (there is no branch for it, it's under the "master" branch still).

    That download would be available here:

    Last edited: Sep 30, 2013
  9. Arjen

    Arjen Networkin' Nut Member

    Thanks Koitsu, you are right. I guess I came here because I was hoping for the option being available but buried somewhere I could not see. I did not see the difference between MiniDLNA and ReadyMedia. Thanks for all the information. Regards!
  10. koitsu

    koitsu Network Guru Member

    Shibby reads all the threads here, so I'm sure he'll come across this one and take into consideration updating minidlna to ReadyMedia 1.1.0 (it's still called minidlna, even the tarball is, so I don't know what the "ReadyMedia" name really means/represents).

    If that happens, 1.1.0 "should" (hopefully) fix your problems assuming your TV's client header matches what's in the above diff and is marked to use FLAG_FORCE_SORT. I don't know of a way to determine that aside from using tcpdump to capture packets and look (unless minidlna can run in a mode where it logs clients it sees; the code implies such, but no idea what flag or config option does it).
  11. RMerlin

    RMerlin Network Guru Member

    The name change must be recent, I only noticed it yesterday. I suspect he had to drop the use of DLNA in the name due to legal reasons - he even takes care to mention that ReadyMedia is NOT DLNA-certified.

    I remember some confusion around the time of 1.0.26 and 1.1.0. I think 1.0.26 was the work-in-progress, and it got renumbered at some point.
  12. Arjen

    Arjen Networkin' Nut Member

    Alright, so I'll have to wait for the next release of Shibby which will hopefully include the latest DLNA player ReadyMedia 1.1.0 or greater. Or install it myself (I don't think I'm there yet).

    It's weird that the new ReadyMedia has the same release date as the last MiniDLNA, yet not the same features.

    1.1.0 2013-05-07
    1.0.26 2013-05-07
    1.0.25 2012-07-13

    1.1.0 - Released 04-April-2013
    - Add support for other operating systems.
    - Switch to autoconf from our handcrafted genconfig.sh.
    - Add configuration option for UUID.
    - Add configuration option to specify the user to run as.
    - Add support for limiting a media dir to multiple media types.
    - Force a rescan if we detect a new or missing media_dir entry.
    - Fix crash caused by certain TiVo clients.
    - Fix crash bug on video files with some ffmpeg library versions.
    - Add support for TiVo MPEG-TS files.
    - Add some logging and forking tweaks to work better with systemd.
    - Validate or escape user input to prevent SQL injection.
    - Add forced sorting support for Panasonic devices.
    1.0.26 - Released 04-April-2013
    - Fix compiling with ffmpeg 1.0.
    - Fix a couple potential scanner crash bugs.
    - Fix inotify parsing of new video symlinks.
    - Validate or escape user input to prevent SQL injection.
    1.0.25 - Released 13-July-2012
    - Fix a couple crash bugs on malformed WAV files.
    - Forcibly tweak the model number for Xbox360 clients, or they might ignore us.
    - Enable all network interfaces by default if none were specified.
    - Add flag to force downscaled thumbnails rather than using embedded ones.
    - Add DirecTV client detection, and fix image resolution issue.
    - Add support for the latest ffmpeg/libav library versions.
    - Fix a potential crash on requests for a resize of a non-existent image.
    - Make DeviceID checking more permissive for Sagem Radio.
    Last edited: Sep 30, 2013
  13. koitsu

    koitsu Network Guru Member

    I don't know where that NEWS file is from. Here are the facts:

    * What's in master (i.e. 1.1.0): http://sourceforge.net/p/minidlna/git/ci/master/tree/NEWS
    * The NEWS file in the official 1.1.0 tarball goes in this order: 1.0.24, 1.0.25, 1.1.0
    * What's in branch 1.0.26: http://sourceforge.net/p/minidlna/git/ci/v1_0_26/tree/NEWS

    Short version: NEWS file in 1.1.0 (tarball or in the repo) does not mention 1.0.26 anywhere, so where the above quote/code block came from is either made up/created by the poster or is from a source that is not listed. Do not believe it. Believe what I have stated here.
  14. Arjen

    Arjen Networkin' Nut Member

    I'm sorry, I didn't mean to "make things up" nor I meant to contradict you. It was just a mash up showing the changes and released dates to compare the differences. I will edit to clarify.

    Some changes in MiniDLNA 1.0.26 are included in ReadyMedia 1.1.0 .
    Last edited: Oct 1, 2013
  15. Elfew

    Elfew Network Guru Member

    Contact devs, they know better ;)
  16. Arjen

    Arjen Networkin' Nut Member

    Hello, I came back to say that this issue has been solved. Not in the most elegant way in my case thou, but it works. Maybe someone here can point me to a more elegant fix.

    Shibby Version 119 features minidlna – 1.1.2

    This version has the following option in the conf file:
    # always force SortCriteria to this value, regardless of the SortCriteria passed by the client
    But it can't be setup through the GUI. To make use of it I edited minidlna.conf and save it as minidlna.alt on etc folder. The problem is that minidlna.conf get rewriten on startup and minidlna.alt just disapears. To solve it a I put it on my external hard drive and added a script to the WAN UP scrip seccion:

    cp /mnt/DATA/dlna/minidlna.alt /etc
    service dlna restart
    This copies the file from my hard drive into etc folder and restarts minidlna on reboot. This works for me.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice