So many features flags... #648
Replies: 9 comments 30 replies
-
With regards to the audio backends, answers may lie in the more general question "why would anyone use libraries over inter-process pipes?" I'd say libraries have the potential of offering higher performance, better error handling and more granular control, at the expense of larger code size, higher complexity and maintenance requirements. On the other hands, inter-process pipes offer a very simple interface, completely encapsulating backends. The downside is there can be hard-to-debug interfacing and timing issues, like the one you are working on I believe at #659. In particular for the ALSA backend there is the capability of doing volume control in hardware by ways of ALSA's mixer. That's one important advantage over using |
Beta Was this translation helpful? Give feedback.
-
To somewhat answer the question: Lewton was added as a pure rust alternative to the libvorbis bindings. The audio back ends are a bit of a mess. It is planned that someday librespot is separated properly into a library and a daemon, at which point all those back ends move to the daemon and the library just provides the PCM samples. Not sure why there are two dns-sd implementations, likely for cross compatibility. |
Beta Was this translation helpful? Give feedback.
-
Is it right that I also looked up the difference between vorbis and tremor: tremor seems to use fixed-point arithmetics, so it works better on devices without FPU than libvorbis. In #652 @leshow mentioned that features should be additive. Now since there's an There's no such abstraction for dns-sd (yet). It would be cool if libmdns had this abstraction, so you could use the daemon if possible and as fallback a tokio task. |
Beta Was this translation helpful? Give feedback.
-
@JasonLG1979 continuing from #660:
I'm tempted to say "exactly this". Myself, I'm new to this project and having a lot of fun hacking away at the backends. Really, I do. But what you'd really want is to have some sort of ownership over the backends. Now it seems like someone scratches an itch, prepares a PR (great!) and then pretty much leaves the burden of maintainership with the core team. That's not very sustainable and especially not for specialty cases. Now I'm really eager to get #660 going and who knows what the future holds. And by matter of principle I believe I should not cause regressions in what worked before. I'm even open to invest time in setting up JACK, PortAudio, GStreamer and what not just for the merits of cursory testing. Though personally, I'm an Alsa man and don't phanthom doing anything else for any number of years. Or: split the backends into a Tier 1 "core backends" owned by the core team, and a Tier 2 "specialty backend" with a dedicated maintainer. No maintainer? Backend goes into disrepair, it might function, it might not, but don't keep it from pushing new developments.
Not saying I don't agree with you but there's always arguments to be made.
I think Rodio became standard exactly to do away with all the individual backends and upkeep. Yet as I said elsewhere, I don't like that automagic stuff because when it doesn't work (like F32 on Alsa hosts) you're pretty much lost. Same could be said for GStreamer. TL;DR if you'd ask me, split backends into two tiers with "core, guaranteed, well-maintained" backends and another tier with "best-effort" backends. Stop doing CI on Tier 2. |
Beta Was this translation helpful? Give feedback.
-
I'd be more inclined to invest time if there was a clear path forward so that I don't end up doing a bunch of work that might not get merged, would make things easier to divvy up also. |
Beta Was this translation helpful? Give feedback.
-
The questions become:
There needs to be stated goals.
Basically they need to pick a potato and base decisions like the floating point math thing based on that potato. Like is anyone actually running librespot on a lower spec device than a Pi Zero?
One of the stated goals I hear over and over again is that they want to decouple the core from playback but they keep accepting new backends? I have some very limited experience maintaining a couple projects and in my experience you got to be able to say "no". |
Beta Was this translation helpful? Give feedback.
-
All these are valid points. Issues relating to the audio backends are the most common, and it's somewhat unsurprising given that a lot of them are, as you say, best effort.
👀... Not that I can remember. Essentially it been a pretty laid back approach to allowing audio backends to be added, primarily for 2 reasons:
This is ultimately what should happen. Ideally the daemon becomes the home for all of this audio processing, along with other features that could be considered 'bells and whistles'. Once this happens, we'll strip out all the backends from the core librespot library, and only support one officially, likely rodio. The main problem, as with so many things, is time. Unfortunately this project isn't really used 'in production' for anything, and thus there's a limited amount of time that is spent on maintaining it. Added to this, to a certain extent we are perpetually playing catchup; Spotify is changing its APIs from Hermes to gRPC/HTTP, and there are numerous features (eg. retrieving files from CDN and session reconnection) that have been outstanding for a while, but require a larger restructuring of the project.
I'm not sure this is the question. Librespot isn't trying to be a drop in replacement for libspotify, it merely occupies the same role in that it is a client library. All it is intended to do is provide a means to interface with Spotify, with the additional support for acting as a Spotify Connect receiver. The thing that would be 'trying to do more than that' would be the daemon, which is where additionl functionality would be added, such as an metadata/events server, multiple audio backends, multiroom synchronisation, etc. |
Beta Was this translation helpful? Give feedback.
-
The more I'm working on this, the more I'm starting to feel you guys @Johannesd3 and @JasonLG1979. I spent two nights to get PortAudio to work on #660 when I thought: is this working on Also I miss the point of having PortAudio in the first place. The purpose of which is cross-platform, portable audio. Isn't that what Rodio (or actually: cpal) is intended for? And offered by GStreamer as well? |
Beta Was this translation helpful? Give feedback.
-
vorbis/tremor is done now. What about dns-sd? As mentioned on gitter, I found a way to use Windows 10s native service discovery api. Would it be good enough to throws libmdns out? |
Beta Was this translation helpful? Give feedback.
-
Why does librespot provide three different vorbis decoders, two dns-sd libraries, and backends that could simply be replaced by using a pipe (like pulseaudio using
pacat
)? Is it worth the effort?Beta Was this translation helpful? Give feedback.
All reactions