Jump to content

MB3 on FreeNAS plugin


prashy21

Recommended Posts

woodsb02

FYI, I have submitted a request to add mediabrowser to FreeBSD ports collection: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194634

 

Whilst I am working on it, is there a way to tell MediaBrowser to use a different directory for ProgramData-Server (e.g. if I run it as a user which does not have write access to the MediaBrowser install directory (in this case /usr/local/lib/mediabrowser)?

Link to comment
Share on other sites

woodsb02

FYI, I was able to build this port using only the source code now (not the zip file with binaries). I believe you recently made a change to include all external sources, removing the need for NuGet?

Link to comment
Share on other sites

woodsb02

Never mind about the question of ProgramData-Server location, I realised the console command is -programdata

Link to comment
Share on other sites

Luke, I will only say this, 10/10 running mb3 server on freebsd 10.1 rc3, outstanding indeed, this freebsd is part of the windows domain.

 

sharing the servers (win 2008 servers as for this test only now), as will local folders.

 

Test been done on client to play as win7.

 

No more windows to run the mb3 server indeed.

 

Next will do raidz3 on it :)

 

Well done buddy.

  • Like 1
Link to comment
Share on other sites

woodsb02

I have determined the reason for the DLNA server not working on FreeBSD.

MediaBrowser uses the function NetworkInterface.GetAllNetworkInterfaces:

https://github.com/MediaBrowser/MediaBrowser/search?utf8=%E2%9C%93&q=getallnetworkinterfaces&type=Code

 

Referring to the mono source, this command uses the file /sys/class/net/INTERFACE to get network interface data:

https://github.com/mono/mono/blob/master/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs

 

The sysfs interface is specific to Linux, and only available to FreeBSD via a compatibility layer (needing to be mounted at /compat/linux/sys instead of /sys):

http://en.wikipedia.org/wiki/Sysfs

https://www.freebsd.org/cgi/man.cgi?query=linsysfs

 

The correct way to fix this is to modify the mono source code to remove this reliance on /sys. This is similar to another change that I have requested to remove reliance on /proc:

https://github.com/mono/mono/pull/1310

 

I will see what I can do to submit another pull request to mono.

  • Like 1
Link to comment
Share on other sites

I don't mean this to come across as a troll, but i'd suggest FreeNAS users check out Open Media Vault. It's similar to FreeNas but runs on Debian and is written by one of the original FreeNAS devs. There's a vibrant support community, loads of plugins,  and there's a thread on getting MB3 to run on it over on their forums, I know because I did it and it runs perfectly. If MB3 had supported TVHeadend (which it now looks like it may be coming shortly) i'd still be running it, but switched to windows and Argus. 

http://www.openmediavault.org/

http://omv-extras.org/simple/

Link to comment
Share on other sites

woodsb02

Hi Griffo, I don't really think your comment is helpful in this context. This forum thread is about people trying to get MediaBrowser working on their FreeNAS - not about their selection of operating system. Furthermore, your post implies FreeNAS does not have an equally vibrant support community or a number of easy plugins. I am sure both systems have their pluses and minuses. You have chosen open media vault, I have chosen FreeNAS. Now, I still want to get MB3 running on FreeNAS, so let's keep this on topic please.

  • Like 1
Link to comment
Share on other sites

Hi Griffo, I don't really think your comment is helpful in this context. This forum thread is about people trying to get MediaBrowser working on their FreeNAS - not about their selection of operating system. Furthermore, your post implies FreeNAS does not have an equally vibrant support community or a number of easy plugins. I am sure both systems have their pluses and minuses. You have chosen open media vault, I have chosen FreeNAS. Now, I still want to get MB3 running on FreeNAS, so let's keep this on topic please.

 

Well done, thanks. Looking forward to it.

Link to comment
Share on other sites

woodsb02

On what operating systems has DLNA been tested and known to work on MediaBrowser?

I have seen some code that makes me think it won't be working on at least Mac OSX?

Link to comment
Share on other sites

woodsb02

For those trying to get MediaBrowser working on FreeBSD, you will need the patches from both of these bug reports in your mono (just put them in your /usr/ports/lang/mono/files folder before building the mono port):

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194660

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194845

Link to comment
Share on other sites

woodsb02

Good news - I have managed to get MediaBrowser DLNA working on FreeBSD! The main issue was FreeBSD mono was configured to use the mono Linux networking code, which has some specific Linuxisms. I have changed FreeBSD's mono to use the Mac networking code and it works just fine!

 

If I read my log file outputs, there are still a few error messages, but it successfully showed up on my Playstation3 and streamed a movie.

 

Luke: I do have some questions about things I found in the MediaBrowser code - note that these did not prevent MediaBrowser DLNA from working.

 

  1. Can you explain why MediaBrowser.Dlna/Ssdp/DeviceDiscovery.cs Start() includes a check for !network.GetIPProperties().MulticastAddresses.Any()? Whilst its not a bad idea, as far as I can tell the mono code has a bug and will fail this check (network.GetIPProperties().MulticastAddresses.Any() returns false). Suggest maybe it is worth removing this check for now?
    https://github.com/MediaBrowser/MediaBrowser/blob/master/MediaBrowser.Dlna/Ssdp/DeviceDiscovery.cs
    https://github.com/mono/mono/blob/master/mcs/class/System/System.Net.NetworkInformation/IPInterfaceProperties.cs

    It looks like this issue has been pointed out before, but never fixed:
    http://mono.1490590.n4.nabble.com/no-multicast-addresses-returned-from-IPInterfaceProperties-td1536032.html

    I have submitted this bug report:
    https://bugzilla.xamarin.com/show_bug.cgi?id=24293
     
  2. Why do you start the DLNA server on the loopback device? Sending datagrams to multicast addresses from loopback is failing on FreeBSD. Is it a better idea to only start DLNA on interfaces which !IsLoopback, and enable IP_MULTICAST_LOOP on those network interfaces?
    http://www.tldp.org/HOWTO/Multicast-HOWTO-6.html
Link to comment
Share on other sites

woodsb02

I don't necessarily know if either of these points is "the right thing to do". I wanted to discuss it first.

 

Also, I don't know how to change the code for item 2.

Link to comment
Share on other sites

josh4trunks

@@woodsb02

any reason you used custom start/stop/status commands in your port? this is less maintainable.

seems a lot like the plex port I was planning on cleaning up, did you use that as a base for yours? it's only needed in the plex port cause freebsd's rc.d built in functions couldn't handle spaces in the plex binary.

 

also do you know what ulimit does? I feel like it might not be needed/ doesn't do anything of value here.

 

i have other questions/comments to harass you with but I'm getting tired of typing on my smartphone for now, lol.

 

 

anyway, thanks for everyone's work! excited to get some free time this weekend.

Link to comment
Share on other sites

woodsb02

@@woodsb02

any reason you used custom start/stop/status commands in your port? this is less maintainable.

seems a lot like the plex port I was planning on cleaning up, did you use that as a base for yours? it's only needed in the plex port cause freebsd's rc.d built in functions couldn't handle spaces in the plex binary.

 

also do you know what ulimit does? I feel like it might not be needed/ doesn't do anything of value here.

 

i have other questions/comments to harass you with but I'm getting tired of typing on my smartphone for now, lol.

 

 

anyway, thanks for everyone's work! excited to get some free time this weekend.

Yes I used the plexmediaserver port as an example for the rc script in my port submission. Please do send through a better version of the rc script (including fixed start/stop and removed ulimit). I will update my PR.

 

More questions are welcome :)

 

Reminder: if you want to build a FreeNAS plugin, you will need the mono patches attached to my 2 mono PRs (one of which is still in discussion as to if there is a more elegant solution).

Link to comment
Share on other sites

josh4trunks

Yes I used the plexmediaserver port as an example for the rc script in my port submission. Please do send through a better version of the rc script (including fixed start/stop and removed ulimit). I will update my PR.

More questions are welcome :)

Reminder: if you want to build a FreeNAS plugin, you will need the mono patches attached to my 2 mono PRs (one of which is still in discussion as to if there is a more elegant solution).

sounds good, I'll see what I can do and post my resultant shar. if your bug does get committed we can always submit the changes as a minor version or with the next version.

 

any news when/if your patches will be added upstream to mono?

Link to comment
Share on other sites

josh4trunks

I can work on building a freenas plugin (pbi) this weekend. excited to start playing with this!

 

I have no experience with MB3 but was planning on deploying plex soon. glad I found an open source alternative. =]

  • Like 1
Link to comment
Share on other sites

josh4trunks

@@woodsb02

I know plex keeps its metadata in PREFIX/plexdata  (which on FreeBSD = /usr/local/plexdata) but I've learned this actually isn't where stuff should be stored. Metadata should be stored in /var/db/mediabrowser in this case. Just wanted to make sure you were aware of this change.

 

Keeping data under PREFIX actually causes some pretty annoying issues with plex's updating on FreeNAS as mentioned here. https://forums.freenas.org/index.php?threads/new-plugin-available-plex-media-server.14826/page-15#post-142247

Link to comment
Share on other sites

josh4trunks

more questions =P

 

 

* is the mp3 message necessary? if they are installing from ports they would have the choice to enable this. I guess it's a way to warn people who installed MB from a package so they can uninstall ffmpeg and compile it. I just don't see other multimedia ports giving this warning.

 

* I actually bundle ffmpeg, compiled with lame, with my subsonic/headphones freenas plugin. I know there is some licensing issues around doing this =\ should we do the same with the MB plugin? I know they wanted to add a license feature to freenas plugins but I don't think it ever happened. how do plex/xbmc/openelec get away with this?

 

* do you we need to have MBs files under lib/mediabrowser? Is share/mediabrowser OK or did you put them under lib for a reason?

 

Thanks, I'll try to get my changes in tonight.

Link to comment
Share on other sites

josh4trunks

also, I see what I can do as far as compiling the plugin (pbi). basically were in a weird zone where plugins can't be compiled cause, as far as I know, they rely on the old pkg tools. this broke like a month a ago so I need to stay on an old version of the ports tree, and manually update the ports I needs new versions of. hope this gets resolved soon and everything works with the new pkg tools.

Link to comment
Share on other sites

what is the exact step for

 

# enable the lame option

 

just need to know what to write on the download page. thanks.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...