owntone / owntone-server

Linux/FreeBSD DAAP (iTunes) and MPD audio server with support for AirPlay 1 and 2 speakers (multiroom), Apple Remote (and compatibles), Chromecast, Spotify and internet radio.
https://owntone.github.io/owntone-server
GNU General Public License v2.0
2.04k stars 234 forks source link

Support creating multiple shares? #133

Open ghost opened 9 years ago

ghost commented 9 years ago

I've noticed that especially large libraries simply fail to load (or slow down the client machine incredibly) when attempting to on very resource constrained machines. Therefore I'd like to break up my library into multiple shares like "A-E", "F-J", etc. It would be nice if forked-daapd could somehow support this under one config file. :)

ejurgensen commented 9 years ago

I'm not sure that can be done. How large a library do you mean? Which platform is it?

ghost commented 9 years ago

A more practical way to look at this is maybe I want shares like "Music", "Lectures", "Podcasts"

Yeah I wasn't sure if it would be possible or not. It could be done manually now by creating multiple instances of forked with unique config files, but I thought there might be a cleaner way. Older OSX computers w/ 512MB to 1GB RAM are the clients (but I have had problems on other low resource devices too).

ejurgensen commented 9 years ago

The DAAP protocol does have the concept of databases, and while I don't think custom shares can be created that way, it might be possible to reduce the load of each request by splitting a large library across multiple DAAP databases. You didn't say how large your library was (number of tracks)?

You should also mention what exactly you do when it slows down. If you are connecting with a client like remote, caching is turned on, and it is not the very first connection, then forked-daapd should do no data processing except sending the raw data of the cached reply.

jkiddo commented 9 years ago

Some old but AFAIK still valid documentation on DAAP: https://github.com/jkiddo/jolivia/blob/master/DAAP%2BLibrary%2Bstructure.pdf

ejurgensen commented 9 years ago

Good info, thanks. Does it still apply that iTunes only supports one database?

jkiddo commented 9 years ago

iTunes actually supports multiple databases - they can be found @ host:3689/databases?session-id='sessionid'

Each database will have a type specified by the chunk mdbk (when querying with DACP as parameter, its long name is dmap.databasesharetype). Known values are 0x01 (local database - this is standard), 0x02 (shared database e.g another daap share) and 0x64 (Internet Radio). So AFAIK, the doc I posted is still valid