How to Install MiniDLNA on FreeNAS 9.3 (Prior to Plugin)

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I used or typed miniDLNA because that how it was typed at the beginning of this tutorial. I tried to keep it as how it is written so as not to cause errors, but this time it did.
That has never been true or I would have been blasted the day I posted it. You need to follow the instructions to the letter. I put in extra time to make the instructions as accurate as possible.

I have updated the instructions to cover the new installation command, now as step 20a and added step 21a as well. I would have updated it sooner but I never got an email stating there were postings on this thread, yet another screw up of this forum software.

As for Plex, I like it a lot and use it now vice MiniDLNA, however some people like MiniDLNA due to it's low overhead/resource requirements so in my opinion there is a need for it so I will support it as much as possible.
 
Last edited:

hervon

Patron
Joined
Apr 23, 2012
Messages
353
Joeschmuck, I have been using miniDLNA according to your step by step tutorial since you wrote it in dec. I did not change anything. Works perfectly! Thanks for updating the tutorial for newer install. Greatly appreciated. As you stated, I prefer miniDLNA since it works perfectly for my setup and it is much leaner than plex.
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
@joescmuck, actually it was typed like this: Enter the Jail Name MiniDLNA, and not as miniDLNA as I said.

As I said, I tried it for a week with music, but for some unknown reason, the connection was continually being dropped. I have a reasonable coverage of wifi in my house, with a main wifi/lan Hub and an old netgear router plugged into a powerline adaptor in another room, and get 5bars regardless of where I am using wifi.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
As I said, I tried it for a week with music, but for some unknown reason, the connection was continually being dropped. I have a reasonable coverage of wifi in my house, with a main wifi/lan Hub and an old netgear router plugged into a powerline adaptor in another room, and get 5bars regardless of where I am using wifi.
MiniDLNA is pretty reliable but I can't say I've used it to stream music to a tablet. It sounds like Plex is more forgiving, but did you use Plex as a DLNA server or did yo use Plex software on your wireless android device?

And of course, MiniDLNA doesn't fit the bill for everyone and configuration can be problematic in FreeBSD systems so I'm glad Plex works in your situation.
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
MiniDLNA is pretty reliable but I can't say I've used it to stream music to a tablet. It sounds like Plex is more forgiving, but did you use Plex as a DLNA server or did yo use Plex software on your wireless android device?

And of course, MiniDLNA doesn't fit the bill for everyone and configuration can be problematic in FreeBSD systems so I'm glad Plex works in your situation.

I installed the Plex Media Server plugin on my FreeNAS 9.3 box, and then installed the plex app on my tablet. I now use it to stream music and other media, and I must say there has never been any problem with connection, so I'm happy with it!
I have no doubt that MiniDLNA would work flawlessly in some cases, and I have even thought about giving it another go, but not use it for music. I thought I had given it a fair trial over a week before I changed to Plex.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I'm sure the reason Plex doesn't drop for you is due to how it operates. I'm sure your wireless network or your device has some issue causing the DLNA stream to drop and I suspect that if you used something other than the Plex app (whatever you used before to support the DLNA streaming) that you would find it drops as well even using the Plex DLNA server but that is pure speculation on my part. You found a good solution and hey, I like Plex as well, just wish it was completely free, but a few bucks isn't going to break anyone unless they have a lot of devices to stream media to.
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
You found a good solution and hey, I like Plex as well, just wish it was completely free, but a few bucks isn't going to break anyone unless they have a lot of devices to stream media to.

No it wasn't completely free unfortunately, as I had to pay £3 GBP for the app, after I had tested it of course on limited use. To me for what it does, I am well pleased, as I found that it will even stream media to my android device 5 miles away from home. It may even do the same further away, but haven't been there yet, lol
 

John Dvoracek

Dabbler
Joined
May 23, 2015
Messages
10
This is only 50% drifting from the install topic, but this thread was hugely helpful in also installing plexmediaserver in a jail rather than use the plugin. Had I not had the experience of following these directions installing MiniDLNA, I probably would have just used the plexmediaserver plugin. However the consensus on their forums is your own install is much easier to update than the plugin. After doing MiniDLNA via this thread, I chose the same route (and found a similar post), and all went well. Not sure which I will settle on, but leaning towards plex. THANK YOU!
 

Majortom84

Dabbler
Joined
Jun 15, 2015
Messages
10
when I type in cd /usr/local/etc/ it tells me I do not have such a directory. Did I miss something?
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
when I type in cd /usr/local/etc/ it tells me I do not have such a directory. Did I miss something?
Just to make this difficult because I was clear with my tutorial, what was the last step number that worked perfectly and the step that failed? If this is in reference to step 22, describe by what method you are getting into the jail.

EDIT: If this is in reference to step 22, if you have exited the jail, start over at step 16 though 19 then skip to step 22. You do not need to reinstall the application unless it failed.
 

Majortom84

Dabbler
Joined
Jun 15, 2015
Messages
10
So, I found out what I did wrong.... I left the shell after 21a and then restarted it to continue on 22. Thank you so much for the quick reply!!!!!!!!!!!!!!!!!!! :) Your post really helped me figure out my error.
 

Majortom84

Dabbler
Joined
Jun 15, 2015
Messages
10
After getting this to work last night, I was able to see the minidlna on my network with my ps4 but now, after following the rest of the instructions from 33 on Its not showing up. I have also noticed that my jail for this via the GUI has no source or destination paths set. When I try to set freenas tells me it was successful but, its still blank. I'm not sure what I did wrong.

Should I try to reinstall again?


EDIT:

So I redid step 33 and typed "service minidlna onestart" into the shell while in the MiniDLNA directory and its working again. Will I have to do this all the time?
 
Last edited:

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I'm not sure why the GUI shares are not showing up, these should not have any bearing on the installation once the jail has been created.

