librespot-org / librespot

Open Source Spotify client library
MIT License
4.75k stars 588 forks source link

Create a fully featured daemon with ppa #20

Closed ComlOnline closed 3 years ago

ComlOnline commented 6 years ago

As has been discussed elsewhere. This is to continue discussion on the topic.

ComlOnline commented 6 years ago

@allquixotic:

I would ask to consider dropping the "lib" on "librespotd" to avoid confusion. "lib" always implies some kind of non-runnable component that software has to consume via code; the intent of "librespotd" is the opposite.

So, maybe respotd?

Or maybe not; now that I think about it, there's precedent for leaving the "lib" in there...

As far as package names, on Debian/Ubuntu at least, there's a reasonable precedent for having packages associated with the same project but with executables in a -bin package. So:

librespot-dev would provide the Rust libraries for building your own programs librespot-bin would provide the daemon. We could follow the model of libtool (libtool-bin) and libvirt (libvirt-bin) there. libtool keeps the lib on its main binary program; libvirt has libvirtd and virsh.

ComlOnline commented 6 years ago

As you later stipulated I don't think the lib is an issue see libreoffice

I am very reluctant to change the name of librespot even to librespot-dev.

However saying that having the names librespot and librespotd does leave us open for a lot of confusion. Do you know if this is an issue for libvirt?

sashahilton00 commented 6 years ago

librespot should not be renamed. I would just drop the lib since the daemon won't be a library, so it'd be called respotd

ComlOnline commented 6 years ago

The only thing I have against doing that (and its pedantic as all hell) is that I always read librespot as "libre" - "spot". The lib not meaning a library but libre meaning free.

But like I said that is rather pedantic so feel free to overrule me on that,

sashahilton00 commented 6 years ago

call it librespotd then? It shouldn't matter too much, since librespot won't be in a ppa

michaelherger commented 6 years ago

I still believe that the lib part doesn't come from library, but from libre (see https://wiki.snowdrift.coop/about/free-libre-open)

sashahilton00 commented 6 years ago

Call it whatever you want, I'm more interested in the functionality ;)

allquixotic commented 6 years ago

Agreed; the name of the daemon is less important... I think either respotd or librespotd is probably the most logical thing to call it. Now, a few things to consider (this is a sort of synthesis of some earlier thoughts, some new musings, and a sort of informal first cut at a design doc for the new daemon):

As far as the name, I've been just saying "the daemon". How about we just call it librespotd and call it a day?

Once folks active around this issue and the previous issue agree on a name, we can have Sasha at least create the repository for it in librespot-org.

allquixotic commented 6 years ago

In addition to all the above (sorry for the spam and multiple edits!), it just feels wrong to me to have any output code (like pulseaudio/portaudio support) baked into librespot. In my humble opinion, librespot's tasks should just be:

Basically, for good separation of concerns, the daemon should do all I/O except for communication with the Spotify servers. All data interactions baked into core librespot other than talking to Spotify should be through APIs in the code. Just my opinion.

So that would mean that we should grab the playback code and put it in the daemon.

plietar commented 6 years ago

The lib not meaning a library but libre meaning free.

That's the correct interpretation. The daemon should be called librespotd, not respotd

plietar commented 6 years ago

Also FWIW I had already started breaking up librespot into multiple crates (librespot-protocol, librespot-core, librespot-audio, librespot-metadata). The idea was to be able to write applications which depend on parts of librespot without pulling unnecessary dependencies.

The librespot crate contains everything which hasn't been broken up. The discovery, player and spirc code should probably become a new crate (or two/three), keymaster could be moved into core since it is small and doesn't have any dependencies. Whatever is left (not much) and src/main.rs forms the daemon.

I'm not really comfortable with putting the sink implementations in the daemon only, as it significantly raises the bar for other users of librespot Player. My pregerence would be to have them in librespot-player, but behind flags and disabled by default. librespotd would by default enable librespot-player/portaudio.

frafall commented 6 years ago

So, modify sink api to include metadata push, keep the sample sinks in library and export api to register new sinks? This would leave the library as-is, simple to start using, while enabling any new sink to be implemented.

sashahilton00 commented 6 years ago

I see no problem with leaving the existing audio logic in librespot, as it's already there, but I do think that we ought to implement the current audio logic in the daemon, and ensure that future sinks are added to the daemon, since we're just adding unnecessary bloat to librespot otherwise.

sashahilton00 commented 3 years ago

For anyone stumbling across this issue, https://github.com/Spotifyd/spotifyd is a good solution whilst librespot-daemon is non-existent.