I started from the most recent version of Raspberry Pi OS (with recommended software) on a Pi Zero 2 W.
First install the repackaged installer from pimoroni/pirate-audio#105. This is now merged into main so you can install it with
git clone https://github.com/pimoroni/pirate-audio
cd pirate-audio/mopidy
./install.shand
sudo rebootOnce mopidy starts up, you should see the URL of the device showing on the screen. You can also go to hostname.local:6680 to connect.
If you want to play music from Spotify on Pirate Audio, it will take a few extra steps!
Next we need to install the mopidy-spotify plugin. The most recent instructions on how to do this can be found here: https://github.com/mopidy/mopidy-spotify
This plugin relies upon the GStreamer Rust Plugin, which needs to be compiled from source. Spotify have now disabled username and password login so we need to install a forked version which supports token based login.
Don't try and compile it yourself on a Raspberry Pi, it is pain. Instead, grab a pre-compiled binary that the nice people behind spotify-mopidy have provided: https://github.com/kingosticks/gst-plugins-rs-build/releases. You will need the arm64 file for recent models of Raspberry Pi, download it with:
wget https://github.com/kingosticks/gst-plugins-rs-build/releases/download/gst-plugin-spotify_0.14.0-alpha.1-1/gst-plugin-spotify_0.14.0.alpha.1-1_arm64.deband then to unpack and install it:
sudo dpkg -i gst-plugin-spotify_0.14.0.alpha.1-1_arm64.debRun the following command to check that the plugin is correctly installed:
gst-inspect-1.0 spotifyaudiosrc | grep Version | awk '{print $2}'Switch to our virtual environment:
source ~/.virtualenvs/mopidy/bin/activateInstall mopidy-spotify:
python3 -m pip install mopidy-spotify==5.0.0a3Generate a client_id and client_secret from here: https://mopidy.com/ext/spotify/#authentication . You will need a Spotify Premium subscription.
Edit the mopidy config file:
sudo nano ~/.config/mopidy/mopidy.confScroll down to the bottom, and add your details to the [spotify] section. It should look something like this:
[spotify]
enabled = true
client_id = replace_with_your_client_id
client_secret = replace_with_your_secret
Then it's probably a good idea to sudo reboot again.
You may need to authorise the Spotify plugin through the settings of the web interface page if you've not done this already.
If you have no audio try editing your config.txt (sudo nano /boot/firmware/config.txt) and turning off onboard audio by adding the following line to the end of the file:
dtparam=audio=off