PlexAmp-installer for Raspberry Pi with ARMv7 & ARMv8 HW

Yep, that is indeed a good idea! I will look into making that change! I will however use the “/opt/plexamp”-location, since this is usually the recommended/best-practices location for these things according to Filesystem Hierarchy rules.

I’m not sure I agree about this. But the important thing is that the service is run as a separate (non regular) user.

/var/lib is not optimal. But /opt should be used for static files only. So ideally .cache, .config and Library directories would then be under /var/opt/plexamp (following FHS). I’m not sure it is (currently) possible to separate the installation in that manner.

I’m curious, is it normal behaviour that the streaming brain reserves only 128 kbps for playback of audio files including .flac?

Is it actually transcoding everything to 128 kbps because the Plex server detects it as:

“Indirect—128 Kbps”

Thanks.

“indirect” means a relay connection, which is extremely limited in bandwidth. It is reasonable to reduce the audio bandwidth in this case.
Avoid relay as much as you can.

Why is a headless RPi running this setup on a local network being access as a relay station?

@odinb1 Is this happening to you also?

Thanks.

The headless RPi is taking over the stream from the server, and the app is basically a remote at that point. That is the whole idea of this! I can power down my phone, that I started the music from, and it will continue playing from the RPi. This is how it works for me!

I understand, I’m just surprised that the bandwidth is limited to 128 Kbps…

I was hoping for a lossless solution to replace my Roon endpoint. Maybe in the future.

Thanks again for the bash and help.

This has nothing to do with remote.

The issue is probably rooted in DNS rebinding protection, like most of the times when a local client is only connecting per relay to the server.

https://support.plex.tv/articles/206225077-how-to-use-secure-server-connections/

This link gives more info of the capabilities of the player: Shield sends all music to receiver as PCM - #2 by elan

A nVidia Shield is not a raspberry pi.
The Shield doesn’t run plexamp.

@odinb1 , I stumbled over your script while looking for answers to get a headless RPi-4B running with PlexAmp.
I followed your script/documentation to the “T”.
I can see my RPi in both my Android phone on the PlexAmp app and the web interface (forgive me if I use the wrong terms here, I’m new, be gentle) on my office PC, but when I try to select it, I get the message that it “can’t connect to the device” (or something like that.)
At one point, I WAS able to connect to it, But, it would not start playing.
I am using the latest version of Raspberry Pi OS Lite (04/2021 Kernel 5.10)
Do you have any suggestions of what I can look at to get it working?
Thanks!

Hi svinzant!

What do you see when running “sudo systemctl status plexamp”?

