[HOWTO] replace mt-daapd with forked-daapd (iTunes server)

TwonkyMedia, PS3, XBOX360, iTunes, & other media players

Re: [HOWTO] replace mt-daapd with forked-daapd (iTunes serve

Postby ADoko » Sun Dec 12, 2010 12:18 am

[EDIT]
Mark, it seems you're on an ARM based QNAP. If so could you try this package version:
http://rapidshare.com/files/436319983/ARM-forked-daapd-install.tar.gz
I had a bug in my build script for forked-daapd and wasn't installing the latest binary to /opt/unstable. I'll cobble together an INTEL build later. Also, apologies for the massive size of the download and install. This is my "working" build and it has elements from my attempt to build all the support libraries required for AirVideo.
Lastly... do still try the suggestions I made below regarding the meta-data.
[/EDIT]


MCFH wrote:Anthony,
Thanks for the great work - I have been in desperate need of this. Can I ask one thing - can you recompile with the --enable-itunes option so that it can support the iTunes XML file format. None of my AIF files have metadata in and this makes them all come up as unknown artist!

Thanks
Mark


Mark,

The package I posted is compiled with --enable-itunes. I'm not sure why you're not seeing the metadata. The INSTALL file in the forked-daapd source directory mentions that ffmpeg has some issues with metadata extraction. Maybe that's the culprit. I'm using the ffmpeg-0.6.x build recommended by the author. There's an option in the configuration file that lets iTunes meta-data override the meta-data that forked-daapd generates. Maybe you need to enable this? If so just modify the S50iTunes script:

Change this:
Code: Select all
            # Should iTunes metadata override ours?
            # itunes_overrides = true


to this:
Code: Select all
            # Should iTunes metadata override ours?
            itunes_overrides = true


Then restart forked-daapd:
Code: Select all
/opt/etc/init.d/S50iTunes restart
Last edited by ADoko on Mon Dec 13, 2010 1:37 am, edited 1 time in total.
User avatar
ADoko
Easy as a breeze
 
Posts: 269
Joined: Wed Dec 01, 2010 1:08 am
NAS Model: TS-401T

Re: [HOWTO] replace mt-daapd with forked-daapd (iTunes serve

Postby MCFH » Sun Dec 12, 2010 10:18 pm

Anthony,
Thanks the new build fixed it (I have also changed the itunes_overrides flag but had done so on the previous build). It would be lovely if you could find somewhere other than rapidshare to host as McAfee is blacklisting it!

Regards
Mark
MCFH
New here
 
Posts: 6
Joined: Thu Oct 07, 2010 4:49 am
NAS Model: NMP-1000

Re: [HOWTO] replace mt-daapd with forked-daapd (iTunes serve

Postby ADoko » Sun Dec 12, 2010 10:43 pm

Mark,

Excellent. I'm glad that worked.

I'm open to any suggestions for good free file hosting. I had considered using my dropbox account, but worried about the bandwidth. I'm also in the process of rebuilding and uploading a much smaller set of ARM and INTEL packages. I've changed the version number of forked-daapd so you should see "0.13" in the logs instead of "0.12". That way you'll know you're working with a forked-daapd that supports Remote v2.

-Anthony
User avatar
ADoko
Easy as a breeze
 
Posts: 269
Joined: Wed Dec 01, 2010 1:08 am
NAS Model: TS-401T

Re: [HOWTO] replace mt-daapd with forked-daapd (iTunes serve

Postby MCFH » Sun Dec 12, 2010 10:59 pm

One minor thing I have noticed there is a reference to 'root' in
/opt/etc/dbus-1/system.d/avahi-dbus.conf
that should be changed to 'admin' as the 'root' account doesn't exist.

Also, based on the iTunes client composer information is not being populated but I think that is either a ffmpeg or forked-daapd issue.

Regards
Mark
MCFH
New here
 
Posts: 6
Joined: Thu Oct 07, 2010 4:49 am
NAS Model: NMP-1000

Re: [HOWTO] replace mt-daapd with forked-daapd (iTunes serve

Postby ADoko » Sun Dec 12, 2010 11:47 pm

MCFH wrote:One minor thing I have noticed there is a reference to 'root' in
/opt/etc/dbus-1/system.d/avahi-dbus.conf
that should be changed to 'admin' as the 'root' account doesn't exist.

Also, based on the iTunes client composer information is not being populated but I think that is either a ffmpeg or forked-daapd issue.

Regards
Mark


That's odd about the "root" reference. My ./package script is what generates the avahi-dbus.conf file and grepping it for "root" doesn't return anything.

As for the client composer information, I suspect you're right. ffmpeg is doing the heavy lifting with regard to a lot of things and the forked-daapd author did mention that ffmpeg is a bit flaky. There are also libplist, libmxml, and libtaglib to add to the suspects list.

Hopefully as it matures these issues will get wrung out. I encourage you to log any bugs you find with the forked-daapd author in the hope that it improves the software.

Regards,

Anthony
User avatar
ADoko
Easy as a breeze
 
Posts: 269
Joined: Wed Dec 01, 2010 1:08 am
NAS Model: TS-401T

Re: [HOWTO] replace mt-daapd with forked-daapd (iTunes serve

Postby ADoko » Mon Dec 13, 2010 1:36 am

MCFH wrote:Anthony,
It would be lovely if you could find somewhere other than rapidshare to host as McAfee is blacklisting it!


I switched to Ubuntu One as my file host. Hopefully it works out. Otherwise we're back to RapidShare.
User avatar
ADoko
Easy as a breeze
 
Posts: 269
Joined: Wed Dec 01, 2010 1:08 am
NAS Model: TS-401T

Re: [HOWTO] replace mt-daapd with forked-daapd (iTunes serve

Postby ton123 » Thu Dec 16, 2010 5:25 am

I would very much like to be able to stream iTunes movies to my Apple TV. So I struggled thistle threat but got lost somewhere.

Could somebody post a messag stating the necessary steps to realise thistle? Thx in advance.
ton123
Know my way around
 
Posts: 144
Joined: Tue Nov 16, 2010 7:55 am
Location: Netherlands
NAS Model: TS-109/209 Pro II

Re: [HOWTO] replace mt-daapd with forked-daapd (iTunes serve

Postby ADoko » Thu Dec 16, 2010 9:47 am

ton123 wrote:I would very much like to be able to stream iTunes movies to my Apple TV. So I struggled thistle threat but got lost somewhere.

Could somebody post a messag stating the necessary steps to realise thistle? Thx in advance.


Could you tell me the steps you've taken and possibly where you are stuck? The first post in this thread is fairly explanatory, but it does assume a certain familiarity with the linux command line. If I know how far you got I can guide you through the rest of the installation process.
User avatar
ADoko
Easy as a breeze
 
Posts: 269
Joined: Wed Dec 01, 2010 1:08 am
NAS Model: TS-401T

Re: [HOWTO] replace mt-daapd with forked-daapd (iTunes serve

Postby CdG80 » Thu Dec 16, 2010 6:25 pm

Hi Anthony,

me again, sorry for not getting back earlier, I had some days off and afterwards was on a business trip, not being able to work on my NAS stuff :-)

So, I downloaded your most recent version from UbuntuOne for my TS 439 Pro II (the INTEL flavour). Actually, the version could be installed properly (I deinstalled the earlier version prior to installing the new one and decided not to preserve the songs3.db file, so it was built up from scratch). Regarding the Remote v2 support... well, the result is the very same as using the earlier build of forked-daapd... I am able to pair my iPhone (which runs Remote v2) with the forked-daapd iTunes server and I can browse the library, pretty slow but it works. Once I select a track to be played, I have not only to click the track but to click on the play button also. Then, it takes a second and... no, no sound... only an error message saying there would be something wrong with my library. Then the screen turns back to the track selection. That's it.

I slightly adjusted my S50itunes file which then builds the conf file....
Code: Select all
        # Library configuration
        library {
            # Name of the library as displayed by the clients
            # %h: hostname, %v: version
            name = "%h_iTunes"
            [...] no changes here[...]
        # Local audio output
        # audio {
            # AirTunes name - used in the speaker list in Remote
            # nickname = "$HOSTNAME"
            # Audio device name for local audio output
            # card = "default"
        # }

        # Airport Express device
        apex "BOSE" {
            # AirTunes password
            password = "b0se321"
        }
EOF
)

        /bin/echo -e "$BASIC_CONF" > "$CONF_FILE"



So, I don't want to use any local speakers but only the Airport Express audio device...

Any ideas?

Thanks a lot and cheers!

Chris
CdG80
Starting out
 
Posts: 34
Joined: Wed Dec 01, 2010 10:49 pm
NAS Model: TS-110

Re: [HOWTO] replace mt-daapd with forked-daapd (iTunes serve

Postby ADoko » Thu Dec 16, 2010 10:11 pm

Chris,

Three things:
1. What was the exact error message you received regarding your library?

2. In the second post of this thread I've put in a "patch" tarball that is based on the very latest (2010-12-13) changes to forked-daapd. You could try these if you haven't already. Otherwise we're at the mercy of the forked-daapd developers. The trouble with forked-daapd is that it's in the process of adding support for Remote v2. I'm sure there are bugs. Since I don't have an Airport Express or Ipod I'm in no position to test/debug this stuff. Let me know how using the "patch" goes. Also, it's a good idea to log these bugs with the forked-daapd authors. Hopefully they'll be able to address them more promptly than I could.

3. You could modify the S50iTunes script further to increase the loglevel to "spam", but also pair down the LOG_DOMAINS to just your remote,daap and dapd.
Code: Select all
LOG_DOMAINS=daap,remote,dacp


Playing with this might give us more insight into the issue by putting more logging into the log file. You may have to adjust the LOG_DOMAINS further and remove or add back in domains. I don't recommend using all the domains because it makes the application extremely unresponsive.

Regards,

Anthony
User avatar
ADoko
Easy as a breeze
 
Posts: 269
Joined: Wed Dec 01, 2010 1:08 am
NAS Model: TS-401T

Re: [HOWTO] replace mt-daapd with forked-daapd (iTunes serve

Postby CdG80 » Fri Dec 17, 2010 12:18 am

Hi Anthony,

thanks for your reply!

to 1: Exact error message says "An unknown error occured. Please check your library and try again."
I assume this might have to do with the fact that I copied my entire iTunes folder (including the xml libraries "iTunes Music Library.xml" and "iTunes Library.xml") from my MAC over to the NAS. I looked at the xml files and basically they contain the full qualified path to my music on my MAC, rather than the directory path where the music is stored on the NAS. I tried changing the directory paths (using find and replace) but same results.

to 2: I tried obtaining the tarball patch but have problems with that. Using wget I only download an index.html file when using your URL. When using my Windows PC to download the file, it says the tar.gz is corrupt. Could you send it to me via email to c dash d dash g at arcor dot de ?

to 3: I don't see the LOGLEVEL entry in the script, maybe it is missing? I set the LOG_DOMAINS accordingly but what about the LOGLEVEL? How does that look like?

Thanks a lot & cheers!

Chris
CdG80
Starting out
 
Posts: 34
Joined: Wed Dec 01, 2010 10:49 pm
NAS Model: TS-110

Re: [HOWTO] replace mt-daapd with forked-daapd (iTunes serve

Postby ADoko » Fri Dec 17, 2010 3:08 am

CdG80 wrote:Hi Anthony,

thanks for your reply!

to 1: Exact error message says "An unknown error occured. Please check your library and try again."
I assume this might have to do with the fact that I copied my entire iTunes folder (including the xml libraries "iTunes Music Library.xml" and "iTunes Library.xml") from my MAC over to the NAS. I looked at the xml files and basically they contain the full qualified path to my music on my MAC, rather than the directory path where the music is stored on the NAS. I tried changing the directory paths (using find and replace) but same results.

to 2: I tried obtaining the tarball patch but have problems with that. Using wget I only download an index.html file when using your URL. When using my Windows PC to download the file, it says the tar.gz is corrupt. Could you send it to me via email to c dash d dash g at arcor dot de ?

to 3: I don't see the LOGLEVEL entry in the script, maybe it is missing? I set the LOG_DOMAINS accordingly but what about the LOGLEVEL? How does that look like?

Thanks a lot & cheers!

Chris


Chris,

Try this link for the patch:
http://ubuntuone.com/p/U40/

You were correct that the other one was broken. Hopefully this fixed it.
Look for the word "loglevel" in the S50iTunes script. It's in the forked-daapd conf file that the script generates. (Basically the same place that you've been modifying to change the name of your Airport Express.)

Lastly, I'd suggest you move your full iTunes music library away from /share/Qmultimedia and start out with a very small library of around 100 songs. This will let you connect and debug issues much more rapidly. Be sure to stop forked-daapd and backup your songs3.db file before you do this.

Regards,

Anthony
User avatar
ADoko
Easy as a breeze
 
Posts: 269
Joined: Wed Dec 01, 2010 1:08 am
NAS Model: TS-401T

Re: [HOWTO] replace mt-daapd with forked-daapd (iTunes serve

Postby CdG80 » Fri Dec 17, 2010 4:43 pm

Hi Anthony,

thanks a lot for your update and also for sharing the patch tarball via email, really appreciated. Last night I applied the patch and switched to a small amount of music files for testing. Actually I copied some music files to a temporary directory (/share/Download/TestiTunes/), changed the library path in S50iTunes script to that directory, adjusted logging, saved the original songs3.db file and then restarted the S50iTunes script. Harddisks were busy as expected for some minutes and then I tried to attach my Remote.App (vi'ed a test.remote file in the test directory adding my iPhone's name and the Remote.App-code as displayed on the screen of my phone). It immediately attached after saving the file, perfect! Also browsing through the folders using the Remote.App was real quick, other than before when I used my entire iTunes library :-)

But then I tried playing a song and, again, it did not play... The Remote.App just returned back to the song list. I tried again and then Remote.App displayed the error message as before, "An unknown error occured. Please check your library and try again."

As I adjusted logging as you suggested, the log is telling me that it basically can't play the song...
Code: Select all
[2010-12-17 08:33:28]     daap: Investigating daap.songalbum
[2010-12-17 08:33:28]     daap: Done with meta tag daap.songalbum (A Complete Singles Collection)
[2010-12-17 08:33:28]     daap: Done with song
[2010-12-17 08:33:28]     daap: Done with song list, 15 songs
[2010-12-17 08:33:31]     dacp: DACP request: /ctrl-int/1/cue?command=play&query=(('daap.songartist:ABBA','daap.songalbumartist:ABBA')%2B('com.apple.itunes.mediakind:1','com.apple.itunes.mediakind:32')%2B'daap.songalbumid:1815090405978768993')&index=0&sort=album&srcdatabase=0x1&clear-first=1&session-id=100
[2010-12-17 08:33:31]     daap: Trying DAAP query -(('daap.songartist:ABBA','daap.songalbumartist:ABBA')+('com.apple.itunes.mediakind:1','com.apple.itunes.mediakind:32')+'daap.songalbumid:1815090405978768993')-
[2010-12-17 08:33:31]     daap: DAAP query AST:
        (+ (+ (, daap.songartist:ABBA daap.songalbumartist:ABBA) (, com.apple.itunes.mediakind:1 com.apple.itunes.mediakind:32)) daap.songalbumid:1815090405978768993)
[2010-12-17 08:33:31]     daap: DAAP SQL query: -((((artist = 'ABBA' OR album_artist = 'ABBA') AND (media_kind = 1 OR media_kind = 32)) AND songalbumid = 1815090405978768993))-
[2010-12-17 08:33:31]     dacp: Could not start playback
[2010-12-17 08:33:32]     dacp: DACP request: /ctrl-int/1/getproperty?properties=dmcp.volume&session-id=100
[2010-12-17 08:33:32]     dacp: Asking for 1 properties
[2010-12-17 08:33:32]     dacp: Found 1 properties
[2010-12-17 08:33:32]     dacp: DACP request: /ctrl-int/1/playstatusupdate?revision-number=2&session-id=100
[2010-12-17 08:33:33]     dacp: DACP request: /ctrl-int/1/getproperty?properties=dmcp.volume&session-id=100
[2010-12-17 08:33:33]     dacp: Asking for 1 properties
[2010-12-17 08:33:33]     dacp: Found 1 properties
[2010-12-17 08:33:33]     dacp: DACP request: /ctrl-int/1/nowplayingartwork?mw=640&mh=640&session-id=100
[2010-12-17 08:33:36]     dacp: DACP request: /ctrl-int/1/cue?command=play&query=(('daap.songartist:ABBA','daap.songalbumartist:ABBA')%2B('com.apple.itunes.mediakind:1','com.apple.itunes.mediakind:32')%2B'daap.songalbumid:1815090405978768993')&index=0&sort=album&srcdatabase=0x1&clear-first=1&session-id=100
[2010-12-17 08:33:36]     daap: Trying DAAP query -(('daap.songartist:ABBA','daap.songalbumartist:ABBA')+('com.apple.itunes.mediakind:1','com.apple.itunes.mediakind:32')+'daap.songalbumid:1815090405978768993')-
[2010-12-17 08:33:36]     daap: DAAP query AST:
        (+ (+ (, daap.songartist:ABBA daap.songalbumartist:ABBA) (, com.apple.itunes.mediakind:1 com.apple.itunes.mediakind:32)) daap.songalbumid:1815090405978768993)
[2010-12-17 08:33:36]     daap: DAAP SQL query: -((((artist = 'ABBA' OR album_artist = 'ABBA') AND (media_kind = 1 OR media_kind = 32)) AND songalbumid = 1815090405978768993))-
[2010-12-17 08:33:36]     dacp: Could not start playback
[2010-12-17 08:33:36]     dacp: DACP request: /ctrl-int/1/playstatusupdate?revision-number=2&session-id=100
[2010-12-17 08:33:42]     dacp: DACP request: /ctrl-int/1/playpause?session-id=100
[2010-12-17 08:33:42]     dacp: Player returned an error for start after pause
[2010-12-17 08:33:42]     dacp: DACP request: /ctrl-int/1/playstatusupdate?revision-number=4&session-id=100
[2010-12-17 08:33:42]     dacp: DACP request: /ctrl-int/1/getproperty?properties=dmcp.volume&session-id=100
[2010-12-17 08:33:42]     dacp: Asking for 1 properties
[2010-12-17 08:33:42]     dacp: Found 1 properties
[2010-12-17 08:33:43]     dacp: DACP request: /ctrl-int/1/getproperty?properties=dmcp.volume&session-id=100
[2010-12-17 08:33:43]     dacp: Asking for 1 properties
[2010-12-17 08:33:43]     dacp: Found 1 properties
[2010-12-17 08:33:43]     dacp: DACP request: /ctrl-int/1/nowplayingartwork?mw=640&mh=640&session-id=100


Guess I will have to go to the developer of forked-daapd for that... Do you have an idea? I tried the same with multiple files, always same result...

Cheers, Chris
CdG80
Starting out
 
Posts: 34
Joined: Wed Dec 01, 2010 10:49 pm
NAS Model: TS-110

Re: [HOWTO] replace mt-daapd with forked-daapd (iTunes serve

Postby ADoko » Fri Dec 17, 2010 9:08 pm

Chris,

It looks like this could an issue with forked-daapd. I know by looking at the commit history in the git repository that there has been a lot of work in the "remote" area of the codebase recently. There could be some bugs within it.

I went and looked through the source code of forked-daapd. Could you try again with only 10 songs in the library, but this time leave all the LOG_DOMAINS in place? If that doesn't work (or is too slow) then try adding the "player" domain to the list of domains that I specified in the last list. (I think it was daap,dacp,remote.) From the code the only place it looks like it could fail is in the player. (I could be wrong. I haven't fully investigated the source but it's an educated guess.)

Then either post the output or e-mail it to me. This way we can get a lot of information to help out the forked-daapd developers. (Also, I'm worried it might have something to do with the way I built thing the libraries. If that's the case then it will be more complicated to fix.)

Regards,

Anthony
User avatar
ADoko
Easy as a breeze
 
Posts: 269
Joined: Wed Dec 01, 2010 1:08 am
NAS Model: TS-401T

Re: [HOWTO] replace mt-daapd with forked-daapd (iTunes serve

Postby CdG80 » Fri Dec 17, 2010 9:38 pm

Anthony,

I enabled all log levels and reduced the amount of files to 10 as suggested, then dropped the songs3.db and the log file, then paired the remote with my NAS again and faced the very same situation as before (which was expected).

Looking at the log I see the following relevant:
Code: Select all
[2010-12-17 13:26:13]   player: Player queue query returned 10 items
[2010-12-17 13:26:13]   player: Added song id 9 (As Good As New)
[2010-12-17 13:26:13]   player: Added song id 8 (Voulez-vous)
[2010-12-17 13:26:13]   player: Added song id 7 (I Have a Dream)
[2010-12-17 13:26:13]   player: Added song id 5 (Angeleyes)
[2010-12-17 13:26:13]   player: Added song id 10 (The King Has Lost His Crown)
[2010-12-17 13:26:13]   player: Added song id 2 (Does Your Mother Know)
[2010-12-17 13:26:13]   player: Added song id 1 (If it Wasn't For the Nights)
[2010-12-17 13:26:13]   player: Added song id 3 (Chiquitita)
[2010-12-17 13:26:13]   player: Added song id 6 (Lovers Live a Little Longer)
[2010-12-17 13:26:13]   player: Added song id 4 (Kisses of Fire)
[2010-12-17 13:26:13]       db: End of query results
[2010-12-17 13:26:13]       db: Running query 'SELECT * FROM files WHERE id = 5;'
[2010-12-17 13:26:13]   player: Opening /share/MD0_DATA/Download/TestiTunes/ABBA/Voulez-vous/04 Angeleyes.mp3
[2010-12-17 13:26:13]   laudio: cannot find card '0'[2010-12-17 13:26:13]   laudio: function snd_func_card_driver returned error: No such file or directory[2010-12-17 13:26:13]   laudio: error evaluating strings[2010-12-17 13:26:13]   laudio: function snd_func_concat returned error: No such file or directory[2010-12-17 13:26:13]   laudio: error evaluating name[2010-12-17 13:26:13]   laudio: function snd_func_refer returned error: No such file or directory[2010-12-17 13:26:13]   laudio: Evaluate error: No such file or directory[2010-12-17 13:26:13]   laudio: Unknown PCM default[2010-12-17 13:26:13]   laudio: Could not open playback device: No such file or directory
[2010-12-17 13:26:13]   player: Could not open local audio
[2010-12-17 13:26:13]     dacp: Could not start playback
[2010-12-17 13:26:13]   player: Player status: stopped

So basically it laudiop cannot open the local audio device. That's no surprise, as there is none... That is why I specified my Airtunes speakers in the S50iTunes script:
Code: Select all
        # Local audio output
        # audio {
            # AirTunes name - used in the speaker list in Remote
            # nickname = "$HOSTNAME"
            # Audio device name for local audio output
            # card = "default"
        # }

        # Airport Express device
        apex "BOSE" {
            # AirTunes password
            password = "b0se321"
        }
EOF
)

I then tried again, re-enabling the local audio with default values...
Code: Select all
        # Local audio output
        audio {
            # AirTunes name - used in the speaker list in Remote
            nickname = "$HOSTNAME"
            # Audio device name for local audio output
            # card = "default"
        }

Which lead to the same results...
Code: Select all
[2010-12-17 13:34:54]       db: Running query 'SELECT * FROM files WHERE id = 9;'
[2010-12-17 13:34:54]   player: Opening /share/MD0_DATA/Download/TestiTunes/ABBA/Voulez-vous/01 As Good As New.mp3
[2010-12-17 13:34:55]   laudio: cannot find card '0'[2010-12-17 13:34:55]   laudio: function snd_func_card_driver returned error: No such file or directory[2010-12-17 13:34:55]   laudio: error evaluating strings[2010-12-17 13:34:55]   laudio: function snd_func_concat returned error: No such file or directory[2010-12-17 13:34:55]   laudio: error evaluating name[2010-12-17 13:34:55]   laudio: function snd_func_refer returned error: No such file or directory[2010-12-17 13:34:55]   laudio: Evaluate error: No such file or directory[2010-12-17 13:34:55]   laudio: Unknown PCM default[2010-12-17 13:34:55]   laudio: Could not open playback device: No such file or directory
[2010-12-17 13:34:55]   player: Could not open local audio
[2010-12-17 13:34:55]     dacp: Player returned an error for start after pause

The same happens if I uncomment the Airport Express section and use the 'card = "default"' string for local audio.

So, as I do not have local audio (as we all don't have it I would say), I guess I need to use the Airport Express... Any idea?

Thanks, Chris
CdG80
Starting out
 
Posts: 34
Joined: Wed Dec 01, 2010 10:49 pm
NAS Model: TS-110

PreviousNext

Return to Media Streaming

Who is online

Users browsing this forum: No registered users and 3 guests