When you reboot your FreeNAS machine, you are stating that the MiniDLNA program does not run. I just want to ensure that is what you meant.

As for step 33, I suspect the rc.conf file in step 34 was not updated properly. So get back into the jail and use "ee" to edit the file and see if the line from step 34 properly exists. If you redo step 34 you will only add another entry into the file and not fix the problem.

specifically do this... step 16, 19, Type "ee /etc/rc.conf" and verify step 34 entry was correct, fix it if it's wrong. Press Escape twice and enter to save the file. If you didn't find an error please submit a posting. Try to describe the issue.
 

Majortom84

Dabbler
Joined
Jun 15, 2015
Messages
10
Update:

Thank you for all the help joeschmuck for all the help!!! :) the minidlna server is now working as it should.
 

kingcharles

Dabbler
Joined
Dec 2, 2012
Messages
17
Hi, I have recently installed MiniDLNA according to the first post and it works fine. Thanks for writing it!
However it seems that after some hours (I did not discover how long exactly) the service dies.
This happens every time I start the service.

My FreeNAS build version:
Build FreeNAS-9.3-STABLE-201506292332

I tried starting the service in debug mode via the GUI console feature but the output stops after a second. The same happens when I start the service in debug mode from a console on my Linux box using SSH to get to the jail.

Code:
root@miniDLNA:/ # minidlnad -d
[2015/08/23 17:52:49] minidlna.c:1029: warn: Starting MiniDLNA version 1.1.4.
[2015/08/23 17:52:49] minidlna.c:1077: warn: HTTP listening on port 8200
[2015/08/23 17:52:49] getifaddr.c:338: info: Enabling interface 192.168.1.10/255.255.255.0
[2015/08/23 17:52:49] minissdp.c:743: maxdebug: Sending ssdp:byebye [7]
[2015/08/23 17:52:49] inotify.c:844: debug: GOING WILD!
[2015/08/23 17:52:49] minissdp.c:743: maxdebug: Sending ssdp:byebye [7]
[2015/08/23 17:52:49] minissdp.c:300: maxdebug: Sending ssdp:alive [7]


After CTRL-C I get a final message:
Code:
inotify.c:857: warn: kevent polling failure: Interrupted system call


Could these inotify messages be a clue?

In the minidlna.log I found this:
Code:
[2015/08/19 21:54:45] inotify.c:857: warn: kevent polling failure: Interrupted system call
[2015/08/19 21:54:50] minidlna.c:1266: error: accept(http): Too many open files

The last line repeated forever and the logfile is 2.6G!

I use MiniDLNA for music only but I have about 23000 songs. Could that be an issue? I noticed the below remark on ArchWiki:
Code:
If default number of inotify watches is non-sufficient to have MiniDLNA monitor all your media folders, increase inotify watches through sysctl 

It could be related to the " Too many open files" error messages?

The following are the sysctl output on my MiniDLNA jail:
Code:
root@miniDLNA:/boot/defaults # sysctl kern.maxusers
kern.maxusers: 1333
root@miniDLNA:/boot/defaults # sysctl kern.maxfiles
kern.maxfiles: 510585


For now I changed minidlna.conf
Code:
inotify=no

And will see if it makes a difference...

Any suggestions for further troubleshooting?
Thanks
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I have recently installed MiniDLNA according to the first post and it works fine. Thanks for writing it!
However it seems that after some hours (I did not discover how long exactly) the service dies.
This happens every time I start the service.
Please post your system configuration information, hardware, etc... Also, have you tried to re-install minidlna?

I wouldn't rule out all the music files as the item causing minidlna to fail, anything is possible.
 

kingcharles

Dabbler
Joined
Dec 2, 2012
Messages
17
I did not try re-installing MiniDLNA yet. When it runs, it runs fine so I was focussing on troubleshooting for now. Maybe I will give re-installing a go when I give up on the troubleshooting.

I run a small system:
Platform AMD C-60 APU with Radeon(tm) HD Graphics
Memory 15955MB
Intel NIC
3TB of ZFS storage only

I did a fresh install of the latest FreeNAS build recently and went to two new 16G memory sticks. All went smoothly. I came off the 9.2 build where MiniDLNA was running perfect (with the same number of music files). Using the plugin feature on 9.2 rather than building the jail manually.
Importing the volumes in 9.3 went perfect. I destroyed al the old jail volumes before the import to make sure there were no conflicts.
The FreeNAS box runs Transmission, NFS to share to all my Linux clients, Emby for serving Video and Photo and MiniDLNA for the music. Emby doesn't work in combination with my TEAC network player that's why I use MiniDLNA.

Edit:
Since the restart of MiniDLNA after I changed to inotify=no, the log is no longer flooding with the "Too many open files" message.
If minidlnad is still running tomorrow I may have fixed it.
 
Last edited:

solarisguy

Guru
Joined
Apr 4, 2014
Messages
1,125
Any chances that miniDLNA would be delivered out of the box in 9.3.1 ? Or at any other time but soon ? :smile:
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Any chances that miniDLNA would be delivered out of the box in 9.3.1 ? Or at any other time but soon ? :)
I wouldn't hold my breath. I would expect that with FreeNAS 10 you will be able to create a true Linux jail and run MiniDLNA much better. Well that is what I'm hoping for.
 

frankvh

Dabbler
Joined
Sep 7, 2015
Messages
10
This past weekend I carefully followed joeschmuck's instructions from the first post & successfully installed minidlna. Thanks very much joe. However, I also found, like others have reported, that after a few hours it crashed. So I edited its conf file to "inotify=no", restarted, and it's been stable since. It's great that it's working, but it's a shame it cannot use inotify. Maybe one day...

Frank.
frankvh.com
 
Top