-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
does not start on raspberry pi 3 b+ with latest raspberry pi os 64 bit #1053
Comments
Hi! I have not much experience in this matter, but I found out that only the Apart from that, I don't know how feasible it is in general to execute binaries compiled for Hope this helps! |
Hello, here i found the same problem, i wasn't able to do so, downloaded spotifyd but "nothing" happens when running: spotifyd --no-daemon I "solved" this by doing the following: Compiled it with aarch64 (arm64v8), in a RPI 3 model B, OS release Debian GNU/Linux 11 (bullseye). If need to, you may try the following: Important notes: It takes some time Installation of dependecies / libraries
Increase for Swap Memory, needs to reboot after done
To compileInside source folder, it was used the following command, not checked about PKG_CONFIG_PATH, but it was compiling:
To follow the log outputThe process may get some time to be done, it can be checked log.txt, inside source folder, to know what is happening, using: After compiledExecutable can be found on: It was used this following links to specify the configuration on "/home/pi/.config/spotifyd/spotifyd.conf", of how it should start, and audio device to play sound: Others informationsIt was used the following url to get some ideas of how do some parts: https://github.com/Spotifyd/spotifyd/wiki/Cross-Compiling-on-Ubuntu Good lucky. |
Thanks @waldeckmatheus, I'll have to try that. I'd been hoping that by the time I moved to Bullseye, there'd be AArch64 binaries available. But I forgot to check before I upgraded yesterday. I also haven't had any luck with cross-compiling. Spotifyd does have a cross-compilation guide, but to be honest it's really just a generic Rust cross-compilation guide. |
Tried following your inctructions on my RPi4 running Ubuntu 22.04 but ended up with this:
I'm not competent to take this further I think |
@HonestJohn61, see #1123 for this problem and a workaround. |
Hi @georgefst @HonestJohn61 @eladyn I saw today the message and tried to compile again, after a long time since my last try to compile it by raspberry pi (without cross compiling). Some points.
|
Thanks @eladyn - that resolved the issue for me. |
Thanks for the reply @waldeckmatheus. I'd already successfully compiled following your original post with the workaround suggested by @eladyn. BTW the compiling process didn't take too long or overheat my RPi4 (passively cooled in an aluminium heatsink case). |
FROM debian:latest
#if you run it on host, make a backup to restore later.
RUN cat /dev/null > /etc/apt/sources.list
RUN echo 'deb [arch=amd64,arm64] http://deb.debian.org/debian bullseye main' >> /etc/apt/sources.list
RUN echo 'deb [arch=amd64,arm64] http://deb.debian.org/debian-security bullseye-security main' >> /etc/apt/sources.list
RUN echo 'deb [arch=amd64,arm64] http://deb.debian.org/debian bullseye-updates main' >> /etc/apt/sources.list
RUN apt update
RUN apt install gcc make gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu git curl pkg-config -y
RUN apt purge rustc -y
RUN echo "(curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path)" > /install-rust.sh && \
chmod 755 /install-rust.sh && \
/install-rust.sh
RUN chmod a+x /root/.cargo/env && \
/bin/sh -c /root/.cargo/env && \
/root/.cargo/bin/rustup default 1.62.1
RUN /root/.cargo/bin/rustup target add aarch64-unknown-linux-gnu
RUN echo '[target.aarch64-unknown-linux-gnu]' >> /root/.cargo/config
RUN echo 'linker="aarch64-linux-gnu-gcc"' >> /root/.cargo/config
RUN dpkg --add-architecture arm64
#RUN apt install crossbuild-essential-arm64 -y
RUN apt install libasound2-dev:arm64 libssl-dev:arm64 libpulse-dev:arm64 libdbus-1-dev:arm64 -y
RUN apt install libasound2-dev portaudio19-dev build-essential libpulse-dev libdbus-1-dev libssl-dev libudev-dev -y
RUN cd /root/ && git clone https://github.com/Spotifyd/spotifyd.git
RUN /bin/bash -c "source /root/.cargo/env \
&& cd /root/spotifyd/ \
&& PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig PKG_CONFIG_ALLOW_CROSS=1 cargo build --target=aarch64-unknown-linux-gnu --release " |
Hi, As I mentioned above, spotifyd is now running fine thanks to @waldeckmatheus and @eladyn. However, spotifyd doesn't register with playerctl, and I understand this may be to do with the dbus_mpris flag not being set when the binary was compiled. Does that sound right? How would I change the instructions I followed to address this issue? From what I've read I may also need dbus_keyring too, despite running spotifyd without credentials so as to allow guest users. I should also mention that it runs headless. Thanks |
@HonestJohn61 You're right that you'll need to enable the Getting MPRIS to work on a headless system is not that easy, however. I should probably add a documentation page for that sometime. 😅 Hope you get it to work with that configuration! |
@waldeckmatheus Thanks! That worked for me ( I put that in to a file called sudo docker build -t spotifyd-pi-aarch64 .
sudo docker save spotifyd-pi-aarch64 -o dist.tar
sudo chown gthomas dist.tar
tar xf dist.tar
cd a30c4ac40e5a5bfee7cce225b2f25edc20d660a8469035ac5c4c9d316342409e # found by searching the JSON files for "spotifyd"
tar xf layer.tar
scp root/spotifyd/target/aarch64-unknown-linux-gnu/release/spotifyd pi:. |
@georgefst Hi. Thank you for your reply. Here i found another way, may it apply.
It's an awesome tool: https://docs.docker.com/get-started/ |
The Dockerfile above worked for me for Spotifyd 0.3.4. I added So I've taken a totally different path for now. Since I already had Nix installed on my RPi, I just ran |
Hi @georgefst
FROM debian:latest
#if you run it on host, make a backup to restore later.
RUN cat /dev/null > /etc/apt/sources.list
RUN echo 'deb [arch=amd64,arm64] http://deb.debian.org/debian bullseye main' >> /etc/apt/sources.list
RUN echo 'deb [arch=amd64,arm64] http://deb.debian.org/debian-security bullseye-security main' >> /etc/apt/sources.list
RUN echo 'deb [arch=amd64,arm64] http://deb.debian.org/debian bullseye-updates main' >> /etc/apt/sources.list
RUN apt update
RUN apt install gcc make gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu git curl pkg-config -y
RUN apt purge rustc -y
RUN echo "(curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path)" > /install-rust.sh && \
chmod 755 /install-rust.sh && \
/install-rust.sh
#v0.3.3 and v0.3.4: rustc 1.62.1
#v0.3.5: rustc 1.64.0
RUN chmod a+x /root/.cargo/env && \
/bin/sh -c /root/.cargo/env && \
/root/.cargo/bin/rustup default 1.64.0
RUN /root/.cargo/bin/rustup target add aarch64-unknown-linux-gnu
RUN echo '[target.aarch64-unknown-linux-gnu]' >> /root/.cargo/config
RUN echo 'linker="aarch64-linux-gnu-gcc"' >> /root/.cargo/config
RUN dpkg --add-architecture arm64
#RUN apt install crossbuild-essential-arm64 -y
RUN apt install libasound2-dev:arm64 libssl-dev:arm64 libpulse-dev:arm64 libdbus-1-dev:arm64 -y
RUN apt install libasound2-dev portaudio19-dev build-essential libpulse-dev libdbus-1-dev libssl-dev libudev-dev -y
RUN cd /root/ && git clone https://github.com/Spotifyd/spotifyd.git
RUN /bin/bash -c "source /root/.cargo/env \
&& cd /root/spotifyd/ \
&& PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig PKG_CONFIG_ALLOW_CROSS=1 cargo build --target=aarch64-unknown-linux-gnu --release --features dbus_mpris" |
Unfortunately those are the same modifications I made, and I hit:
I have no idea what's causing that. This imperfect reproducibility is one of the major reasons I prefer Nix over Docker for this sort of thing. |
@waldeckmatheus used your latest docker build script and the compiled image resulted in the following error when executing on a Running ./spotifyd: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./spotifyd)
./spotifyd: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./spotifyd)
./spotifyd: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./spotifyd) Running: Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libc6 is already the newest version (2.31-13+rpt2+rpi1+deb11u5). Any idea how to fix this to use the |
Got it working by changing the Dockerfile like this:
FROM debian:latest
#if you run it on host, make a backup to restore later.
RUN cat /dev/null > /etc/apt/sources.list
RUN echo 'deb [arch=amd64,arm64] http://deb.debian.org/debian bullseye main' >> /etc/apt/sources.list
RUN echo 'deb [arch=amd64,arm64] http://deb.debian.org/debian-security bullseye-security main' >> /etc/apt/sources.list
RUN echo 'deb [arch=amd64,arm64] http://deb.debian.org/debian bullseye-updates main' >> /etc/apt/sources.list
RUN apt update
RUN apt install gcc make gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu git curl pkg-config -y
RUN apt purge rustc -y
RUN echo "(curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path)" > /install-rust.sh && \
chmod 755 /install-rust.sh && \
/install-rust.sh
#v0.3.3 and v0.3.4: rustc 1.62.1
#v0.3.5: rustc 1.64.0
RUN chmod a+x /root/.cargo/env && \
/bin/sh -c /root/.cargo/env && \
/root/.cargo/bin/rustup default 1.64.0
RUN /root/.cargo/bin/rustup target add aarch64-unknown-linux-gnu
RUN echo '[target.aarch64-unknown-linux-gnu]' >> /root/.cargo/config
RUN echo 'linker="aarch64-linux-gnu-gcc"' >> /root/.cargo/config
RUN dpkg --add-architecture arm64
#RUN apt install crossbuild-essential-arm64 -y
RUN apt install libasound2-dev:arm64 libssl-dev:arm64 libpulse-dev:arm64 libdbus-1-dev:arm64 -y
RUN apt install libasound2-dev portaudio19-dev build-essential libpulse-dev libdbus-1-dev libssl-dev libudev-dev -y
RUN cd /root/ && git clone https://github.com/Spotifyd/spotifyd.git
RUN /bin/bash -c "source /root/.cargo/env \
&& cd /root/spotifyd/ \
&& PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig PKG_CONFIG_ALLOW_CROSS=1 cargo build --target=aarch64-unknown-linux-gnu --release --features dbus_mpris" |
Cross Build using docker on every platform and OS:
docker buildx create \
--name container-builder \
--driver docker-container \
--use --bootstrap
services:
build-container:
image: rust:1.79-bookworm
platform: linux/arm64
command: bash -c "
apt-get update &&
apt-get install -y \
libasound2-dev \
libssl-dev \
pkg-config &&
curl -sSL https://api.github.com/repos/Spotifyd/spotifyd/tarball/v0.3.5 | tar xz -C /spotifyd --strip-components=1 &&
cargo build --release &&
cp /spotifyd/target/release/spotifyd /build/"
working_dir: /spotifyd
volumes:
- ./:/build This will copy the build |
Add documentation for e.g. building arm64 as described in Spotifyd#1053
Add documentation for e.g. building arm64 as described in Spotifyd#1053
using systemctl --user start spotifyd.service does nothing
starting spotifyd with ./spotifyd --no-daemon I get ./spotifyd: error while loading shared libraries: libsystemd.so.0: cannot open shared object file: No such file or directory
checking to see if that file exists says the one for aarch64 is there but the one for armhf is missing
pi@raspberry-pi:~ $ ls -l /lib/aarch64-linux-gnu/libsystemd.so.0*
lrwxrwxrwx 1 root root 20 Jul 13 2021 /lib/aarch64-linux-gnu/libsystemd.so.0 -> libsystemd.so.0.30.0
-rw-r--r-- 1 root root 742816 Jul 13 2021 /lib/aarch64-linux-gnu/libsystemd.so.0.30.0
pi@raspberry-pi:~ $ ls -l /lib/arm-linux-gnueabihf/libsystemd.so.0*
ls: cannot access '/lib/arm-linux-gnueabihf/libsystemd.so.0*': No such file or directory
trying to install the armhf version of systemd fails because it wants to remove the 64 bit version and can't
a fix for this is to have precompiled binaries for armhf and aarch64
The text was updated successfully, but these errors were encountered: