plietar / librespot

Open Source Spotify client library
MIT License
1.13k stars 187 forks source link

add gstreamer as audio backend #60

Open psych0d0g opened 8 years ago

psych0d0g commented 8 years ago

https://github.com/arturoc/gstreamer1.0-rs

Since portaudio has some bugs on mipsel i would like to request the addition of gstreamer,

Pros: LGPL lib. X-Platform: Linux, Android, Windows, Max OS X, iOS, as well as most BSDs, commercial Unixes, Solaris, and Symbian X-Architecture: x86, ARM, MIPS, SPARC and PowerPC, on 32-bit as well as 64-bit, and little endian or big endian Complete debugging system for both core and plugin/app developers

List of applications gstreamer is used in: https://gstreamer.freedesktop.org/apps/

And now: Open for discussion :)

plietar commented 8 years ago

GStreamer is a powerful but pretty big dependency, both in terms of size and complexity. I'd rather avoid it if possible. Nevertheless, I've refactored the Audio Output code to use a Sink trait. This makes it easier to add new backends for different platforms. There's an initial ALSA implementation on the alsa branch. It is only used on linux, other platforms still use portaudio.

joerg-krause commented 8 years ago

It's good news that you add an audio backend. Gstreamer is not applicable for low-end embedded devices, but I am glad about the ALSA implementation. I'd like to give it a try.

psych0d0g commented 8 years ago

@joerg-krause what is a low-end embedded device by your definition? for me my VU+ Ultimo applies as one (400mhz mips dualcode sock) and all of its multimedia features are based on gstreamer, which works just fine here.

joerg-krause commented 8 years ago

@psych0d0g I mean something like the Carambola 2 with 16 MB Flash and 64 MB RAM.

psych0d0g commented 8 years ago

well now with the sink api i would vote for gstreamer as additional sink backend

psych0d0g commented 8 years ago

so now after some more research from my side: this is an example pipeline that works on enigma2 mipsel: gst-launch-1.0 -v -m audiotestsrc ! audioconvert ! dvbaudiosink

the issues im facing are not mipsel specific but completely enigma2 specific. I would like to have a feature switch introduced: --with-features enigma2 which enables the audio output via gstreamer on compile time.

psych0d0g commented 8 years ago

i pushed my work so far here: https://github.com/psych0d0g/librespot/tree/alsa the build switch is working, aswell as the inclusiong of gstreamer rust bindings. whats not working is the gstreamer audio backend itself so far. i cant figure out what needs to be returned from the gstreamer function in order to accept audio data

psych0d0g commented 8 years ago

so with a little help from @plietar and https://github.com/astro , there is now a basic working gstreamer branch: https://github.com/plietar/librespot/tree/gst compile with --features enigma2 for now

plietar commented 8 years ago

See my comment there https://github.com/plietar/librespot/issues/63#issuecomment-198417728 This will have to wait until I reorganise the audio backends