Running minidlna on Mac

These are my notes on installing [minidlna][minidlna], a [DLNA][dlna] server for Mac OS X. I compiled it from source and installed the supporting libraries from [MacPorts][macports].

Most of this was culled from [a thread on the minidlna forum][forum].

First install each of the following ports. The command for each would be something like `sudo port install libiconv`.

– libiconv
– sqlite3
– jpeg
– libexif
– libid3tag
– libogg
– libvorbis
– flac
– ffmpeg

Then check out the Mac branch of the current minidlna source from the CVS repository.

cvs -d:pserver:[email protected]:/cvsroot/minidlna checkout -r osx_port minidlna
cd minidlna

The current build script appears to miss out pulling in libiconv so I had to edit `configure.ac`, inserting a line to bring in `libiconv`.

AC_CHECK_LIB([iconv], [main],, AC_MSG_ERROR(Cannot find required library iconv.))

Now the build will work. Although I found I needed to run `autogen.sh` twice for it to generate all the necessary files.

source ENVIRONMENT.macports
sh genconfig.sh
sh autogen.sh
sh autogen.sh
./configure
make

This spits out the minidlna executable and a basic configuration file. Copy these to wherever you want them. Edit the `minidlna.conf` file, pointing it at the files you want to serve. There are examples of what to do in that configuration file.

And for testing purposes you can start the server from the build directory.

./minidlna -d -f minidlna.conf

Bingo.

I did try using [ushare][ushare], another DLNA server, but I couldn’t figure out how to persuade my Sony telly to successfully connect to it. So I gave up. I feel it is useful to give up quickly when something doesn’t work until you run out of alternatives, I consider this triage. I also consider my telly’s inability to work with ushare and the fact that the telly will only play a very limited set of video formats a mark against the promise of DLNA.

[minidlna]: http://sourceforge.net/projects/minidlna/
[dlna]: http://www.dlna.org/
[forum]: http://sourceforge.net/projects/minidlna/forums/forum/879956/topic/3412747
[macports]: http://www.macports.org/
[bravia]: http://www.sony.co.uk/hub/bravia-lcd-televisions
[ushare]: http://ushare.geexbox.org/

15 thoughts on “Running minidlna on Mac

  1. phuksi

    Excellent instructions. I have been struggling with my Sony TV and DLNA. Sony seems to be extremely picky what it supports. With the instructions above I was able to make it work. Thanks!

  2. PFloyd

    Great !!! Excellent instructions !! My $0ny TV finally “understood” my old Powerbook !!

  3. Evgueni Tzvetanov

    Great port, cannot connect to the Mac server….
    Compiled and installed, following your instructions. Unfortunately I am not able to see the DLNA sevrer on my Mac. It is running one instance. On my Ubuntu it is running 3 instances.

    Is this something that I did wrong or configured wrong? My Mac is Intel based June (lower half of the year release, not the newest ones) 2010 iMac.

    Thank you in advance, if you reply.

  4. Evgueni Tzvetanov

    Sorry… forgot to say I am trying to connect from all kinds of clients: WD TV Live player, Moovida (Elisa) on Ubuntu Linux, Geexbox, etc. to no avail.

  5. david Post author

    @Evgueni Tzvetanov
    Perhaps you haven’t configured it to listen on the correct interface / port. Double-check your minidlna.conf to confirm it is bound to the correct interface (my Mac uses WiFi so I had to change it to listen on network_interface=en1). Then start the server and confirm that it is listening, for example by using curl http://127.0.0.1:8200 to connect to the server on localhost.

    The server error log should show the response when a client connects. If that doesn’t work then I’m not sure where the problem lies.

  6. Evgueni Tzvetanov

    @david
    Thanks for your reply David, here is a scan on my mac:

    PORT STATE SERVICE
    22/tcp open ssh
    88/tcp open kerberos-sec
    139/tcp open netbios-ssn
    445/tcp open microsoft-ds
    548/tcp open afp
    631/tcp open ipp
    8200/tcp open trivnet1
    49152/tcp open unknown

    Also I have set it up with no specific interface, considering that I might use the service locally, so the server listens on all interface. My network is internal home network and there is no additional factors involved such as NAT or port forwarding or any of the network quirks of IPV4 networks.

    Here is the netstat picture as well:

    Active Internet connections (including servers)
    Proto Recv-Q Send-Q Local Address Foreign Address (state)
    tcp4 0 0 .8200 *. LISTEN

    Here is the part of the error:

    [2011/03/24 19:51:39] upnphttp.c:827: warn: /favicon.ico not found, responding ERROR 404
    [2011/03/24 19:51:39] upnphttp.c:1035: debug: HTTP RESPONSE: HTTP/1.1 404 Not Found
    Content-Type: text/html
    Connection: close
    Content-Length: 134
    Server: Darwin/10.6.0 DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.0

    404 Not FoundNot FoundThe requested URL was not found on this server.

    But I have seen this error about favicon.ico before and this is not it.
    Is there a folder/setting which I am missing. I can also send you my full .cfg file, but it is basically very simple — I just added the media folders and everything is default.

  7. tehsu

    Was anyone able to get MKV’s working? I’m coming from the Linux version and I never had any issues with MKVs till now.

  8. Andrew

    I run Debian Linux, I’ve installed, configured, and run successfully minidlna connecting to a Sony Bluray player… I’d bet that the Sony television is similar. I needed to configure the minidlna server at port 50002. It works perfectly with mkv, avi, and many other formats. I found the open port by using a program called nmap…

    http://nmap.org/download.html

    Just type in nmap 192.168.1.xxx

    Fill in your Sony’s IP address of course, and in a few minutes you’ll have the open ports on the Sony. Then you’ll have to open that port in your Mac’s firewall to enable two-way communication…

    The Sony player is very picky about the audio CODEC used in the file. I needed to re-encode some of my files using AC3 rather than MP3 audio. The MKV extension just indicates the container that encloses the audio/video. Think of MKV as a room, and AC3 and x.264 as the furniture in the room. You can move around the furniture or change the furniture altogether, but the room still has the same dimensions, door positions, etc. So it’s likely that the MKV files you’re trying to play have incompatible CODECs.

    To re-encode I run ffmpeg and a program called mkvmerge. It looks like there’s a Darwin port…

    http://mkv4mac.free.fr/index.php?lang=en&p=log

    Also, the presentation_url listed in the minidlna config file doesn’t really work… see this thread…

    http://sourceforge.net/projects/minidlna/forums/forum/879957/topic/3336283

  9. Kevin Macey

    I managed to add FSevent support to minidlna, not quite as fast as inotify but still a big improvement….
    However I don’t know how the ./configure system works, got it compiling by editing the makefile, but that is system dependent. If anyone out there want to setup the configure files, or wants a copy just leave me a message here and I will post a link after I’ve worked out the last few bugs in a few days…

  10. Aleksandr Rasskazov

    Help, plz. I run, but in log has error:
    15 [2013/12/04 00:37:50] minidlna.c:1100: warn: Starting MiniDLNA version 1.1.0-cvs.
    16 [2013/12/04 00:37:50] minidlna.c:368: warn: Creating new database at /var/cache/minidlna/files.db
    17 [2013/12/04 00:37:50] minissdp.c:105: error: bind(udp): Address already in use
    18 [2013/12/04 00:37:50] minissdp.c:803: error: connect(“/var/run/minissdpd.sock”): No such file or directory[2013/12/04 00:37:50] minidlna.c:1132: fatal: Failed to connect to MiniSSDPd. EXITING[2013/12/04 00:37:50] scanner.c:690: warn: Scanning /Users/azov/Movies

    what me do?

Leave a Reply

Your email address will not be published. Required fields are marked *