plietar / librespot

Open Source Spotify client library
MIT License
1.14k stars 185 forks source link

LibreELEC addon #186

Closed awiouy closed 7 years ago

awiouy commented 7 years ago

Hello, @shanemeagher and I are trying to create a librespot addon for LibreELEC. I open this pull request to document this effort and to request help.

This pull request currently includes two commits:

The with-audiocache commit is welcome on LibreELEC, whose storage is mainly flash based. The dns-sd commit works, although libdns_sd is not linked statically into librespot.

I built librespot with docker run -v /tmp/librespot-build:/build --env PKG_CONFIG_ALLOW_CROSS=0 --env PKG_CONFIG_ALL_STATIC=1 --env PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features alsa-backend Then I fetched libdns_sd.so with docker run -v /tmp/librespot-build:/build --env PKG_CONFIG_ALLOW_CROSS=0 --env PKG_CONFIG_ALL_STATIC=1 --env PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig librespot-cross cp /usr/lib/arm-linux-gnueabihf/libdns_sd.so.1 /build After copying librespot and libdns_sd.so.1 to LibreELEC for RPi2, I succesfull ran LD_LIBRARY_PATH=. ./librespot -b 320 -c ./cache -n test

So here are my questions/requests:

Thank you in advance for your support and regards.

plietar commented 7 years ago

Thanks, My main concern with #181 (with-audiocache) is that is should be a runtime setting, not compile time. Sorry @michaelherger / @mherger (I'm guessing that's the same person), I completely forgot to comment back on that PR.

About dns-sd, I originally removed it because

If it's a disabled by default dependency then I'm fine adding support for it, but rust-mdns must still exist as a fallback.

One a side note, this might interest you : https://github.com/plietar/python-librespot It's a very basic python wrapper around librespot. You could use it to run librespot directly in your plugin, and offer tighter integration. But it would need a lot of work (including documentation) first.

awiouy commented 7 years ago

Thank you @plietar for your reply My skills with Rust are however very limited (I discovered Rust around May, 9). I will leave it at that, in the hope that someone here (@shanemeagher, @joerg-krause, @michaelherger, you?) will be able to split the code in default mdns and optional avahi.

shanemeagher commented 7 years ago

@plietar @awiouy I've created a commit (f2bee4f87138b9cdd62133f4ddf0bd1bdc76f568) for optionally using dns-sd instead of rust-mdns. rust-mdns (--with-rust-mdns) is the default for discovery, while librespot can be built with dns-sd using --with-avahi switch.

awiouy commented 7 years ago

Great! I will update this pull request this week-end. Thanks @shanemeagher

awiouy commented 7 years ago

Rebased to merely add docker-build-libreelec.sh

awiouy commented 7 years ago

Closing this PR, since librespot can now be built with the LibreELEC toolchain (https://github.com/LibreELEC/LibreELEC.tv/pull/1622)