Craig Markwardt <craig.markwardt@gmail.com> found out that the 30-minute
timeout in iTunes was caused by the lack of reply to update requests.
We now send out replies every 5 minutes, avoiding the timeout and
disconnection.
Thanks to Craig for digging into this, producing code to demonstrate the fix
and trying out a few more ideas for update support beyond this fix.
SQLite has trouble optimizing the query when written with JOIN, but does
pretty well using the indexes when written without JOIN. Add an index for
the query, too.
An index on songalbumid helps for joins on songalbumid on the files table; a
covering index on disabled+media_kind+songalbumid helps in numerous queries
all over the place.
Modifications to db.c to enable the DAAP server to determine when
the media library has changed, and notify clients via an update.
Updates should show up to clients within 10 seconds.
Tested on iTunes 9.2.1
httpd_daap now responds to client "update" requests. Previously,
these requests were queued without response, and the client
closed the control session after 30 minutes of inactivity. This
modification pushes out an update response when a new database
revision becomes available, or 25 minutes, whichever comes sooner.
This change set does not monitor the database state, so dynamic
updates to a library listing do not occur. What you see at login
to the server is what you get.
Tested against iTunes 9.2.1; a connection stays up for hours,
regardless whether a song is being played or not.
In some complex ALSA setups, using PCM or Master is not the right thing
to do, so allow a custom mixer element name to be specified in the config
file for this use case.
Request and initial patch by Kurt Vanderlinden <kurt.vanderlinden@skynet.be>.
Pointed out by Raivo Hool; since we don't have a choice of performing or
not performing the metadata conversion, we will get "disc/totaldisc" for
ID3 files.