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

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,972
First of all, thx Joe for awesome HowTo!
But I have some issues, that I couldn't fix myself:

1. minidlna crashes
Code:
upnpevents.c:423: fatal: upnpevents_selectfds: file descriptor 1045 too big for select, limit is 1024


I read here , that you found something about this issues. Can you write step-by-step what should I do? :)

2. I have few lines in my log file like this one:
Code:
inotify.c:108: error: inotify_add_watch[kqueue,open](/media/tv-shows) [Too many open files]


Thanks in advance for any help!
You broke the main rule, please post what version of FreeNAS you are running and your hardware specs.

But... If I had to guess I'd say you have too many files for MiniDLNA to handle.
 

Rinski

Cadet
Joined
Apr 4, 2017
Messages
2
You broke the main rule, please post what version of FreeNAS you are running and your hardware specs.

Yeah, my bad, forgot about it.
Code:
FreeNAS-9.10.2-U3 (e1497f269)

But... If I had to guess I'd say you have too many files for MiniDLNA to handle.
About 10 Tb of media with videos (few of them are BDMV folders with a lot of *.m2ts files) and music (a lot of mp3). As I understand I should change my minidlna for something else? :(
 
Last edited:

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,972
Plex also has a DLNA server so you do not need to do anything with the transcoding itself, the DLNA server will farm out your media. But I personnaly have never tried it for music.
 

HAXIS

Dabbler
Joined
Aug 15, 2014
Messages
13
I'm currently trying to reinstall MiniDLNA after upgrading to FreeNAS 11.0-U1 and finding the non-ZFS disk my jails - and all my music - was stored on, was no longer supported.

I've got as far as 20a in the (very helpful!) original instructions, but then everything breaks down. Can anyone enlighten me?

Code:
root@FreeBSD:/ # pkg install minidlna																							   
Updating FreeBSD repository catalogue...																							
pkg: Repository FreeBSD has a wrong packagesite, need to re-create database														 
pkg: http://pkg.FreeBSD.org/freebsd:11:x86:64/latest/meta.txz: Operation timed out												 
repository FreeBSD has no meta file, using default settings																		 
pkg: http://pkg.FreeBSD.org/freebsd:11:x86:64/latest/packagesite.txz: Operation timed out										   
Unable to update repository FreeBSD																								 
Error updating repositories!																										
root@FreeBSD:/ # pkg install minidlna																							   
Updating FreeBSD repository catalogue...																							
pkg: Repository FreeBSD load error: access repo file(/var/db/pkg/repo-FreeBSD.sqlite) failed: No such file or directory			 
pkg: http://pkg.FreeBSD.org/freebsd:11:x86:64/latest/meta.txz: Operation timed out												 
repository FreeBSD has no meta file, using default settings																		 
pkg: http://pkg.FreeBSD.org/freebsd:11:x86:64/latest/packagesite.txz: Operation timed out										   
Unable to update repository FreeBSD																								 
Error updating repositories!


What on earth do I do now?!
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,972
I just got back from vacation about an hour ago. Give me some time to fix the A/C, DirecTv, and find whatever else broke while I was gone for a single week and then I'll take a look at it. Thanks for providing the failing step.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,972

HAXIS

Dabbler
Joined
Aug 15, 2014
Messages
13
The above operation failed. This works fine for me and maybe there is some internet problem on your end or just when you tried it.

The manual way to check this is to go to the link in question http://pkg.FreeBSD.org/freebsd:11:x86:64/latest/ and see if you can open the file meta.txz. I had no issue doing so.

I hope this helps.
Thanks. I'm a novice and stumbling around a bit, but it seems that there is indeed a failure in connectivity from the jail. I've run this command, which is fine at my server root, but times out within the jail.

Code:
time curl -I http://pkg.freebsd.org/freebsd:11:x86:64/latest/meta.txz | grep HTTP


Tried setting the jail configuration to DHCP (it had an IP of 192.168.1.1), and then set it as per the instructions in the original post, but still no luck. I guess I've still got an incorrect setting there somewhere - how can I find out what?
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,972
Odd, Do you have DHCP for the jail or static IP? You need to ensure you have a valid DNS for the jail. Check your network settings for the jail.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,972
Dang, sorry, I somehow didn't see that you posted the DHCP. Give me a minute.

Update: So, looks like there must be a bug with the Jails in that I am unable to create a jail using a Static IP. I'm rebooting and wiping out the jail to start over. Open an SSH windows to the jail, or open it from the GUI, type netstat -nr to find out if your Gateway is set to 192.168.1.1 (assuming this is your router of course).

Update 2: Here is a bug you should look at. https://bugs.freenas.org/issues/24553
 
Last edited:

HAXIS

Dabbler
Joined
Aug 15, 2014
Messages
13
Ah, thanks.

To complicate matters, I've now discovered that after setting the jail to DHCP, it won't unset back to a static IP. It appears to save, but I open up the edit dialog again and it's right back to DHCP. I suppose I'll have to delete this jail and start afresh.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,972
I am having issues with the Jail DHCP and will be testing this out on a different machine. If I have the same problem then I will update to the Nightlies and check it again. If the problem persists then I will create a bug report if one presently does not exist. But I think your problem is still the gateway in the jail.
 

Biolog

Cadet
Joined
Jul 28, 2017
Messages
3
Hi Joe, old man. First off all thank you for marvelous description of installation. ;) Worked like a charm.... almost. I have one tiny thing which bothers me.
[2017/07/28 07:55:07] fatal: upnpevents_selectfds: file descriptor 5770 too big for select, limit is 1024

After 2 hours the minidlna service goes off and this error is only thing which remains in minidlna.log
[2017/07/27 20:46:40] upnpevents.c:423: fatal: upnpevents_selectfds: file descriptor 5770 too big for select, limit is 1024
[2017/07/27 21:33:57] upnpevents.c:423: fatal: upnpevents_selectfds: file descriptor 5772 too big for select, limit is 1024
[2017/07/28 07:55:07] fatal: upnpevents_selectfds: file descriptor 5770 too big for select, limit is 1024

After completed your guide, I tried these two guides to fix it. But it didnt helped.
- https://svnweb.freebsd.org/ports?view=revision&revision=337482
- https://lists.freebsd.org/pipermail/freebsd-ports/2014-June/093522.html

Please, do you have any idea how to fix this?

Build FreeNAS-11.0-U2 (e417d8aa5)
Platform Intel(R) Celeron(R) CPU G3920 @ 2.90GHz
Memory 16047MB
 

Attachments

  • minidlna.txt
    242.7 KB · Views: 558
  • freenas - storage.jpg
    freenas - storage.jpg
    140.9 KB · Views: 352

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,972
@Biolog
If memory serves me correct you are running into a limitiation with MiniDLNA. There is no way around it that I am aware of except maybe to recompile MiniDLNA with the fixes you mentioned above. I can't compile thsi myself, well not anytime in the near future so maybe you can try it and see if you can get it going.

Wish I could be of more help. Well the other thing would be to run Plex and setup the DLNA service on it.
 

Biolog

Cadet
Joined
Jul 28, 2017
Messages
3
I you cant help, nobody can :(

PIty I do not know how to compile it. I switched to Linux 1 year ago, and these things are way too profesional. Pity then, but at least I know I tried. By the way what is the limit?

What is strange to me, that first 1 or 2 hours it works well.
 
Last edited:

IceBoosteR

Guru
Joined
Sep 27, 2016
Messages
503
Hi,

after googeling a little bit around with the explenation waht a file descriptor is https://en.wikipedia.org/wiki/File_descriptor I would say that MiniDLNA is trying to read a file which it cannot access, as maybe the path or the filename is too long and raises the application error then.
Or its just really an internal thing as joeschmuck wrote - in that case we cannot assist you and the developer has to do some tuning...

On the otherhand we may look at the complete picture. Why do you have so many HTTP errors?

Just a thought from my side.

Cheers
IceBoosteR
 

Biolog

Cadet
Joined
Jul 28, 2017
Messages
3
Ok, i found few very long and complicated paths and discarded those. Will see what will happen.

I tried to dig a bit that HTTP error, but all I found within the net was that it is common mistake and I cant do much about it. To be honest I do not know what to do. Here is my global settings.
 

Attachments

  • global.jpg
    global.jpg
    30 KB · Views: 343

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,972
The http warnings are common and can be ignored, they have nothing to do with FreeNAS/MiniDLNA configuration. In a perfect world they would not occur. You can change the configuration of MiniDLNA to stop recording the warning messages and only record the fatal ones but my personal preference is to have the messages, I can weed through the non-important data. If I still had my setup for compiling MiniDLNA, I would do that but all that stuff is gone. The best advice I could give, assuming you still want MiniDLNA to be you DLNA server is to contact the person developing minidlna and ask then to update the file descriptor value. He/she may say No if there are side effects we are not aware of. And again, you can install Plex and just use the DLNA server that is built in, you do not need to use the transcoding or other Plex services. It does work very well.

EDIT: You can "make" this in a jail. You will need to patch the file "extra-patch-kqueue" located at "/usr/ports/net/minidlna/files". This will require you to figure out how to create a patch and then adjust this file. While I was reading this file (line 680 area) there si some crazy code about the file descriptor so I 'm not sure if this takes all into account or if you really do need to add the value 8192 into the mix. Again, an email to the owner of MiniDLNA might be the best place to start. I would try to create this file but since I can't produce your error, I'd never know if I got it right, also I don't use MiniDLNA anymore. So good luck if you pursue this further.
 
Last edited:

Ziggy

Contributor
Joined
Oct 7, 2015
Messages
157
Install worked fine for me on 'FreeNAS-11-MASTER-201707250436 (9587154)' [11 nightlies]. Thanks muchly joeschmuck.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,972
Install worked fine for me on 'FreeNAS-11-MASTER-201707250436 (9587154)' [11 nightlies]. Thanks muchly joeschmuck.
Anytime.
 

Ziggy

Contributor
Joined
Oct 7, 2015
Messages
157
Sheesh, spoke too soon. When I went back to use the server a second time, I cant see the server or the data. Webgui says the jail is running, but when I look at the storage there's nothing attached in the dialog box. I fill it in - still not accessible - and I check the dialog box and it's as if I have to complete it again but it somehow doesn't get saved:
upload_2017-8-4_16-53-0.png


I suspect the fact that my DLNA device does not see the server suggests there's something else afoot. Before I do a re-install, any ideas? TIA
 
Top