mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #258] Compile for arm6l #174
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#174
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @moodeaudio on GitHub (Oct 31, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/258
Hi,
I'm seeing "Illegal instruction" when running librespot on a 0W.
My compile procedure is below and its run it on a 3B+
sudo apt-get -y install portaudio19-dev
cd ~
git clone https://github.com/librespot-org/librespot
curl https://sh.rustup.rs -sSf | sh
NOTE: choose 1
sudo reboot
cd librespot/
cargo build --release --features alsa-backend
sudo cp target/release/librespot /usr/local/bin
Is there a cargo param for arm6l, or possibly does it need to be compiled directly on arm6l ??
-Tim
@ashthespy commented on GitHub (Oct 31, 2018):
I reckon you mean the Raspberry pi ZeroW?
With the steps you outlined above, you built it for the host processor of your device (3B+).
For the pi0, since it supports hard float, you can use the docker image to cross compile for it with:
@moodeaudio commented on GitHub (Oct 31, 2018):
Thanks and yes, the armv6l Pi's (1B, Zero and Zero W).
I assume that end result is separate binaries, one for armv7l and another for armv6l, correct?
@kingosticks commented on GitHub (Oct 31, 2018):
The armv6 binary will work on all flavours of raspberry pi. In the same way that the foundation's raspbian does.
@moodeaudio commented on GitHub (Oct 31, 2018):
I did not know that :-0
Just performed a quick test using a librespot binary that was compiled on a Pi-ZeroW (armv6l) and indeed it runs perfectly on a Pi-3B+ :-) I suppose I should investigate the cross-compile since the little Zero W took all day to make librespot!
How are the build params specified in the docker cmd below? Just tack them on the end?
--release --features alsa-backend
docker run -v /tmp/librespot-build:/build librespot-cross contrib/docker-build-pi-armv6hf.sh
@ashthespy commented on GitHub (Oct 31, 2018):
@moodeaudio The docker image uses the foundations tool chain to build an armv6 binary with floating point support.
For your second question - I see that I have hard-coded the back-end, but it should be easy to edit it to pass in additional parameters to cargo.
@moodeaudio commented on GitHub (Oct 31, 2018):
Cool.
Is there a particular version of docker thats required?
I'm seeing version 1.5 in the the Stretch repo.
pi@rp3:/usr/local/bin $ sudo apt-get -s install docker
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
docker
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst docker (1.5-1 Raspbian:stable [armhf])
Conf docker (1.5-1 Raspbian:stable [armhf])
@ashthespy commented on GitHub (Oct 31, 2018):
Hmm - I see your running this all from the pi3 - then I think
curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.shgets you docker on the pi3 (with Raspbian).else you need to follow the steps to add the key of the docker repo and install
docker-ceBut if you ask me, I would directly cross compile from the pi3 rather than go through the docker route on that device.
@moodeaudio commented on GitHub (Oct 31, 2018):
Thats what I would like to do, x-compile using the 3B+ and generate the armv6l binary which will work equally well on arm6 or 7.
But I don't have any experience with docker, cargo, rust etc., and so I'm having a bit of a time understanding the recipe.
So far, if I understand correctly
curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
docker build -t librespot-cross -f contrib/Dockerfile .
docker run -v /tmp/librespot-build:/build librespot-cross contrib/docker-build-pi-armv6hf.sh
And since the script "docker-build-pi-armv6hf.sh" has alsa-backend hard coded I should be god-to-go ?
@ashthespy commented on GitHub (Oct 31, 2018):
With the docker image, you could build
librespotfrom yourx86_64machine in a few minutes.I have never tired it on the pi3 - but it should be along these lines:
@moodeaudio commented on GitHub (Nov 1, 2018):
Thanks, I'll give it a try in the coming days :-)