Skip to content

Instantly share code, notes, and snippets.

@oleksiiha
Last active April 15, 2024 03:18
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oleksiiha/74ed6db4cf116e19ed51fcc2dd2feceb to your computer and use it in GitHub Desktop.
Save oleksiiha/74ed6db4cf116e19ed51fcc2dd2feceb to your computer and use it in GitHub Desktop.
Install Plexamp on HiFiBerryOS
Pre-requisits:
My build worked for me and my setup which includes: Raspberry Pi 3b, HiFiBerry DAC+ Standart, wired connection (for some reason connection to plexamp drops on wireless), HiFiBerryOS installed
You need version 9 of nodejs in your system, easiest way in my opinion to install custom version of nodejs and to not affect version 12 that is present in HiFIBerryOS, is to use nvm
1. Ssh to your hifiberry installation
2. Create bash profile file (this is required by nvm)
# touch ~/.profile
3. Install NVM
# curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash
This might take several minutes
4. Re-login to you installation to enable NVM CLI
5. Install nodejs version 9
# nvm install 9
After this you should have node version 9 installed in this path:
/root/.nvm/versions/node/v9.11.2/bin/node
6. Download and unpack plexamp
# curl https://files.plexapp.com/elan/Plexamp-v2.0.0-rPi-beta.2.tar.bz2 > plexamp.tar.bz2
# tar -xvf plexamp.tar.bz2
7. Alter plexamp.service file to match actual paths
# nano plexamp/plexamp.service
This is my plexamp service content:
```
[Unit]
Description=Plexamp
After=network.target
[Service]
Environment="PLUGIN_PATH=/root/plexamp/server/node_modules/treble/build/Release/"
Environment="LD_LIBRARY_PATH=/root/plexamp/server/node_modules/treble/build/Release/"
Type=simple
User=root
ExecStart=/root/.nvm/versions/node/v9.11.2/bin/node /root/plexamp/server/server.prod.js
Restart=on-failure
[Install]
WantedBy=multi-user.target
```
8. Now the tricky part
You need to have `server.json` file from real installation of plexamp version < 3. I had to find installation on internet for my mac of Plexamp v.1.1. Then you login in that installation and then find `server.json` file which path depends on your OS.
You need to copy its content and put in a file at this path: `/root/.config/Plexamp/server.json`
Approximate content of this file is:
```
{
"player": {
"name": "music-streamer",
"identifier": "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"
},
"user": {
"id": 00000,
"token": "xxxxxxxxxxxxxxxxx"
},
"server": {
"identifier": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"library": "/library/sections/xx"
},
"state": {
"source": null,
"state": "stopped",
"time": 0,
"volume": 100,
"playQueueID": null,
"playQueueItemID": "xxxxx"
}
}
```
9. Almost there, now you need to install and start plexamp daemon:
# cp plexamp/plexamp.service /lib/systemd/system/plexamp.service
# systemctl daemon-reload
# systemctl enable plexamp
# systemctl start plexamp
# systemctl status plexamp
Last command should display information that service is up and running, now you can try and cast music from your other plexamp or plex app.
@vincegre
Copy link

It it working on PI4 ? and with current plex pass server releases ? Thanks anyway for the share ;)

@oleksiiha
Copy link
Author

I don't own Pi4, and I think it will not depend on server version. Hard part is to find old version of the Plexamp installer that uses server.json

@jamoir
Copy link

jamoir commented Nov 16, 2021

Hi,

Does anyone have this working still?

I've got it setup as above but can't see the Pi from iPhone plexamp. Can see it from the web browser access to plex. But selecting it doesn't product any output.

Help would be greatly appreciated.

Thanks,
Jamie

@vincegre
Copy link

I've got it setup as above but can't see the Pi from iPhone plexamp. Can see it from the web browser access to plex. But selecting it doesn't product any output.

When you select something to play on the pi from plex web interfate, then ssh to your pi and run again the command in root or sudo:

systemctl status plexamp

it should indicate if player encounters some errors or what's wrong ;)

@EpicLPer
Copy link

It seems that a few days ago Plex was talking about this again and mentioned they're working on making the headless player a bit better: https://forums.plex.tv/t/future-of-plexamp-on-raspberry-pi/717577/82

@pascalandy
Copy link

I guess the question is: how do you select your external DAC in this set up.

I've got it setup as above but can't see the Pi from iPhone plexamp. Can see it from the web browser access to plex. But selecting it doesn't product any output.

@mbolo01
Copy link

mbolo01 commented Sep 28, 2022

Latest Plexamp headless code now works with HiFiberry OS, node v 12 is required though.

@pascalandy
Copy link

I guess we still need to install it if we have to install Node ? Any docs ?

Latest Plexamp headless code now works with HiFiberry OS, node v 12 is required though.

@mbolo01
Copy link

mbolo01 commented Sep 28, 2022

First, I'm not a UNIX tech (in case you ask me more detailed questions :-) )
Some background:
The conflict between HiFiBerry OS not being 64 bits, and Plexamp being 64 bits only is now solved, Plexamp can now run on both 64 and non 64. Also, In the first Plexamp distribution, some required modules were missing but have now been added.
Installation:
I simply followed the above instructions up to point 5. where I installed version 12 instead (Plexamp dev gave me the required Node version #). Then you need to follow Plexamp headless installation and setup instructions.

@PhoenixAzrael
Copy link

Hi! Latest Plexamp 4.6.0 headless supports 32/64 bits installation. Also just use nvm to install node version 16. just a little fiddling with the plexamp.service and all is fine...

@markst
Copy link

markst commented Mar 28, 2023

Can't seem to install Node version 16

ModuleNotFoundError: No module named '_bz2'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment