OS X version

C. Fufezan
1 2 > >> (Page 1 of 2)
  • C. Fufezan

    C. Fufezan - 2009-09-28

    would it be possible to have miniDLNA compiled for OS X (Intel) ?

  • Justin Maggard

    Justin Maggard - 2009-09-30

    It probably won't work in its current form, but I would image the porting effort wouldn't be very difficult, as long as you could get the required libraries running on OSX.  But I don't have an OSX machine with which to work on it.

  • Dominik Epple

    Dominik Epple - 2009-12-17

    Since I also use a Mac OS X machine as home media server, I started porting efforts to OS X some days ago. minidlna seems to be the DLNA server of choice for the reasons of being open source, running as a daemon without GUI, and reported functionality.

    There are some "linuxisms" in the code which have made the porting effort somewhat large. I had to rewrite some code with ioctls and sysctls, and some code parsing files in /proc.

    Now I have a running minidlna on OS X, but its not workee yet:

    - I only see two of my videos on the TV, while there are many more in my directory… probably some code in the scanner is broken
    - Playing (one of the two visible) videos on the TV gives "unsupported format", while I know from other posts that the format should be supported
    - inotify code is not ported yet, inotify stuff not workee
    - debug output tells something about data modified after being free, so some additional bug here

    I will try to look into this in the next few days.

    I will also try to find out whether my code works also under Linux and/or FreeBSD. (I tried to use portable system calls, but have not tested it yet.) This would enable people to work on this code who don't have OS X available. (Unfortunately the OpenDarwin project obviously has died some years ago… this would have been the perfect testing platform I guess.)

    But for a truly portable project, one needs to use something like autoconf or similar…

  • Justin Maggard

    Justin Maggard - 2009-12-17

    Sounds good so far.  I'd be interested in the diffs when you're ready.

  • Dominik Epple

    Dominik Epple - 2009-12-19

    Update: I have a working minidlna for OS X available. There are still some issues, though.

    * scanner dies with 'incorrect checksum for freed object - object was probably modified after being freed.' This is the reason for this "I see only two videos" issue: scanner is dying just before it is able to add a third video. If I do not use USE_FORK=1 in upnpglobalvars.h, scanner is not in his own process and the failed assertion there makes entire minidlna server abort. Thus, this bug is pretty much confined, but I nevertheless failed to track it down yet. And as final observation: This error only occurs with nested directories. If I put some videos in one single flat directory, it is scanned correctly by the scanner and also visible on the TV.
    * OS X is lacking a sendfile library call which is comparable to the one from Linux. (It actually has a sendfile call, but it behaves differently. Already the manpage from Linux' sendfile says: "Other Unix systems implement sendfile() with different semantics and prototypes. It should not be used in portable programs." I therefore replaced the call to sendfile by some construction with read(2) and write(2) in upnphttp.c. Now streaming works, but forward/rewind does not work properly. I guess my construction  still does not behave properly.
    * And finally the inotify stuff is still missing.

    But the good news is that it is working now in principle!

  • Stefano Di Pinto

    Hello everybody. I have been trying to port minidlna to the Mac OS X for a while and I have a version, where I had to change some code but tried to keep the original code (I inserted the OS X code between #ifdef __APPLE__ delimiters). I noticed the same problems regarding the sendfile (but went on using the original - little modified - call) but I got problems with the database loading code (same as detue): it is not able to recursively scan directories, sooner or later it bombs with an 'out of boundaries' error on a malloc. I could not get rid of it yet - it looks like the process gets too little memory and goes out of stack, but I don't know how to make OS X allocate more stack (I mainly program in Java, have been using C only for fun). I could share my minidlna_mac code (with the codeproject file and the external libraries compiled with MacPorts) in order to try to merge it with other efforts. Just let me know if  you are interested (mainly detue, of course). Best regards.

  • Dominik Epple

    Dominik Epple - 2009-12-22

    Well. I now have code which works for Linux, Mac OS X and FreeBSD.

    In the last few days I created GNU autotool scripts for the project so it now has has configure script which can configure and build it on Linux, Mac OS X and FreeBSD, and adjust the code to be as portable as possible, and to use #ifdefs where I have not been able to find portable code.

    The bug in my sendfile replacement code has been found so that my new portable code works properly including forward and rewind (tested with a TV as client, a Samsung B650).

    The issue with the scanner still persists (scanning only works without problem if a single flat dir is used) and the inotify stuff compiles, surprisingly, but I have not tested it, though.

    Thus, the software can stream videos with forward and rewind and as such it now should somewhere be made available to the public, I think.  The question is whether you, jmaggard, want to have my code "as is" including the bugs and issues mentioned above, or whether we want to prefer to have it as a separate project (minidlna-portable for example) as long as the portable version has serious bugs compared to the linux version.

    stedip: what is the status of your port? You said you have the same problems as I do, but in principle, is it working? Of course we should bundle our efforts and "cherrypick" the bugfixes from both our codes.

  • Stefano Di Pinto

    Hi detue (and everybody). The status of my port is as follows: the basic loop (the upnp/dlna stuff) is working, though with the sendfile issue; it works beautifully with photos, issuing the preview etc., does not work with music (but, if you stop the debugger just after the sendfile, wait for a second and go on it surprisingly works - well, I guess that it gives time for a retry to the Samsung TV, a 40A756); the video is not working at all (always gives the "unsupported format" error). I just tried once to connect to the PS3 and never to the XBOX (my children are busy at the consoles!) with poor results. Nevertheless the main issue is that my instance is not able to create the sqlite db - it bombs, looks like the recursion or any other problem prevents it to complete, so the dlna loop is working only from the second try on when I try to create the db. I read that the os x leopard does not need to explicitly manage memory, so apparently there is no fix (I guess that the external libs that I import could not be perfect, they have been created with the aid of MacPorts). Then I am using the standard development environment supplied by Apple (CodeProject etc.) because I am not able to deal with the makefile stuff and the like.
    I partially ported the inotify stuff, too. I just miss the main routine, which is quite useless if the db creation code is not working…
    My final goal would be to make a System Preferences panel out of minidlna (adding the extra Apple code and embedding the minidlna executable as is). I suggest that we exchange code at this point and try to merge, or just optimize the better working one (which of course I guess is yours: but maybe some snippet of mine could be just useful). I wonder how you solved the problem of the external libs. Ah, by the way, I have an Intel MB Pro with Leopard 10.5.8.

  • Dominik Epple

    Dominik Epple - 2009-12-22

    Hi stedip, hello interested readers,

    I just tried music and photos. I have not been interested in these and have never tested them, but to my great pleasure it works. Watching photos and playing music works fine. (With music, there seems to be no way to spool forward or backwards. The client seems not to be able to do this, the left and right buttons on the remote control switch to the next or previous title, and spooling is not available.)

    And I never tried a different client but the Samsung B650. (No XBox, no PS3 available, hm, perhaps I can borrow one from a colleague after the holidays.)

    About the sqlite stuff: have you tried to use only a single flat directory for your files? It works for me like this. It only bombs if subdirectories are present. (Which is of course a major bug, but it is nevertheless already of some use value.)

    What do you mean with "os x leopard does not need to explicitly manage memory"? Never heard about that.

    My libs are also from macports.

    And I am using Makefiles and GNU autotools since I am not able to deal properly with XCode ;-) But it sounds very promising that you plan to make a System Preferences Panel, I did not think beyond the Idea of a running daemon that is started from the command line. But a System Preferences Panel sounds very cool.

    I am using Snow Leopard here. This is good, then we have already two testing platforms available, 10.5 and 10.6.

    About code sharing. I do not want to "publish" something as long as jmaggard did not tell his position about this. I do not want to "fork" his project without his agreement. (Besides that, it still may be a good idea depending on the goals to manage the "portable version" as a separate project as long as it is inferior to the original linux code from jmaggard.)

  • Justin Maggard

    Justin Maggard - 2009-12-23

    Can you post a diff of what you have so far?  Please use "cvs -q diff -uN" to generate the diff.  I think you should be able to post it in the "Patches" tracker.  I may be able to get ahold of an OSX laptop to use for a couple days.

  • Justin Maggard

    Justin Maggard - 2009-12-23

    My preference is to have the upstream code work with OSX, so we don't need to maintain a project fork.

  • Dominik Epple

    Dominik Epple - 2009-12-23


    are you interested in the GNU autoconf-based configuration and build system I created for minidlna? (GNU autotools is what creates those well-known configure scripts from so many open source packages.)

    If so, submitting a simple patch is not possible since I would need to "cvs add" some files which I lack the permissions to. I could submit a patch for the already existing files and submit the other files as a tar.gz file, for example.

    If you would like to stick to the present genconfig.sh and handcrafted Makefile, I need to extend those first to the new requirements before I can submit a patch. (But please consider using the autoconf tools, it is much more powerful, flexible and extensible.)

  • Dominik Epple

    Dominik Epple - 2010-01-09

    Well, I have been lazy over the holidays. Nevertheless I just posted a patch for minidlna which makes it compile (and work!) on FreeBSD and OS X.

    See 2928850 and 2928851 in the Patches Tracker.

    I hope this patch will find inclusion into the upstream sources in order to make minidlna available for OS X and FreeBSD users.


  • Stefano Di Pinto

    Hello everybody. I have been testing the main patch by detue and want to thank him for the great job that he has done. It works beautifully (under Snow Leopard - ie-x64) together with my Samsung 40LE756. Everything is ok, quick and responsive (photos, music and films), so: great job.
    I have tried testing it under Leopard on both PPC and ie386 platforms and… photos ok, nothing else working. I've tried testing this way because 'the rest of us' is probably still in that situation, and at the moment there is only one app doing this stuff (quite) well under Leopard - intel (by the way, its name is Serviio and is written in Java, so it's quite heavy and slow) and none for the PPC.
    The problem of building the database has been solved under ALL the Mac platforms/O.S. releases (again, thanks to detue).
    I have tested the minidlna against a PS3 with similar results, so the problem could be located within the system network management of the Leopard OS.
    The investigation goes on.

  • Anonymous

    Anonymous - 2010-07-21

    Hi, I'm trying to compile MiniDLNA in my G5 running Leopard. Not really a developer so this is kind of a project for me. When searching for dependencies through MacPorts several of them doesn't appear, or they appear with a different name. When "make" is invoked it asks again for the same dependencies, what should I do about it?

    These are the dependecies required (Install file) vs MacPorts availables.
    libjpeg =  jpeg 8b
    libFLAC = flac
    libavformat = ffmpeg
    libuuid  = ossp-uuid

  • Nightshade

    Nightshade - 2010-07-29

    In order to use macports installed items you need to inform the compiler and linker of certain things:
    export CFLAGS='-I/opt/local/include'
    export LDFLAGS='L/opt/local/lib'
    The same goes for fink users:
    export CFLAGS='-I/sw/include'
    export LDFLAGS='-L/sw/lib'
    Then run configure and it should pick up the dependencies. (If you have installed them of course)

  • Anonymous

    Anonymous - 2010-08-02

    Thanks, carbnsack, I'm trying to do so, but I've still got the same error. Even thought I've got he dependencies installed. And tried to export flags as you suggested. (I also tried adding and changing the CFLAGS paths in the make file)

    Here is the error I got and my macport installed dependencies. Maybe this have to do with some OSX 10.5 specific variable? Like .profile not being in the home directory but in /etc  ? Once more, I'm just an amateur in this stuff. Maybe is something really basic.

    ERROR!  Cannot continue.
    -e The following required libraries are either missing, or are missing development headers:

    -e libavcodec libavformat libavutil libflac libvorbis libogg libid3tag libexif libjpeg


    The following ports are currently installed:
      autoconf @2.65_2 (active)
      automake @1.11.1_0 (active)
      bzip2 @1.0.5_3 (active)
      cppunit @1.12.1_0 (active)
      dirac @1.0.2_0 (active)
      expat @2.0.1_0 (active)
      faac @1.28_2 (active)
      faad2 @2.7_0 (active)
      ffmpeg @0.5.1_2
      ffmpeg-devel @22866_0 (active)
      flac @1.2.1_0 (active)
      gettext @ (active)
      gmake @3.81_0 (active)
      gperf @3.0.4_0 (active)
      help2man @1.38.2_0 (active)
      jpeg @8b_0 (active)
      lame @3.98.4_0 (active)
      libexif @0.6.19_0 (active)
      libiconv @1.13.1_0 (active)
      libid3tag @0.15.1b_1 (active)
      libogg @1.2.0_0 (active)
      libsdl @1.2.14_8 (active)
      libtheora @1.1.1_0 (active)
      libtool @2.2.10_0 (active)
      libvorbis @1.3.1_0 (active)
      m4 @1.4.14_0 (active)
      ncurses @5.7_0 (active)
      ncursesw @5.7_0 (active)
      orc @0.4.5_1 (active)
      ossp-uuid @1.6.2_0 (active)
      p5-locale-gettext @1.05_2 (active)
      perl5 @5.8.9_0 (active)
      perl5.8 @5.8.9_3 (active)
      pkgconfig @0.25_0 (active)
      readline @6.1.000_1 (active)
      schroedinger @1.0.9_0 (active)
      sqlite3 @ (active)
      x264 @20100412_0 (active)
      xorg-bigreqsproto @1.1.0_0 (active)
      xorg-inputproto @2.0_0 (active)
      xorg-kbproto @1.0.4_0 (active)
      xorg-libX11 @1.3.4_0 (active)
      xorg-libXau @1.0.6_0 (active)
      xorg-libXdmcp @1.0.3_0 (active)
      xorg-libXext @1.1.2_0 (active)
      xorg-libXrandr @1.3.0_1 (active)
      xorg-randrproto @1.3.1_0 (active)
      xorg-renderproto @0.11_0 (active)
      xorg-util-macros @1.10.0_0 (active)
      xorg-xcmiscproto @1.2.0_0 (active)
      xorg-xextproto @7.1.1_0 (active)
      xorg-xf86bigfontproto @1.2.0_0 (active)
      xorg-xproto @7.0.17_0 (active)
      xorg-xtrans @1.2.5_0 (active)
      xrender @0.9.6_0 (active)
      XviD @1.2.2_0 (active)
      zlib @1.2.5_0 (active)

  • Justin Maggard

    Justin Maggard - 2010-08-05

    Looks like you didn't check out the osx_port branch from CVS.  You shouldn't have genconfig.sh; instead, you should have configure.

  • Anonymous

    Anonymous - 2010-08-10

    jmaggard, you were right, but now with the osX_port branch I can't find the makefile for it. Here is what it returns:

    make: *** No targets specified and no makefile found.  Stop.

  • Justin Maggard

    Justin Maggard - 2010-08-10

    Ah, right.  You'll need to run autogen.sh first, which should generate configure.

  • Anonymous

    Anonymous - 2010-08-13

    mmm having a trouble here, already install the latest autoconf, m4 and automake from macports, but can't put autogen to run, this is the output:

    K-G5:minidlna kike$ sudo sh /Applications/minidlna/autogen.sh
    configure.ac:4: error: Autoconf version 2.62 or higher is required
    configure.ac:4: the top level
    autom4te: /usr/bin/gm4 failed with exit status: 63
    aclocal: autom4te failed with exit status: 63
    configure.ac:4: error: Autoconf version 2.62 or higher is required
    configure.ac:4: the top level
    autom4te: /usr/bin/gm4 failed with exit status: 63
    automake: autoconf failed with exit status: 63
    configure.ac:4: error: Autoconf version 2.62 or higher is required
    configure.ac:4: the top level
    autom4te: /usr/bin/gm4 failed with exit status: 63
    autoheader: '/usr/bin/autom4te' failed with exit status: 63
    configure.ac:4: error: Autoconf version 2.62 or higher is required
    configure.ac:4: the top level
    autom4te: /usr/bin/gm4 failed with exit status: 63

    what can  I do? Where can I tell autogen to use the latest binaries and not the old ones that came with OSX?

  • Ove Edlund

    Ove Edlund - 2010-08-31

    Do "source ENVIRONMENT.macports" and then you are ready to go.

    I had a problem with iconv when I compiled. I needed to add a line
    AC_CHECK_LIB(, ,,)
    to "configure.ac", for the library to be linked.

    Also, I can not do "make install". I am a complete newbie when it comes to autoconf and friends, so I don't know how to fix it. On the other hand this is not critical in any way. The program works beautifully, streaming media to my Sony BDP-S370.

  • Rich Petersen

    Rich Petersen - 2011-09-16

    Any chance someone might update the osx_port branch to the latest in MAIN?

    Or possibly merge the osx_port branch changes into MAIN?

  • Dominik Epple

    Dominik Epple - 2011-09-16

    I stopped using OSX, and actually stopped using DLNA as well. (Using a HDMI cable from the computer to the TV now.)

    So, I will not be able to update the port.

  • Justin Maggard

    Justin Maggard - 2011-09-16

    As of today, the main CVS branch has been updated with a host of changes, and also switches to using autoconf.  We should now support at least FreeBSD and OSX in addition to Linux.

1 2 > >> (Page 1 of 2)

Log in to post a comment.