Plexamp - “Couldn’t start playback” - RPi4

Plexamp - “Couldn’t start playback” - RPi4

I love Plexamp and have decided that since I can’t find a streamer that does Plexamp well, it is time to make one.

I’m trying to make an RPi4 Plexamp streamer. I don’t have a HAT, I’m strictly going from the RPi4 to a Peachtree PreDAC over USB-A on the RPi4 side and USB-B on the Peachtree side.

I’ve successfully installed headless Plexamp. Since I also have a touchscreen on this RPi4, I can run Chromium locally and connect locally. Plexamp Web UI comes up fine this way and I can also successfully connect remotely to the RPi4 using a browser from my iPad. The Plexamp settings output on the RPi4 is “default”.

I know the RPi4 can run through the Peachtree successfully. I can watch Youtube videos from the RPi4 and the audio comes through the Peachtree just fine. I also can use app.plex.tv from the RPi4 and browse to my music library and it plays back through the Peachtree.

However, whatever way I get to the RPi4 plexamp, when I choose any song to play, the Web UI simply says “Couldn’t start playback”

When I use the local Chromium and connect to the local plexamp service, I don’t see anything show up in ~/.cache/Plexamp/log/Plexamp.log that is interesting. Mostly a request to get some assets, and then nothing else (playback.headless.chromium.txt). The cast menu is set to use the local headless instance of plexamp.

When I use my iOS machine and the browser to connect to the RPi4, the cast is set to the headless instance of plexamp, and it says the same thing in the web UI, “Couldn’t start playback.” (playback.headless.ios.txt)

I have plexamp clients on several iOS devices and they all work. From the same iOS machine just used, I can use the Plexamp.app and play just fine when the cast is set to “This Device”. If I switch the cast to the RPi4, the app flashes and playback stops.

playback.headless.chromium.txt (1.2 KB)


playback.headless.ios.txt (9.7 KB)

I’m really close to getting this work. I just can’t figure out “Couldn’t start playback”

You’ve posted server logs. Please post Plexamp logs from iOS after the playback fails, as well as logs from the RPi4 (~/.cache/Plexamp/log/Plexamp.log)

The Playback Logs from the RPi4 were attached, there’s not much in them.

Headless logs

My iOS connection is over the web browser to the headless. The Advanced tab on the web client doesn’t have any debugging options that I can find, which is why I tried to capture the server log.

Here’s the iOS Plexamp.app client logs while I was switch from playing local (works) to casting to the RPi4 (stops)

playback.ios.cast.txt (15.2 KB)

The headless logs from starting Plexamp. I used Chromium locally to start plexamp web ui. Clicked on a song, no playback.

playback.headless.chromium.txt (26.9 KB)

in the playback settings for headless, if you select the peachtree as the audio output (instead of default), do you get the same error?

Good eye @tgp-2

I didn’t write this down before.

When I configure the headless plexamp output, I can choose Peachtree or Default, neither seems to affect the “Couldn’t start playback”

I don’t even see any communication from clients, so that implies it’s not an actual playback issue, right?

playback.headless.chromium doesn’t show anything either.

I see iOS issuing a play:

