Skip to content
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

Unable to build gst-plugins-spotify #358

Closed
fatg3erman opened this issue Apr 22, 2023 · 12 comments
Closed

Unable to build gst-plugins-spotify #358

fatg3erman opened this issue Apr 22, 2023 · 12 comments

Comments

@fatg3erman
Copy link

On a Raspberry Pi 4 running Raspbian bullseye. I've followed the instructions - downloaded rust, all the dependencies etc. When I do

cargo build --package gst-plugin-spotify --release

I get

error: command failed: 'cargo': No such file or directory (os error 2)

There's no other information and I know nothing about Rust. Can anybody help?

@psmsmets
Copy link

psmsmets commented Apr 22, 2023

You need to source the directory ~/.cargo/bin containing the Rust development tools (I assume you have the default install settings). The rustup.rs script added a line to your .bashrc. It is stated at the end of the install script in your terminal, or have a look at https://www.rust-lang.org/tools/install

To load the development tools either relogin or execute source "$HOME/.cargo/env.
Afterwards you should be able to execute cargo --version

@fatg3erman
Copy link
Author

Thanks, but I've already done that. ~/.cargo/bin is on my PATH

which cargo
/home/bob/.cargo/bin/cargo

cargo --version
error: command failed: 'cargo': No such file or directory (os error 2)

The error is clearly coming from cargo itself, but I've tried setting CARGO_LOG=debug and I don't get any further information.

I did previously have cargo installed from the Raspbian repository but it was too old to build this project so I apt-purged it before installing as in the Mopidy instructions. Could there be some config somewhere that it left behind?

@kingosticks
Copy link
Member

How about invoking directly ?
'/home/bob/.cargo/bin/cargo --version'

@fatg3erman
Copy link
Author

fatg3erman commented Apr 22, 2023

OK finally found it on Google. The issue is that Raspbian is 32-Bit and the installer incorrectly identifies it as 64 Bit.

You need to do a custom installation of Rust and, when asked for the default host triple, enter

arm-unknown-linux-gnueabihf

(This is for Raspberry Pi 4. It might be different for other Pi versions)

It has now built and installed. Now to see if I can remember my Spotify password....

@fatg3erman
Copy link
Author

Hmm. Just reinstated my Spotify Premium subscription, regenerated the secrets, updated my mopidy.conf and

ERROR [SpotifyEventLoop] spotify.session Spotify login error: <ErrorType.USER_NEEDS_PREMIUM: 15>

apt-cache policy mopidy-spotify
mopidy-spotify:
  Installed: 4.1.1-0mopidy1
  Candidate: 4.1.1-0mopidy1
  Version table:
 *** 4.1.1-0mopidy1 500
        500 https://apt.mopidy.com buster/contrib armhf Packages
        100 /var/lib/dpkg/status

@kingosticks
Copy link
Member

kingosticks commented Apr 22, 2023

You'll notice there is no new release yet. You'll need to remove mopidy-spotify Debian package and/or pypi package and install the latest development version from GitHub instead e.g. (using sudo if necessary)

pip install https://github.com/mopidy/mopidy-spotify/archive/master.zip

To be fair, this isn't at all clear from the readme. I had meant to address that, sorry.

@fatg3erman
Copy link
Author

Fantastic! Thank you, Spotify has returned!

Big thanks for all your work on this, I really did think Spotify support would never come back. It's hugely appreciated.

Now, perhaps I should see about reinstating those spotify features I pulled out of RompR in a fit of rage?

@MrTolchock
Copy link

I have built a radio for my kids, running on a Raspberry Pi Zero 2W. It involves some hardware and Mopidy, and my main Python script uses MPD to make the buttons to do things with Mopidy/Spotify. The radio is not working anymore for more than a year, but I really want to fix it now. I'm a hobbyist and not a professional programmer, which option you think is the easiest to take:

  1. Use the dockers container someone posted here on this Github page (I'm not sure if and how I can communicate from my existing setup into dockers, can I use a normal script and MPD to communicate with Mopidy/Spotify which sits in a container?)
  2. Compile this rust thing as described by kingofsticks in the instructions (I failed to compile it though, I guess because my RPi Zero is not powerful enough, can I compile it on a RPi 4 and move the thing over to my RPi Zero?)
  3. Wait for the packaged solution (definitely easiest, but how long it will take until ready?)

@EAGrahamJr
Copy link

I have built a radio for my kids, running on a Raspberry Pi Zero 2W.

@MrTolchock I just built a Pirate Audio using a Pi Zero and all of the instructions in the README are easy to follow except for building the driver: the Pi Zero does not have enough memory to compile/link the library.

What I did:

  1. Repeat steps 1 and 2 on a Raspberry 3 running the 32-bit OS
  2. Do step 3 but do not run the install line
  3. Instead copy the .so file from the Pi 3 to the Zero
  4. Use the install program to install the .so just copied over

The "trick" is that the library driver has to be compiled on the target system and the Pi Zero can only run the 32-bit OS -- and everyone else in the world is now using 64-bits. 😏

@psmsmets
Copy link

What I did was similar as @EAGrahamJr , cross-compile the .so on another machine, and install (copy the file to the gstreamer libs) on the RPi.

I did this for a 64-bit OS. You can find the compiled library on my website (see below). Tested on many RPi3b+ and 4, both running Raspberry Pi OS (64-bit, Debian Bullseye).
Never compiled/tested this for the 32-bit OS, but I could give it a go and publish the .so online as well.

What I do to install gstreamer with the spotify library:

sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
sudo curl --proto '=https' --tlsv1.2 --output /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstspotify.so https://www.pietersmets.be/share/libgstspotify.so
gst-inspect-1.0 spotify

@kingosticks
Copy link
Member

I've been playing on and off with automating the builds. There's a 32-bit Pi0 compatible deb at https://github.com/kingosticks/gst-plugin-spotify-build/suites/16959617041/artifacts/968984234 you can test if you like.

@kingosticks
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants