1 (edited by ejurgensen 2011-06-08 19:43:56)

Topic: iTunes server (forked-daapd)

I wanted to run an iTunes server on my wndr3700, controlling it via Apple Remote on my iPod Touch. The router has an USB storage device attached with overlay (http://wiki.openwrt.org/doc/howto/extroot) and off course it also has my music library.

OpenWrt trunk offers the package mt-daapd, which is also an iTunes server, but which doesn’t support Remote and which is unmaintained. However, Julian Blache has made a much-improved version called forked-daapd (http://www.jblache.org/projects/daapd/), which I’ve now packaged for OpenWrt.

Forked-daapd relies on ffmpeg, so I’ve also made a package with a newer version of ffmpeg (0.7 snapshot). The package offered in OpenWrt trunk (0.5.4) seems a bit old and feature-less.

If you’re interested in running forked-daapd or ffmpeg I’ve made a wiki-howto here: http://wiki.openwrt.org/inbox/howto/forked-daapd (it's still in the Wiki Inbox... I don't know how to get it moved out).

Please notice that this is work in progress, so don't expect it to be plug and play.

Re: iTunes server (forked-daapd)

Very good, i'll try it soon!

Re: iTunes server (forked-daapd)

Thank you very much for your efforts! I'll make sure to give it a try once I'm back home.
And I guess I'll try fixing some of the bugs you mentioned on the wiki page.

Re: iTunes server (forked-daapd)

Sounds good, hope you can use it. If you build the packages yourself remember you need to make a symlink manually (see bug #3 in the Howto). I hope I'll find a way to fix that soon.

Re: iTunes server (forked-daapd)

Hi.
Judging by your make-file, you use version 0.16 of forked-daapd? Well, perhaps it'd be woth a try using the newest version, 0.19? Reading the release notes, a lot of bugs have been fixed as well as improvements made...
I'd be interested in an update as I'm toying with the idea of running forked on a router (which I don't have yet), since doing this on a full-blown Ubuntu server (something I have successfully managed) seems like an overkill to me.

6 (edited by ejurgensen 2011-09-13 08:42:31)

Re: iTunes server (forked-daapd)

Thanks for the tip. I hadn' t noticed that Julian has been so busy this summer. It appears 0.17 and 0.19 include performance improvements, that's really interesting. I also read that 0.17 uses libdispatch instead of libevent, so that means the makefile needs some changes. I'll definitely look into it as soon as possible, but my openwrt build box is defunc right now, so it might be some weeks.

Re: iTunes server (forked-daapd)

I know it's only been 2 weeks, but do you have any news?

Re: iTunes server (forked-daapd)

Happy to hear there's demand for this!

I've got my Openwrt build environment up and running again, but haven't had time to look at makefiles and patches yet. Since there seem to be quite a few changes upstream I guess it'll still be a few weeks.

9 (edited by ejurgensen 2011-10-19 21:20:04)

Re: iTunes server (forked-daapd)

Ok, here's a test release of forked-daapd 0.19 [s](with custom ffmpeg 0.8.2, which is unfortunately still necessary)[/s].

Binaries (requires trunk and ar71xx chipset): http://www.gyfgafguf.dk/openwrt/packages/ar71xx/
Sources: http://www.gyfgafguf.dk/openwrt/src/source.tar.gz

[s]Since I haven't tested much yet, I didn't update the Packages files. That means the new version won't install via opkg update. Instead the .ipk's need to be downloaded directly and installed.[/s]

My impression is that this new version is a great deal faster than 0.16 was. Controlling the server via Remote on my iPod Touch is quite fast now (server is running on wndr3700). So that's a very nice improvement. Also some of the ffmpeg problems from the previous version seem to have been fixed.

10 (edited by jd_oe 2011-10-11 14:44:46)

Re: iTunes server (forked-daapd)

Excellent news, thanks ejurgensen. I guess I'll go shopping for a router now - any recommendations?
I'd like forked-daapd and miniDLNA - would the Buffalo WZR-HP-AG300H have enough ooomph?
Cheers, jd

11 (edited by ejurgensen 2011-10-13 14:04:34)

Re: iTunes server (forked-daapd)

I don't know much about hardware, so I think other people here would be able to help you better. I have the wndr3700 and I am very satisfied. It has sufficient power for running forked-daapd and miniDLNA at the same time, but only just barely. I don't use minidlna much, so most of the time I don't have it running.

I've submitted patches/ticket towards ffmpeg, sqlite3, libevent and zlib. ffmpeg has already been fixed, and if the rest are accepted forked-daapd won't need special versions of these packages any more. That should make installation a great deal easier.

Re: iTunes server (forked-daapd)

I've made few improvements, and also tested it a bit more. A nice bunch of bugs were cleared. It can now be installed with opkg, as described in the Howto mentioned in my original post.

Re: iTunes server (forked-daapd)

Thanks for the very helpful documentation and the packaging efforts that went into this ejurgensen.

I also have an wndr3700 v1,  and was able to install the packages quite easily  (I am running arokh's wndr3700 builds and had to remove some packages (like ffmpeg-mini) to avoid conflicts with yours.

Things installed fine, and I was able to pair daapd with apple remote running on my ipad (remote v2.2)   but I can't figure out for the life of me howto send audio to another device.  When I click play through the ipad for a music file in my daapd library, I see the following in the logs, and ipad thinks about playing, but stops immediately (so no airplay option).  I realize I don't have an audio device locally, but remote isn't giving me a choice to use another device  (nothing in settings, except to turn on/off home sharing and adding another device)


[2011-11-18 11:49:56]   laudio: cannot find card '0'[2011-11-18 11:49:56]   laudio: function snd_func_card_driver returned error: No such file or directory[2011
[2011-11-18 11:49:56]   player: Could not open local audio       
[2011-11-18 11:49:56]     dacp: Could not start playback               
[2011-11-18 11:49:56]     dacp: Could not find requested property 'dacp.fullscreenenabled'
[2011-11-18 11:49:56]     dacp: Could not find requested property 'dacp.fullscreen'
[2011-11-18 11:49:56]     dacp: Could not find requested property 'dacp.visualizerenabled'
[2011-11-18 11:49:56]     dacp: Could not find requested property 'dacp.visualizer'

My conf has the defaults in the output section.

# Local audio output                           
audio {                       
        # AirTunes name - used in the speaker list in Remote
        nickname = "OpenWrt"                                                       
        # Audio device name for local audio output
#       card = "default"                 
        # Mixer channel to use for volume control - ALSA/Linux only
        # If not set, PCM will be used if available, otherwise Master.
#       mixer = ""
}

I can send debug logs over, bu

14 (edited by ejurgensen 2011-11-18 20:12:44)

Re: iTunes server (forked-daapd)

You are right, the itunes server is trying to output sound on your wndr3700, and that is no good. You should be seeing an AirPlay-icon in Remote and there be able to select a proper output device. It's in the top right corner when you're in the artist list. You must select the AirPlay device before playing your music.

If you can't find any AirPlay icon it's because daapd isn't finding your AirPlay device. Which device are you using? I've tried Airport Express and Apple TV and they worked fine.

I think daapd relies on avahi to detect these devices. Can you check if avahi is running on your wndr? (if you run the command "ps" you should see a line with "avahi-daemon: running")

Re: iTunes server (forked-daapd)

The forked-daapd server no longer requires a modified version of sqlite3. Forked-daapd depends on a certain compile option in sqlite3 being enabled, and the good people of OpenWrt have now enabled it in trunk (since version 3070701-2 of sqlite3).

As forked-daapd no longer requires custom versions of any packages it'll be easier to install. Being compatible with trunk also means I can look into submitting it for inclusion.

Re: iTunes server (forked-daapd)

Sounds very nice!

I tried to get it to run on RC6 with ffmpeg, zlib, libsqlite3 and libevent from trunk. It starts without errors in the log, but the daemon exits after initialisation.

Any ideas? Looks like I need to switch to trunk...


Logoutput:
[2011-12-10 09:05:32]     main: Forked Media Server Version 0.19 taking off
[2011-12-10 09:05:32]     main: Initialized with gcrypt 1.5.0
[2011-12-10 09:05:32]     main: PID: 13060
[2011-12-10 09:05:32]     main: mDNS init
[2011-12-10 09:05:32]     mdns: Initializing Avahi mDNS
[2011-12-10 09:05:32]     mdns: Avahi state change: Client connecting
[2011-12-10 09:05:32]     main: Initializing database
[2011-12-10 09:05:32]       db: Running query 'SELECT value FROM admin WHERE key = 'schema_version';'
[2011-12-10 09:05:32]       db: Running query 'ANALYZE;'
[2011-12-10 09:05:33]       db: Running query 'SELECT COUNT(*) FROM files f WHERE f.disabled = 0;'
[2011-12-10 09:05:33]       db: Running query 'SELECT COUNT(*) FROM playlists p WHERE p.disabled = 0;'
[2011-12-10 09:05:33]       db: Database OK with 0 active files and 4 active playlists

Re: iTunes server (forked-daapd)

What versions of ffmpeg, zlib and libsqlite3 are you running?

If you didn't already do it, I'd also suggest setting the log level in /etc/forked-daapd.conf to "debug", which might provide more information on what is going wrong.

Re: iTunes server (forked-daapd)

Loglevel is set to spam which is the highest i guess.

Here the installed versions:
zlib - 1.2.5-1
libsqlite3 - 3070701-2
libffmpeg-full - 0.8.5-1

Thanks for your help!

Re: iTunes server (forked-daapd)

Those versions are good, so it must be something else.

I suggest you delete the database file, make a new library with just a couple of mp3's, and change "directories" in the config file to this new test-library. Then start the server again and check how it goes. If forked-daapd still fails I'd say it's an indication of a dependency problem. If it doesn't fail it's an indication of something in your real music library that daapd doesn't like.

Re: iTunes server (forked-daapd)

ejurgensen wrote:

You are right, the itunes server is trying to output sound on your wndr3700, and that is no good. You should be seeing an AirPlay-icon in Remote and there be able to select a proper output device. It's in the top right corner when you're in the artist list. You must select the AirPlay device before playing your music.

If you can't find any AirPlay icon it's because daapd isn't finding your AirPlay device. Which device are you using? I've tried Airport Express and Apple TV and they worked fine.

I think daapd relies on avahi to detect these devices. Can you check if avahi is running on your wndr? (if you run the command "ps" you should see a line with "avahi-daemon: running")

I didn't have an airplay device like an apple tv while I was doing my tests, just an ipad and iphone and a mac with itunes.  I thought that since itunes on the mac and the ipad allowed the output to be sent to one another, that I would see them on the lists.   I just got an appletv over the weekend and finally saw the option.

Now if forked-daapd can only figure out the home-sharing protocol.

21 (edited by ejurgensen 2011-12-18 21:56:44)

Re: iTunes server (forked-daapd)

In iTunes on your mac you should be able to see your OpenWrt music library in the left hand panel (in the "Shared" section). You should also be able to listen to the music on the mac. If it doesnt't show up then I'm guessing forked-daapd or avahi-daemon are not working.

I don't know if there is a way to make forked-daapd stream to ipad/ipod or iphone.

Re: iTunes server (forked-daapd)

I've upgraded forked-daapd due to changes in the naming of the avahi packages, which forked-daapd depends on.

Re: iTunes server (forked-daapd)

A few words about running forked-daapd on arokh's OpenWrt build: I tried upgrading my router to arokh's build of OpenWrt, but I found out that forked-daapd won't run on it. The reason appears to be dbus and avahi. Arokh's packages do not include a dbus-enabled version avahi, so I tried installing the version from the official repository. However, this would not run, and I was unable to find a fix or a work-around. So without a proper avahi, forked-daapd wouldn't run.

Going back to OpenWrt trunk fixed the problem.

Re: iTunes server (forked-daapd)

I have tried to install this on my router, but I get this error:

satisfy_dependencies_for: Cannot satisfy the following dependencies for forked-daapd:
*     libffmpeg-full

I'm running Backfire (10.03.1-RC6, r28680)

Re: iTunes server (forked-daapd)

You won't be able to run it with Backfire, you need to upgrade to Trunk. The packages in Backfire are too old and don't include stuff which forked-daapd depends on. ffmpeg is 0.5.4 in Backfire, but is 0.8.7 in Trunk. It is probable that sqlite3 and libevent in Backfire are also inadequate.