miniDLNA memory leak and not scanning any media

  • I upgraded OMV from 0.3 to 0.4...all went fine.
    Problem is after installing the latest plugin for miniDLNA, the server no longer serves any of my media.
    All my media were available to the TV, XBMC, media centre, etc but not any more.
    In the logs, there was an inotify error but I fixed that by increasing max_user_whatever.
    The log now shows:

    Code
    [2013/02/28 22:39:31] minidlna.c:884: warn: Starting MiniDLNA version 1.0.25 [SQLite 3.7.3].
    [2013/02/28 22:39:31] minidlna.c:907: warn: Creating new database...
    [2013/02/28 22:39:31] scanner.c:731: warn: Scanning /media/a12d6ea5-174d-4943-afb2-a54b2c15f0de/drive0
    [2013/02/28 22:39:31] minidlna.c:990: warn: HTTP listening on port 8200


    My media drive contains .MKV and .TS files


    When I run


    dmesg | grep mini, I see:


    Code
    [  778.855398] Out of memory: kill process 1932 (minidlna) score 1395918 or a child
    [  778.912714] Killed process 1932 (minidlna)
    [ 1978.525059] Out of memory: kill process 3703 (minidlna) score 1396872 or a child
    [ 1978.584678] Killed process 3703 (minidlna)
    [26300.272044] Out of memory: kill process 1608 (minidlna) score 1394358 or a child
    [26300.333067] Killed process 1608 (minidlna)
    [31618.143793] Out of memory: kill process 14994 (minidlna) score 1392954 or a child
    [31618.206159] Killed process 14994 (minidlna)


    minidlna version is 1.0.25-2+0~1357321103.14~1.gbpdcecf1
    minidlna plugin version is 0.4+0~1355675183.5~1.gbpa4376d


    I have the following plugins installed:

    Code
    root@OMV:/var/cache/apt/archives# dpkg -l | grep openmediavault
    ii  openmediavault                      0.4.24                               Open network attached storage solution
    ii  openmediavault-ajaxplorer           0.1                                  OpenMediaVault Ajaxplorer (Web file browser) plugin
    ii  openmediavault-keyring              0.2                                  GnuPG archive keys of the OpenMediaVault archive
    ii  openmediavault-minidlna             0.4+0~1355675183.5~1.gbpa4376d       OpenMediaVault miniDLNA (DLNA server) plugin
    ii  openmediavault-netatalk             0.4.5                                OpenMediaVault netatalk (AppleTalk Protocol Suite) plugin
    ii  openmediavault-omvpluginsorg        0.4.1+0~1355675019.3~1.gbpe45741     OMV-Plugins.org Package Repositories for OpenMediaVault
    root@OMV:/var/cache/apt/archives#


    I have tried deleting /tmp/minidlna/files.db, but as soon as I start the minidlna service, that file is created (always the same size 73728 bytes) but no media


    What's going wrong ?

    HP Microserver N40L; OMV 6.1.1-1 (Shaitan)

  • apt-get remove openmediavault-minidlna
    apt-get remove minidlna
    apt-get clean
    apt-get update
    apt-get upgrade
    apt-get -f install


    Then go to plugins and install minidlna package. Then install openmediavault-minidlna plugin.

  • Thx for the suggestions.
    But before I try that, you said "Then go to plugins and install minidlna package. Then install openmediavault-minidlna plugin" BUT currently in my web-gui Plugin list, I do not see "minidlna package"...only openmediavault-minidlna 0.4.....


    In fact I have never seen TWO minidlna's ever listed in plugin list web-gui.


    I thought that the openmediavault-minidlna plugin actually installed the minidlna package.
    Seems strange that a user has to install two related packages separately and not as one homogeneous plugin ?

    HP Microserver N40L; OMV 6.1.1-1 (Shaitan)

  • ther other package is causing a conflict.. after apt-get clean you should be able to see it .if not go to point where to install minidlna and report back and i give a wget line for it then you can install the plugin. the minidlna package was not put in the plugin. we testing various version til we found one that worked really well. that is why it's like this.

  • I just went through those steps:



    I then refreshed teh web-gui page.
    In the plugin section, I still only see openmediavault-minidlna... so I installed it. I noticed the output to the screen mentioned that it fetched the minidlna package 1.0.25-2 and the plugin installed it...as I expected it should.
    But the server still does not detect the media files.
    And the memory usage shot up...using up all of the 8GB until I stopped the minidlna service.

    HP Microserver N40L; OMV 6.1.1-1 (Shaitan)

  • when you reinstall the minidlna it blanks your config so you need to set it up again. does not take long.



    i think he went to high on the inotify.. i'm looking..



    lower the value to 64000

  • Appreciate your help tekkbebe.
    I set the inotify value to 64000 (using sysctl fs.inotify.max_user_watches=64000.
    Stopped the minidlna service, rm'ed the files.db, restarted the minidlna service.


    No joy.


    There were no inotify warnings but again the memory usage shotup and the load was so high for around 4 minutes that I could not type anything on the terminal window. dmesg reports that minidlna process was killed due to out of memory:


    Code
    [44374.808706] Out of memory: kill process 14493 (minidlna) score 1394982 or a child
    [44374.871934] Killed process 14493 (minidlna)


    See the memory usage chart:


    As the minidlna service is being killed off, I guess that's the reason no media files are being served.
    All used to work before the upgrade.
    Something is clearly broken.


    What else (apart from re-install of OMV) can we try ?

    HP Microserver N40L; OMV 6.1.1-1 (Shaitan)

  • Do this first: service minidlna stop


    did you redo your /etc/minidlna.conf file???? show your minidlna.conf.


    agree with ryeco and that is why i want to see your config file. i don't think he has files properly configured to scan..

    • Offizieller Beitrag

    When minidlna is scanning for files, it uses all available memory. When it is done scanning, it releases it. I don't think this is a memory leak. Maybe not efficient.


    If you some very large files that minidlna doesn't like (bluray rips come to mind), it will get "stuck" and not serve files (if it hits a large incompatible file first) or release this memory.


    I also have never changed my max_user_watches and never had a problem other than the error message.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Zitat von "tekkbebe"

    Do this first: service minidlna stop


    did you redo your /etc/minidlna.conf file???? show your minidlna.conf.


    agree with ryeco and that is why i want to see your config file. i don't think he has files properly configured to scan..


    No I did not redo the /etc/minidlna.conf as it looked fine.
    Here it is:


    It is as configured by the plugin.


    @ryeco,
    Yes that media drive does have full bluray .MKV's and some .TS files (one folder per movie).
    I never had an issue regarding inotify before the upgrade to 0.4.
    The same drive never had any issues with minidlna before I upgraded to 0.4

    HP Microserver N40L; OMV 6.1.1-1 (Shaitan)

    • Offizieller Beitrag

    In my experience, the bluray .TS files take *forever* for minidlna to scan. I only view them over samba now because of this. Maybe this is worse with the newer version of minidlna that you got when you upgraded.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Yes I can confirm the bug in minidlna appears to be related to .TS files.
    To test this theory, I just created a tmp folder and put an .MKV file there.
    Then, edited /etc/minidlna.conf and pointed the media_dir to this tmp folder.
    Stopped the minidlna service, deleted the files.db file and restarted the service.
    Now the dlna clients can see and play the .MKV from minidlna.


    So is the problem the minidlna plugin or the server it is pulling in ?
    how to fix this ?

    HP Microserver N40L; OMV 6.1.1-1 (Shaitan)

    • Offizieller Beitrag

    It is something with minidlna itself and not the plugin because I had the problem long before the plugin existed. Personally, I think it has to do with the file format and the extremely large size. You could post something on the minidlna forum or file a bug report. The developer is usually helpful. link

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Thx ryeco.
    I just posted there asking if anyone else is seeing this.
    Not holding much hope.


    Anyway to turn on more debug on minidlna as the log file contains nothing useful ?


    I wonder if Twonky will work on OMV.

    HP Microserver N40L; OMV 6.1.1-1 (Shaitan)

    • Offizieller Beitrag

    Not sure if it will show you anymore but you can run minidlna from command line. I think the debug log level is compiled in.


    minidlna -d -f /etc/minidlna.conf

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Zitat von "ryecoaaron"

    Not sure if it will show you anymore but you can run minidlna from command line. I think the debug log level is compiled in.


    minidlna -d -f /etc/minidlna.conf


    Thx but all output goes to the terminal and not logged and what I saw does not seem to give a clue what's going wrong.


    Is there a way to get the previous version ?

    HP Microserver N40L; OMV 6.1.1-1 (Shaitan)

    • Offizieller Beitrag

    The output going to the terminal was what I intended. The amount logged is compiled in. You would have to recompile to change the debug logging level.


    Yep. Go to the minidlna sourceforge page and download a binary with static in the label. I'm using 1.0.24 myself (1.0.25 segfaults scanning my collection). Extract the files in a temporary location. Move the executable in tmp_dir/usr/sbin to /usr/sbin/. I would make a backup of the original and remember that this file will get replaced if there is a minidlna update in the repository.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Zitat von "ryecoaaron"


    Yep. Go to the minidlna sourceforge page and download a binary with static in the label. I'm using 1.0.24 myself


    That version fixed the problem !
    And...it only took 2 minutes to scan 3300 media files.


    Just need to figure out how to stop minidlna from being updated automatically.


    Also, in that version I noticed extra logging settings in the minidlna.conf file:

    Code
    # set this to change the verbosity of the information that is logged
    # each section can use a different level: off, fatal, error, warn, info, or debug
    #log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=warn


    Setting scanner=debug now shows each folder that is being scanned in the log.


    @tekkbebe
    Thanks for the link to twonky on debian...I will read up and check it out.

    HP Microserver N40L; OMV 6.1.1-1 (Shaitan)

  • Interesting.....
    I installed TwonkyServer 7.1.2 and got it up and running (eventually) - nice web interface.
    Woke up this morning and after nine hours, the HDD light on the server is full on !
    Checked the twonky status and it is STILL indexing my media.
    CPU load is at 50%.


    Googled the issue and found several twonky users have found the indexing problem unacceptable.
    The issue is that twonky developers have decided to be true to the DLNA spec and is scanning the .TS files iFrame-by-iFrame to calculate the total play time !!!! This is for time seek functions on the DLNA clients.
    It does do this in two steps: (a) quick scan to find the media file and add to the database; (b) then in background, a detailed scan for the time-seek function.


    I wonder if the new minidlna server is trying to do the same thing but screwing up as it has a bug.

    HP Microserver N40L; OMV 6.1.1-1 (Shaitan)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!