Jul 07, 2023 16:17:53.343 [0x6bf57000] DEBUG - Networking: Completed request 731: (GET http://192.168.1.22:32500/player/playback/playMedia?source=60391f83169a7bd8f70161ddfbce7b8c393e146c&containerKey=%2FplayQueues%2F1879060340%3Fown%3D1&key=%2Flibrary%2Fmetadata%2F1879170268&offset=12000&paused=0&token=<token>&includeExternalMedia=1&type=music&protocol=https&address=192-168-1-23.07f6f8bd11ae416896ff1a6f9a2085f6.plex.direct&port=32400&machineIdentifier=60391f83169a7bd8f70161ddfbce7b8c393e146c&commandID=394) with code 200 (have 0 bytes) in 35 ms.

I don’t know what device of yours is handling this, but almost certainly not Plexamp.

I’d be happy to say I am following along, but I’m not.

I have had enjoyed plexamp for a while.

The only thing new is that I’m trying to run it from the RPi4 and this is the only device that can’t seem to interact with my server running Plexamp. My MacOS Plexamp clients are fine, but are not turned on during this logged session.

So, when you say “I don’t know what device of yours is handling this, but almost certainly not Plexamp,” I am not following. I don’t have any other devices that are involved, all I know is the RPi4 refuses to play anything.

Is there something that would help show this issue? When I posted this, I looked at the RPi4 log and it had 412 lines in it. I clicked on something to play, and my log went to 416 lines. The four lines had no communication about trying to play anything, only showing some graphical assets.

I’m going to start from scratch on a second SD card and see if I botched something along the way.

That implies that Plexamp on iOS wasn’t communicating with Plexamp on the Pi. The mobile app is talking to 192.168.1.22, is that the rPi? Is something else running on port 32500?

pulseaudio doesn’t necessarily get along with apps run as a system service … just for troubleshooting, you could switch over to booting headless / terminal-only, select the peachtree in the web ui, and then see if playback works … or while still running a desktop environment, you can stop the systemd service, execute headless manually (node ~/plexamp/js/index.js), and then select pulseaudio as the audio output

Thanks @elan and @tgp-2

Some fresh eyes this morning, so I started from scratch on a new SD card and I can report everything seems to be working, both in user space and as a system service. I’ll probably run as the system service for convenience.

I don’t know what strange configuration I ended up in, but I hope not to end up there.

Nice setup by the way. :slight_smile:

1 Like

agreed!

1 Like

I’ve spent an entire day trying to get Plexamp to work on my rPi4 and it just won’t work. I keep getting the “couldn’t start playback” notification like the OP. I’ve tried using a fresh install of Raspberry OS, a fresh install of Dietpi and I even thought I’d give it a bash on a fresh install of RopieeeXL. Nothing.

The logs haven’t helped me much. One weird thing I have noticed the entire time: my claim token is never saved between reboots and although the service I create starts and is running, there is no web interface available…presumably because it kicks the token off and doesn’t actually start correctly, even though systemctl says it’s running.

I’ve been through selecting every audio device etc as well and that also doesn’t seem to help. The Pi never shows up on the cast list either, I can only see other devices from the Pi.

Make sure you’re not using a beta of Plexamp headless. Latest betas require internal/private access, so it’ll sign you out if you don’t have it.

Have you tried the install via a script.

Here’s my recipe book. I’m not promising this works for everyone, but this is my process.

update

sudo apt-get update && sudo apt-get upgrade

get nodejs

curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -

install nodejs

sudo apt-get install -y nodejs

get plexamp

curl https://plexamp.plex.tv/headless/Plexamp-Linux-headless-v4.7.4.tar.bz2 > plexamp.tar.bz2

unpack plexamp

tar -xvf plexamp.tar.bz2

get your token

node plexamp/js/index.js
In your browser navigate to https://plex.tv/claim](https://plex.tv/claim) and copy the claim code presented.

launch plexamp

node plexamp/js/index.js

connect

http://#.#.#.#:32500

config plexamp.service

vi plexamp/plexamp.service
‘’’
[Unit]
Description=Plexamp
After=network-online.target
Requires=network-online.target

[Service]
Type=simple
# change home directory and / or user as needed
User=pi
WorkingDirectory=/home/pi/plexamp
ExecStart=/usr/bin/node /home/pi/plexamp/js/index.js
Restart=on-failure

[Install]
WantedBy=multi-user.target
‘’’

enable plexamp

sudo cp plexamp/plexamp.service /lib/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable plexamp
sudo systemctl start plexamp

Two things I noticed off the bat.

Get Plexamp you have 4.7.4. just a note for anyone coming after. That 4.8.0 is most recent as of this post

config plexamp.service you have vi is that for VIM or is that the user name?
in the plexamp service file is your actual user name pi or something else?

Hi @Ryuzaki_2 , I wasn’t looking for help. I got lucky and a fresh install solved my problem. @charliesjc was looking for any help, so I posted what I did to get myself out of the jam.

You can handle upgrades at any time. If you don’t have jq installed (a small xml and json parser), you need to install it.

sudo apt get jq

then

bash -x plexamp/upgrade.sh

If you want to check your version from your shell, you can do it this way:

awk 'RS=","; ORS="\n" {print $0}' plexamp/js/index.js | grep "getReadableVersion:function" | awk -F'"' '{print $2}' | head -n 1

I get this after I upgrade

4.8.0

(I can’t promise this works forever)

Yes, vi is short for vim

Noted in the comments, you may need to change your username and / or home directory. My local user name is not pi but that is what the file ships with…

2 Likes