User avatar
baal
Posts: 10
Joined: Sat Feb 09, 2013 4:37 pm
Location: Germany

forked-daapd with Remote 3.0 support

Sat Feb 23, 2013 11:00 am

Hello folks,

after a lot of tries I finally managed to compile a version of forked-daapd which supports Remote 3.0!
By now I only was able to build a version that wants to be installed in /usr/local/ but I don't want to hold it back. When I was able to build a /usr/ version I'll update this thread.

I know you're all hungry for it, so here's first how to get and install it and after that I'll tell the whole story for those, who are intrested.
I tried the following guide on a fresh installed Raspberry using 2012-12-16-wheezy-raspbian.img

If you're using another Raspberry OS and/or getting any erros, please report. Also report if you succeeded on another OS, please. Thanks!


First of all get the packages from the dropbox:

Code: Select all

wget https://www.dropbox.com/s/mnw9b7rus56nifw/forked-daapd_0.19gecco-1_armhf.deb
wget https://www.dropbox.com/s/705sfimbvx7bzmn/libevent-1.4-2_1.4.13-stable-1_armhf.deb
wget https://www.dropbox.com/s/yn5txpa63n9ihhv/libevent-core-1.4-2_1.4.13-stable-1_armhf.deb
Then install:

Code: Select all

sudo dpkg -i forked-daapd_0.19gecco-1_armhf.deb libevent-1.4-2_1.4.13-stable-1_armhf.deb libevent-core-1.4-2_1.4.13-stable-1_armhf.deb
Maybe there were some dependency errors... (maybe your OS requieres some other/more libs, I haven't in the dependencies list. Please report!)

Code: Select all

sudo apt-get update
sudo apt-get -f install
OK! Now you have to setup the user/groups...

Code: Select all

sudo useradd -r daapd
sudo groupadd music 
sudo usermod -G music daapd
...and create the directories for the database and pid-file:

Code: Select all

sudo mkdir /var/cache/forked-daapd
sudo chown daapd /var/cache/forked-daapd
sudo mkdir /usr/local/var
sudo mkdir /usr/local/var/run
Last step: configure the conf file /usr/local/etc/forked-daapd.conf to fit your needs (tutorial --> http://elinux.org/RPiForked-Daapd#Confi ... rked-Daapd)

And finally... run it!

Code: Select all

sudo /usr/local/sbin/forked-daapd
That's it!


And here's the long story:

First of all THANKS to diegocaro (http://www.raspberrypi.org/phpBB3/viewt ... 66&t=17832), who built and provided a raspberry version of forked-daapd and so encouraged me, that there is a way to get this running.
Also THANKS to treus (https://github.com/treus), who developed the Remote 3.0 support for forked-daapd.

I started the greenly path of "just get the code and compile it on the raspi".
After uncountable frustrating tries of building the libdispatch version, which won't do because there is no suitable lib for armhf, I remembered diegocaro's comment, that he built the libevent version.
I switched over to the libevent branch and after a lot of step by step configuration of my development environment I finally got it running.
But then I was very surprised that when I wanted to control forked-daapd with Remote 3.0, I still got the same error...

What happened?!?!?
Some research at github and I discovered that the Remote 3.0 support has not been implemented at the libevent branch. So it was at me to copy and paste it over. You'll find my fork at https://github.com/geccocode/forked-daapd

A new compile... crossing fingers... It works!

OK, the long story seems to be short, but after all it took me nearly three weeks of try and error.
And I'm not finished yet. I still have to build a package that will install to /usr/-path (help welcome!) and then I'd like to implement the whole functionality of Remote 3.0, like cover-arts.

We'll see.

User avatar
scruss
Posts: 2251
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: forked-daapd with Remote 3.0 support

Sat Feb 23, 2013 2:01 pm

Good work!

If anyone's needing a stable DAAP server but not necessarily iTunes/Remote support, the old mt-daapd nightly #1696 still works a treat, and isn't too hard to build:

Code: Select all

sudo apt-get install libsqlite3-dev libgdbm-dev libflac-dev flac
wget http://pkgs.fedoraproject.org/repo/pkgs/mt-daapd/mt-daapd-svn-1696.tar.gz/42ba1f432bb88e18a8cb4ce0fc52eb64/mt-daapd-svn-1696.tar.gz
tar xvzf mt-daapd-svn-1696.tar.gz 
cd mt-daapd-svn-1696/
./configure --enable-flac --enable-ogg --enable-sqlite3
 ...
then the usual process.

I've been running this on a SheevaPlug for about three years. It's rock solid. Code's ugly, sure, but the forked-daapd “refactor” took out a lot of useful stuff, like smart playlists.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

delidave
Posts: 12
Joined: Wed Feb 20, 2013 7:20 pm

Re: forked-daapd with Remote 3.0 support

Sun Feb 24, 2013 10:51 am

Just setting up a fresh img of deb wheez to try, will report back with any errors etc. Think the main problem is my lib is 25000 songs. attempted the above under squeezeplug on rpi with no joy.

User avatar
scruss
Posts: 2251
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: forked-daapd with Remote 3.0 support

Sun Feb 24, 2013 2:57 pm

delidave wrote:Think the main problem is my lib is 25000 songs.
Mine's currently at 33,725 under sqlite with no problems. dunno if baal's build uses gdb or sqlite, or whether that would be an issue at all.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
baal
Posts: 10
Joined: Sat Feb 09, 2013 4:37 pm
Location: Germany

Re: forked-daapd with Remote 3.0 support

Sun Feb 24, 2013 4:04 pm

Hi,

my build uses sqlite. I just had a quick look... actually I only got about 1.700 mp3's in my database, but it works quite nice without any problems.

delidave
Posts: 12
Joined: Wed Feb 20, 2013 7:20 pm

Re: forked-daapd with Remote 3.0 support

Mon Feb 25, 2013 6:05 pm

Dont know if im doing something wrong here but cant get it to work. Followed the instructions as per post. says forked-daapd taking off. nothing. no task running, no show in itunes, or remote. are there any special requirements other than the code on this page. have mounted my network drive, shows in /mnt. have edited conf file to point to this.

User avatar
baal
Posts: 10
Joined: Sat Feb 09, 2013 4:37 pm
Location: Germany

Re: forked-daapd with Remote 3.0 support

Mon Feb 25, 2013 6:16 pm

Hi delidave,

could you please delete the log-file (/var/log/forked-daapd.log), set the log-level to debug or even info in the config, start forked-daapd again and post the content of the log-file?

Thanks!

delidave
Posts: 12
Joined: Wed Feb 20, 2013 7:20 pm

Re: forked-daapd with Remote 3.0 support

Mon Feb 25, 2013 6:44 pm

Just on route to watch my belov-ed west ham take on Tottenham so will do as soon as back. Thanks for the fast reply

delidave
Posts: 12
Joined: Wed Feb 20, 2013 7:20 pm

Re: forked-daapd with Remote 3.0 support

Mon Feb 25, 2013 11:54 pm

Right, I have 3 itunes library's. I pointed it at a small one that has just been started to check for it working. This didnt work. Checked log like you said and couldnt create .db. I have now mounted my large one to test and it has started up. gonna take all night to index though, 25000 songs. My question is, what itunes files does forked-daapd use/rely on, as this seems to be the issue and have noticed that the directory structure is slightly different between the two librarys.

User avatar
baal
Posts: 10
Joined: Sat Feb 09, 2013 4:37 pm
Location: Germany

Re: forked-daapd with Remote 3.0 support

Tue Feb 26, 2013 3:33 am

Hi delidave,

did u uncomment the line for the database location in the config file file (must be one of the first lines)? And did u create the needed path?

Code: Select all

sudo mkdir /var/cache/forked-daapd
sudo chown daapd /var/cache/forked-daapd
I'm sorry, but I can't answer your question. What iTunes files forked-daapd uses goes a little to deep... What I can say is, that in my case I use the same folder/file structure as I did with iTunes.

delidave
Posts: 12
Joined: Wed Feb 20, 2013 7:20 pm

Re: forked-daapd with Remote 3.0 support

Tue Feb 26, 2013 7:24 am

Ok thanks. Anyway, I have up and running, a lot more stable than the previous version I was using. What are the chances of getting working:
Add to up next
Artist sorting correctly
And I believe from looking at the log that there are other meta details not being picked up. Sorry for the million questions but I'm new to the Unix system and trying to ram my brain as fast as possible :)

User avatar
baal
Posts: 10
Joined: Sat Feb 09, 2013 4:37 pm
Location: Germany

Re: forked-daapd with Remote 3.0 support

Tue Feb 26, 2013 11:37 am

Hi again,

if I get you right, you finally got forked-daapd running. Right? What was the solution?

After someone else got my build running, I now will have a look at the sourcecode, hopefully understand it and add more functions. But I don't know if I will succeed or how long it'll take.

User avatar
scruss
Posts: 2251
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: forked-daapd with Remote 3.0 support

Tue Feb 26, 2013 12:06 pm

delidave wrote:what itunes files does forked-daapd use/rely on
DAAP doesn't care about folders. It sends a big list of matching tracks, and the client picks one. forked-daapd will use its database to find the file and stream it.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

delidave
Posts: 12
Joined: Wed Feb 20, 2013 7:20 pm

Re: forked-daapd with Remote 3.0 support

Tue Feb 26, 2013 5:58 pm

To get running:
Followed your code exactly at start of this topic.
Edited config file
Running.

The reason it didnt work first of all is because i left the proceeding / off of the library location.

I have just deleted my log and have restarted the pi and forked-daapd to generate a fresh one. I will post the log once it has finished generating. (lots of ffmpeg errors where scanning)

I have paired 1x ipad and 1x iphone with the library. Before i reset i had a disconnect on both devices when accessing at the same time with the remote app. The log didnt show anything of forked-daapd stopping but i lost all connection in itunes and on devices. Must of crashed. This is why i am running again. If you want any more info or specific requests then let me know.

Log currently set to info

delidave
Posts: 12
Joined: Wed Feb 20, 2013 7:20 pm

Re: forked-daapd with Remote 3.0 support

Tue Feb 26, 2013 6:07 pm

This is the majority of the log erro/information repeated over and over again:

[2013-02-26 17:39:53] ffmpeg: max_analyze_duration reached
[2013-02-26 17:39:53] ffmpeg: Estimating duration from bitrate, this may be inaccurate
[2013-02-26 17:39:55] db: No results
[2013-02-26 17:39:55] ffmpeg: max_analyze_duration reached
[2013-02-26 17:39:55] ffmpeg: Estimating duration from bitrate, this may be inaccurate
[2013-02-26 17:39:56] db: No results

User avatar
baal
Posts: 10
Joined: Sat Feb 09, 2013 4:37 pm
Location: Germany

Re: forked-daapd with Remote 3.0 support

Tue Feb 26, 2013 6:43 pm

Hm... ffmpeg... Do you have vids in your lib? Havn't tried this. Anyway: may be a problem with the ffmpeg lib... but why I hadn't got this error?

Actually I'm setting up a development workspace, so I'll be able to have look where this log message are created.

I noticed the problem with the two iDevices, too. By now I got no idea, what the problem is.

delidave
Posts: 12
Joined: Wed Feb 20, 2013 7:20 pm

Re: forked-daapd with Remote 3.0 support

Tue Feb 26, 2013 6:57 pm

no vids, only music, purposely removed them to get music working first off. videos i can handle with dlna as itunes does not support the .ts transport anyhow and you tend to only watch one film at once whereas the music i want playlists etc. I have done a little reading on the ffmpeg error and it seems that the daapd server is trying to calculate the length of the songs but is having difficulty for certain reasons; variable bitrates etc. how does itunes work out track length? because looking through, alot my songs definately have the wrong times listed, alot are 0:00.

delidave
Posts: 12
Joined: Wed Feb 20, 2013 7:20 pm

Re: forked-daapd with Remote 3.0 support

Tue Feb 26, 2013 7:00 pm

also now seen this in there:
[2013-02-26 18:29:55] ffmpeg: Format detected only with low score of 25, misdetection possible!
[2013-02-26 18:29:55] ffmpeg: max_analyze_duration reached
[2013-02-26 18:29:56] db: No results
[2013-02-26 18:29:58] ffmpeg: Format detected only with low score of 25, misdetection possible!
[2013-02-26 18:29:58] ffmpeg: max_analyze_duration reached
[2013-02-26 18:29:59] db: No results

Log file still growing aswell, now at 1.6mb and growing. 26000+ lines. im guessing, 3 lines for each song, 9600 songs in this db, it should finish shortly, otherwise my sd card is gonna get cramped :)

delidave
Posts: 12
Joined: Wed Feb 20, 2013 7:20 pm

Re: forked-daapd with Remote 3.0 support

Tue Feb 26, 2013 7:33 pm

baal you have email to send you the log as its far too big to paste and wont allow me to attach

User avatar
baal
Posts: 10
Joined: Sat Feb 09, 2013 4:37 pm
Location: Germany

Re: forked-daapd with Remote 3.0 support

Tue Feb 26, 2013 8:07 pm

You can send the log file to [email protected]

vof
Posts: 4
Joined: Fri Dec 23, 2011 10:28 pm

Re: forked-daapd with Remote 3.0 support

Sat Mar 02, 2013 10:19 pm

Great work! Had no problems after following instructions closely (though I do have a lot of previous experience of mt-daapd and forked-daapd on ubuntu).

pixel0p
Posts: 1
Joined: Mon Mar 04, 2013 8:50 pm

Re: forked-daapd with Remote 3.0 support

Mon Mar 04, 2013 9:06 pm

Hi there,
thanks a lot for providing those compiled packages, I tried to compile it myself but I failed.
Anyway, it works flawlessly with the remote app, but not for the daap sharing on Itunes, I get this weird http disconnect after 5 min., no matter if I am playing a song or just browsing the file list. I know that there used to be such a bug in the old versions of forked-daapd, but I thought It was fixed with 0.19, but maybe the newest Itunes broke this again, do you have any knowledge of that?

Greets,

PS: Itunes 11.0.2 on PoweBook (SL), raspberry pi latest rasbian.

User avatar
baal
Posts: 10
Joined: Sat Feb 09, 2013 4:37 pm
Location: Germany

Re: forked-daapd with Remote 3.0 support

Tue Mar 05, 2013 5:44 am

Hi pixel0p,

thanks for the feedback.
I haven't tried to use forked-daapd with iTunes yet, but I'll have a look at it.

Greets,
baal

***edit***
I also get the disconnect after 5 minutes using the latest iTunes on Win7. I'll try to fix it this weekend.

sjlgn
Posts: 1
Joined: Tue Mar 12, 2013 9:36 am

Re: forked-daapd with Remote 3.0 support

Tue Mar 12, 2013 9:46 am

I have a question. every 5 mins, forked-daapd will disconnected with iTunes.
Does anyone also see this issue?How can fix it?
Thank you!
forked-daap.log:
httpd: Found query string
daap: DAAP request: /update?session-id=100&revision-number=2&delta=2
db: DB pool status: size 4 free 4
db: DB pool status: reclaimed 2 size 2 free 2
httpd: Connection failed (fd 19)
-------------------------------------------------------------
when disconneted, it print "httpd: Connection failed (fd 19)".

Bierbauch
Posts: 2
Joined: Sun Mar 10, 2013 9:18 pm

Re: forked-daapd with Remote 3.0 support

Sat Mar 16, 2013 9:24 pm

Deutsch:
Hallo,
wollte mal fragen, gibt es was neues? ich habe auch das Problem das die Verbindung nach 5 Minuten abbricht und das bei der Remote App nach lied auswahl ich ein menü zurückgeschmissen werde. Ich habe hier https://github.com/jasonmc/forked-daapd ... a7319895ec was gefunden aber da verstehe ich gar nichts.

English:
Hello,
wanted to ask, is there anything new? I also have the problem that disconnects after 5 minutes and the Remote app for song selection, I threw back a menu will. I have found what https://github.com/jasonmc/forked-daapd ... a7319895ec but since I do not understand anything.

Bierbauch

Return to “Raspbian”