@odinb1
I re-ran your script on a clean install. From the web app, I can see my RPi and select it. When I try to start a stream, it “looks” like it is playing for about ten to 15 seconds. But no audio is sent to the headphones on my RPi.
.61 is the IP address of the PC running PMS.
.2 is the IP address of a PC (same PC, really) running DNSMasq
So, it appears to be running, it just doesn’t send a stream to my RPi.
(I sanitized a few bits in the systemctl output.
Thanks for any input you can provide!

● plexamp.service - Plexamp
Loaded: loaded (/lib/systemd/system/plexamp.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2021-04-23 18:46:18 CDT; 53s ago
Main PID: 571 (node)
Tasks: 18 (limit: 4915)
CGroup: /system.slice/plexamp.service
└─571 /usr/bin/node /home/pi/plexamp/server/server.prod.js

Apr 23 18:46:18 raspberrypi systemd[1]: Started Plexamp.
Apr 23 18:46:21 raspberrypi node[571]: Audio: Ready.
Apr 23 18:46:21 raspberrypi node[571]: Audio: Set player info.
Apr 23 18:46:21 raspberrypi node[571]: warn: DEVICE: Server connection https://127.0.0.1:32400 didn’t work for mediapc: connect ECONNREFUSED 127.0.0.1:32400
Apr 23 18:46:21 raspberrypi node[571]: warn: DEVICE: The player wyj7g3vm04m0fhc7qeyaj7en wasn’t found in available resources at http://192.168.1.61:32400.
Apr 23 18:46:21 raspberrypi node[571]: warn: DEVICE: The player wyj7g3vm04m0fhc7qeyaj7en wasn’t found in available resources at http://192.168.1.2:32400.
Apr 23 18:46:26 raspberrypi node[571]: warn: DEVICE: Server connection http://<ISP_ip_Address>:24870 didn’t work for mediapc: timeout of 5000ms exceeded
Apr 23 18:46:26 raspberrypi node[571]: warn: DEVICE: Player connection http://ISP_ip_Address:24870 didn’t work for Firefox: timeout of 5000ms exceeded
Apr 23 18:46:26 raspberrypi node[571]: warn: DEVICE: Connection testing failed for Firefox

Hi!

For your connection-issue:
Try rebooting the Pi and try again, looks like there is some issue connecting to the Plex-server (warn: DEVICE: The player wyj7g3vm04m0fhc7qeyaj7en wasn’t found in available resources at http://192.168.1.61:32400.). If still not fixed, you might need to re-generate the token, or at least verify it is entered correct. Maybe even try rebooting the Plex-server?

For your audio issue (headphone jack), what did you choose during install? Did you choose “no” when asked if you wanted to configure HiFiBerry?

Also, what does the commands “aplay -l”, “amixer info” and “cat /proc/asound/cards” give?

For the command “cat /boot/config.txt”, what does the following line look like “dtparam=audio=on”? Does it have a hash-tag in-front of it or not? It should not have a hashtag infront if you want headphones to work (you want it though if you have a HiFiberry or similar card). If you need to change, please reboot after.

Hmmm,
I had restarted the PMS service (and the RPi). I went ahead and bounced the server the PMS is running on, as well as the RPi again. See the output of systemctl (from the RPi) below. It’s a lot cleaner, but, I still have the connection issue. Which is odd as I can see the “ToughBook” (The token in the PlexAmp I set up on the RPi) on both my office desktop (via the web app) and on my Android phone via the PlexAmp app. I can select it (via either device) it just won’t start a stream.
Additionally, I can see all of my Sonos devices, and stream to them just fine.

sudo systemctl status plexamp
pi@raspberrypi:~ $ sudo systemctl status plexamp
● plexamp.service - Plexamp
Loaded: loaded (/lib/systemd/system/plexamp.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2021-04-24 17:40:37 CDT; 54s ago
Main PID: 560 (node)
Tasks: 18 (limit: 4915)
CGroup: /system.slice/plexamp.service
└─560 /usr/bin/node /home/pi/plexamp/server/server.prod.js

Apr 24 17:40:37 raspberrypi systemd[1]: Started Plexamp.
Apr 24 17:40:39 raspberrypi node[560]: Audio: Ready.
Apr 24 17:40:39 raspberrypi node[560]: Audio: Set player info.
Apr 24 17:40:39 raspberrypi node[560]: warn: DEVICE: Server connection https://127.0.0.1:32400 didn’t work for mediapc: connect ECONNREFUSED 127.0.0.1:32400
Apr 24 17:40:44 raspberrypi node[560]: warn: DEVICE: Server connection http://<ISP_ip_Address>:14855 didn’t work for mediapc: timeout of 5000ms exceeded

To answer your other questions

I Chose “No” to the configure HiFiBerry (I don’t own a DAC(yet))

aplay -l
pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
Subdevices: 3/4
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 4/4
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3

amixer info
pi@raspberrypi:~ $ amixer info
Card default ‘b1’/‘bcm2835 HDMI 1’
Mixer name : ‘Broadcom Mixer’
Components : ‘’
Controls : 2
Simple ctrls : 1

cat /proc/asound/cards
pi@raspberrypi:~ $ cat /proc/asound/cards
0 [b1 ]: bcm2835_hdmi - bcm2835 HDMI 1
bcm2835 HDMI 1
1 [Headphones ]: bcm2835_headphonbcm2835 Headphones - bcm2835 Headphones
bcm2835 Headphones

dtparam=audio=on
NO hashtag on that line.

Thanks again for your insight and input.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.