-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: keepalive / timeout in forked-daapd.conf #19
Comments
This might require a client fix instead/as well. Could you ask Rhythmbox or Banshee if they make any attempt to tell the server they are still using the connection? |
I take your point, but FWIW iTunes exhibits the same behaviour. I get the feeling Apple would be less than accommodating. |
Should be fixed in forked-daapd v0.13 |
Hi everyone, I've tried with forked-daapd 0.14-1 and 0.15-1 on debian. The only message I see in forked-daapd log file is: |
ldesgrange is right. |
I wrote to Julien Blache (Forked-Daapd author) and he said that he is aware of the bug, but that he doesn't have time at this moment to resolve a bug that needs each time 30 minutes to reproduce. |
I did a tcpdump to check if something specific was happening. Here is what I did:
On the tcpdump I only see iTunes properly closing the connection: I don't know, maybe while connected iTunes is waiting for some "keep alive" messages (even while already playing music from the shared library). By the way I'm realizing that the problem we are discussing is a bit different from the original one (which I remember used to happen to me before I upgrade forked-daapd and get this disconnection instead), sorry for that. |
I am using forked 0.14 and see this problem with iTunes on both Windows and OS X. I do not see it with Rhythmbox on ubuntu. I rarely pause so have never seen it while paused. It always happens exactly 30 mins after starting to stream in iTunes. I can stream for hours with Rhythmbox. Log shows same basic message as others have reported. |
Updated to 0.16. Still has the same annoying problem. |
@bobcote: afaik forked-daapd is nearly not used in commercial NAS, most of them are using mt-daapd (which didn't had this timeout issue last time I used it). I'm afraid that we are not so many using it, forked-daapd is more of a "pet project" and I don't think there are enough contributors with enough time to tackle this problem quickly (considering that you need at least 30 minutes to test each time as you said earlier). If you have any knowledge to solve this problem I'm sure everybody here will be happy ;-). |
Maybe I'm wrong. I was with the impression that when last year iTunes 10 temporarily broke compatibility with mt-daapd/firelfy that QNAP and Synology had packaged Forked-Daapd as a solution, which could have lead to many people with the same problem we have here. But as I don't have those NAS (I have a D-Link DNS-323) and had this impression only by reading all the forum posts at those companies websites, I could possiibly be wrong indeed. I really thought Forked-daapd was more "serious" and was the de facto new daap server privileged by NAS makers. |
I don't know, maybe you are right, but since Apple released a fixed version of iTunes 10 quite quickly I thought NAS makers didn't switched to forked-daapd, maybe if they did, at that time forked-daapd didn't had this issue either and they are still using that old version… I haven't seen people complaining about this bug on NAS (but I had only a quick look so maybe you have found some). Could be interesting to know how many NAS makers use forked-daapd by default or if they provide it as an alternative DAAP server only). |
I have a QNAP NAS that I'm running this on and it came with mt-daapd. I had to replace that with forked-daapd. I'm having this same problem, however. Exactly at the 30 minute mark iTunes drops the connection. I didn't have this problem with mt-daapd and I don't have the problem when playing through the Remote app. I found a tweet from February by someone who was looking into the problem and he found a hardcoded maximum in a file. He said he'd provide more details so hopefully that will help solve this issue. |
I confirm this problem still exists in forked-daapd 0.18. iTunes 9.2.1 closes the connection exactly 30 minutes after connecting, regardless of activity. (i.e. I can be playing a song or paused during the 30 minutes, it doesn't matter) |
Good job CBGoodBuddy! |
Great work! It doesn't seem to be completely fixed though. |
Well, that's frustrating. Sadly, I can't replicate the problem with iTunes 9 or 10. Can you tell if the time out is 30 minutes or 25 minutes? The new code ensures that iTunes gets some kind of activity at least every 25 minutes, but maybe that's too infrequent. (one possibility is something else is timing out, like your router) If you have access to the code, it may be worth trying to change http_daapd.c line 64, I don't know what the real iTunes does.... |
Rather than time the 25 minutes, I changed the line. First to 60, then to 120. I don't have a lion/10.4 machine myself, but I'm going to have someone try that as well. |
OK, that's pretty weird. I'm not sure why forced activity would force-close the connection. I checked mt-daapd which uses exactly the same method (except 30 second time-outs). I tested iTunes 9.2.1 and 10.4 on Snow Leopard. I don't have access to Lion yet. Sounds like there is some new behavior in Lion. Could you try a 30 second time-out just to see if that improves things? Also, if you can enable debug mode, that might give a little more information about the transactions. But, you will want to operate on a reduced music library, otherwise you will be overwhelmed with debug statements. (I usually test in debug mode with a different config file that points to a single album) |
I'll try the debug thing later, but I do have some new info, tried both 30 and 20 second timeouts and they fail. |
It would be disappointing if the new version of iTunes changes the protocol, but I guess it wouldn't be the first time. |
I had this problem too; I solved it by removing some changes made in c70caad; also, I disabled autologout by setting the value for "msal" to 0. Try this patch against head: diff --git a/src/httpd_daap.c b/src/httpd_daap.c -#if 0
dmap_add_char(evbuf, "mslr", 1); /* 9 / |
unsynchronized: Some further experiments showed iTunes ejecting when the forced update message was sent. I assumed it might have something to do with the new == old rev id on the iTunes side, so I added some hacky code to ensure it never sends a forced update with both being equal to the update method. And it seems to work. The library both auto updates and doesn't eject after either the update or the session timeout in iTunes 10.5. Code I used: Insert
On line 857 of httpd_daap.c
|
Should be fixed in v0.19 |
Updated my box with 0.19, iTunes was not disconnected in the last few hours. Congrats guys! Thank you very much. |
It's still working on my box, auto-update is working too. |
Running 0.19 vanilla, just checked out a fresh copy. iTunes 10.4.1 works like a charm (though I am not seeing autoupdates), 10.5 still disconnects every 5 minutes, regardless of the value of 'msal'. So, does not work for me. |
Ditto here. It looks like the timed update response sent by update_refresh_cb() isn't making it very happy. Two quick hacky fixes that worked for me are:
Using #2 now; no problems yet, and updates seem to work; no long-term tests yet. Issue #70 (#70) argues that the number should increment whenever we see a directory rev change; this makes sense to me, as a long-term fix. |
I've had this problem for a while now, and I tried applying fix #2 to the GCD version of 0.19. |
You folks are right. Something has changed about iTunes 10.5: it rejects "update" notifcations that 10.4 does not. If you update the db_rev each cycle, then you will incur the penalty of iTunes re-downloading your entire music library every so often, which is not optimal and terrible for mobile use. Someone needs to understand better what iTunes needs as a response. |
@lpar: strange, register_ffmpeg_evbuffer_url_protocol is part of the distribution, in src/ffmpeg_url_evbuffer.c. It shouldn't have flagged as a linking error unless you also had a compilation error. @pcace: in August I filed a patch to do automatic updating, but the maintainer did not accept it. From what I can tell, neither of the new releases from September (0.19 nor 0.19gcd) has the capability to do automatic updating, so I'm kind of surprised that you were enjoying it. The easiest workaround is to disconnect and reconnect to your iTunes server. New library additions should appear then. |
@CBGoodBuddy: i know! I used your patch to have automatic updating enabled.... |
From the configure script, it looks like the code switches from using ffmpeg for evbuffers to using libavformat if libavformat is new enough. Unfortunately this isn't working properly, and src/ffmpeg_url_evbuffer.c isn't getting compiled and linked in if libavformat's major version is < 53. I tested by downloading and compiling libav 0.7, and with that, the build process worked fine. |
@CBGoodBuddy This fix works! Thanks alot! If you want to have a test environment to test gcd etc I can provide you with a VM to do so, I've compiled it on that VM. You can even listen to the server if you use openvpn (it's configured to send broadcasts). Thanks! Bernard |
@BernardV thanks for your offer, that's very kind and I appreciate it. Unfortunately one of my stumbling blocks is that the new "GCD" version is actually written in a new dialect of the C programming language and I don't quite understand how it works. It's all very cutting edge, but unfortunately I have a masters degree in keepin' it old style. That, plus my real life is intruding for a while. I'll keep your kind offer in mind. |
Would there be interest in a virtualbox image with both the latest git version compiled and the iTunes fix version compiled? |
Just FYI - for Ubuntu 11.10 users, all you have to do is download the Ubuntu source package, replace src/httpd_daap.c with the @CBGoodBuddy 's patched version of the file, and do the package rebuild. A good how-to for this is http://www.cyberciti.biz/faq/rebuilding-ubuntu-debian-linux-binary-package/ |
@CBGoodBuddy @markgsd |
Craig, great work on this fix. For anyone who's interested, I ported the changes to the GCD version, and it seems to be working for me. Any feedback is appreciated! |
@kekiefer well done! Be sure to forward your patch information to Julien Blache so that (hopefully!) he can put it in the next release. |
Hmm again i do not understand so well what im doing to install this patch... Thanks, Pcace EDIT: i also tried to clone https://github.com/kekiefer/forked-daapd.git and make this: the result is a forked-daapd version where i cannot skip in tracks... |
Hmm i still cannot get the GCD to work properly, can anyone again please help out ;) ? When i compile the kekiefer version, there is no possiblility to skip in tracks... Ideas? Pcace |
Thanks for the feedback, @pcace, sounds like I may have missed something. Can someone confirm if track scrubbing works in @CBGoodBuddy's fix? |
yes, in CBGoodBuddy's fix it works perfectly! any news? Pcace |
Is it working at your machine? Whats wrong then there? is it working somewhere else? |
Please can someone make a .dpkg I can't compile this.. My Debian installation just xxx with me so I just beg for a dpkg to install with instead... |
http://ath0.com/forked_daapd-2_amd64.deb 6fff33ec0b756fa50fdf321949f7abb3 forked_daapd-2_amd64.deb Note that this was made using checkinstall and I think it's missing the /etc/init.d script. |
Any chance to have this *.deb for a 32 bit system? |
Not from me, unless there's some configuration option I'm unfamiliar with. My Debian system is pure 64 bit. Sorry. |
Hmm ok no problem, but can you tell me which version this is exactly? Thanks |
commit f7d7dfc of branch nongcd of http://anonscm.debian.org/git/users/jblache/forked-daapd.git And a quick test reveals that skipping in tracks works for me. |
Hi all, P.S. UPDATE (24/03/2012 23:51): http://www.gieffe.name/download/forked-daapd_0.19-1ubuntu1_i386.deb |
Hey, this is really wonderfull! is there any chance that someone could compile a 0.19 GCD version of forked-daapd? Thanks, Pcace |
Yeah, my build dies after a few minutes, so I guess I'm missing a patch. A current working commit reference would be appreciated. |
Here's a build for debian testing: http://www.mmacleod.ca/files/forked-daapd_0.19gcd-2_amd64.deb And also what I did to make it work: http://www.mmacleod.ca/blog/2012/05/patching-forked-daapd-so-it-actually-works/ Now if only forked-daapd wouldn't disappear as soon as I enable IPv6 on my workstation... |
And can you skip in tracks? Thanks, |
Huh, I cannot skip in tracks. Dunno about auto updating. All I can say with certainty is that it doesn't disconnect after 5 minuters, which is more than I had before. |
Just thought i'd comment and say that using a Raspberry Pi, elwertk's instructions at #19 (comment) fixed the timeout problem. I have ended up with a rather large installed package list and to be honest i'm not sure why my most recent try worked when my previous ones didn't but in the end I got there. I think I am able to skip songs and am unsure about whether it is auto-updating but it will stay connected. Thanks to all of you for working hard to get this working! And particular thanks to elwertk and CBGoodBuddy! :) |
I had the 5 minute timeout issue myself; running Ubuntu 11.10 Server. Then I removed libevent-2.0.5 and replaced it with libevent-1.4-2 (libevent-core, libevent-dev, libevent-extra), I had to download the .debs from an older version of Ubuntu. This instantly broke transmission-daemon. I use Deluge now. Then I built against the older libevent and it worked. Thanks CBGoodBuddy for your patch! |
Hey, i solved the 5 min bug, thanks to @CBGoodBuddy BUT i still cannot skip in every track: only tracks converted with VBR are able to skip... in Mp3s with CBR i cannot skip. Has anyone an idea how to solve that? Thanks |
After a certain length of time (30 minutes or so, I think), a DAAP stream will time out. For example, pause a stream playing via Rhythmbox or Banshee. Attempt to resume playback 30 minutes later. It will fail. The only way to resume playback is to disconnect from the DAAP server and reconnect. At that point, the prior playback position has been lost.
Is it possible to add a keepalive or timeout that could be controlled via a parameter in forked-daapd.conf?
The text was updated successfully, but these errors were encountered: