Sunny Days – Day 7

The last few days gave me not much opportunity to seriously explore the Sun T2000 further. Still I managed to do some minor cleanups and make a major step forward with my pet project:

„We have joy, we have fun, we stream music from the Sun.”

Now, what’s that? In case you’ve been exploring my site a bit you may have learned that I’m using iTunes to listen to my music collection. The audio is streamed from a central server running Ron Pedde’s great mt-daapd. It uses the DAAP protocol to stream the audio and the multicast DNS protocol to announce it’s presence on the local network.

Since by now I had learned that it’s almost guaranteed someone else already did what I was planning to do, I searched the web and found the blog of Constantin Gonzales. Although he had used a much older version of mt-daapd, his descriptions of how he got it up and running were very helpful and I used them as a blueprint for my project.

Prerequisites
To be able to compile mt-daapd, as usual a few other tools are needed. First, you need a mDNS daemon. While mt-daapd is able to announce it’s presence to any mDNS server you still need that very server to distribute the information to the other machines on the network. There are some of these mDNS servers available, the most prominent ones being

  • Porchdog Software’sHowl,
  • the Avahi service discovery project, and
  • of course Apple’s own mDNS implementation (Registration required)
  • My original intention was to go with Apple’s reference implementation. However I had to find out that while it says it will compile on Solaris this isn’t true for Solaris 10. The reason is a change in netdb.h resulting in the needed structs getaddrinfo and freeadrinfo not being available anymore. I didn’t dig deeper into that problem but reverted to using Howl instead. Later on I may give avahi a try because that’s what’s being included into most current Linux distributions anyway. Howl compiled without problems.

    In addition, you’ll need libid3tag so that mt-daapd will be able to read the ID3 information from your MP3 files. libid3tag is part of Underbit’s MAD MPEG Audio Decoder. From the files offered by the project you only need the latest libid3tag. It will compile without problem, too.

    Since I wanted to use sqlite3 to hold the database of my music files, I had to install that as well. No problems there, just use the version from BlastWave.

    Lastly, I wanted to be able to stream audio encoded in Ogg/Vorbis, too. To do this I needed a way to convert Ogg encoded audio into an MP3 stream on the fly because iTunes clients will only accept MP3 encoded streams. The tool of choice was flac. While being an audio codec in itself (and a lossless at that), flac also supports on the fly conversion and output redirection. Using integer calculations only made it a perfect match for the T2000′s capabilities. Installation was a breeze: download, unpack, compile, install, done.

    Mt-Daapd
    Installing mt-daapd itself wasn’t as straight forward. Even with the latest source code from the nightlies repository the little flaws noted at Gonzo’s site were still present.
    So I patched ./src/scan-xml.c to include the function timegm() when being compiled on Solaris like suggested in the reference documentation so nicely provided by Apple.

    The next problem was that while the configure script detected sqlite3 just fine it wouldn’t add the proper include and library locations to the commands passed to the compiler. Instead of using the monster of a configure command line as was done by Gonzo, I opted for also patching up configure itself to accept the new option –with-sqlite3=<path>.

    Afterwards I found out that while mt-daapd would now compile just fine it would complain at startup about not being able to find the needed library libFLAC.so.7. So I again edited configure to include the information about additional search pathes on the linker command line when run on Solaris. I did this by adding “-R/usr/local/lib:/opt/csw/lib:/usr/sfw/lib”. Order is important there. I tend to put the stuff I compile below /usr/local. Next comes the path to packages installed from BlastWave. Last in the list is the path to the SunFreeware tools that came pre-installed on my T2000.

    You can get a complete patchfile with all my changes to mt-daapd-svn-909 here: mt-daapd-svn-909.solaris10.tar.gz

    After these changes mt-daapd compiled easily. Since Gonzo didn’t make true on his promise to describe how to add howl and mt-daapd to the Solaris Service Management Facility (SMF) I had to do this on my own. But more on that later. Currently I’m happy to listen to my music streamed from the Sun using iTunes.

    [ All posts about my experiences with the SunFire T2000 >>> ]

    Incoming search terms:

    This entry was posted in Hardware, Misc. Bookmark the permalink.

    One Response to Sunny Days – Day 7

    1. ron pedde says:

      Fixed in revision 956 (http://trac.mt-daapd.org/index.cgi/changeset/956).

      It’ll be in next nightlies.

      Cheers.
      — Ron

    Leave a Reply

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

    *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>