Issues with Plexamp Headless on Raspberry Pi

Hi All,

I drive my living room hifi with Plexamp Headless running on a Raspberry Pi 4 with a HiFi Berry Digi2 Pro hat. I got it all set up using this guide just over a year ago and it has been running rock solid since, with any issues easily fixed by a hard reset of the rpi by unplugging the power and plugging it back in.

A few days ago the rpi wasn’t showing up in plexamp, and it still wasn’t showing up after some hard resets. I decided to reinstall and troubleshoot that way. I got it working, but when I went to set it so it launches on startup of the pi I got a peculiar error. The unit would show up in plexamp, but when trying to play songs the album art would show up for an instant before the playback window minimized towards the bottom of the player, refusing to playback, as if nothing was playing back at all. This behavior was consistent across the mobile, desktop, and browser players when trying to drive the headless instance.

I went back and retraced my steps a few times, reinstalling the rpi os, plexamp, logging in, and every time it would have the same behavior when I went through the steps to have plexamp launch on startup of the rpi., with the exact same playback issue.

Finally I reinstalled the rpi os and stopped just before the steps to have it launch on startup. It works fine, but I have to ssh in and run this command every time I want to use it: node plexamp/js/index.js

Any idea what is happening? This is workable for now but I am eager to have my perfectly automated headless system working in full force again. I wonder if it has anything in common with what caused my rock solid system to fail for the first time in a year in the first place. I did get a new modem in case that is relevant.

Thanks,
Tim

Unfortunately not possible to diagnose without more information, such as Plexamp logs from the device after playback, any relevant system logs, etc.

1 Like

I was trying to figure out how to get logs out of plexamp headless on the pi, any tips?

~/.cache/Plexamp/log/

1 Like

Took a while to figure out scp but got the logs!
Plexamp.log (109.1 KB)
Plexamp.1.log (675.6 KB)

I have more but these seem to have the logs from the relevant timeframe.

Something in these commands seems to cause this error -

sudo cp plexamp.service /lib/systemd/system/

Hit Enter

sudo systemctl daemon-reload

Hit Enter

sudo systemctl enable plexamp

Hit Enter

sudo systemctl start plexamp

Hit Enter

It’s unable to initialize the audio device:

Sep 27, 2024 15:00:54.910 [0x968df080] ERROR - BASS: Error initializing device -1 with sample rate 48000 and flags 00000000 (3).

Not sure why, some sort of permissions issue with the service??

Odd that it only happens when it tries to start on launch. If I ssh in and launch it everytime I want to use it it works perfectly. What service do you mean?

it looks like you’re running a full desktop session (this is expected if you installed the normal OS image … vs the Lite OS image, which is usually all you need if you’re going to run headless)

logs show a long list of audio outputs including pulseaudio (audio server that normally only runs as part of a desktop session)

there can be issues/conflicts when a system service (in this case, Plexamp) tries to access an audio device at the same time as pulseaudio … vs no issue when you log in and start Plexamp manually using the same audio device

running without the full desktop environment might help avoid the issue you’re seeing

1 Like

I’ve been running the Digi2 Pro with the native Hifiberry OS, using their latest Alpha release (Release 64alpha8 · hifiberry/hifiberry-os · GitHub). It supports plexamp out of the box, just requires some activation steps (GitHub - hifiberry/extension_plexamp)

I’m not sure if it fits your use case, just wanted to share it as an option. For me this was the best solution because I use the Hifiberry DSP add-on and wanted easy room correction.

1 Like

This seems to have fixed it!! Now reading more closely I see the guide I followed suggests installing Pi Os Lite.

Thank you so much!!!

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