Suggestions for the future: Headless RPi support!

Thanks. Was about to install Volumio and other things to get my Plex library working at my house renovating locations. Decided to do a search if it would be even possible and here I am.

I decided to use the Dockerfile above and wrote a docker-compose.yml file for my own ease of use. And to get PlexAmp up and running after reboot. So here it is.

version: '2'

services:
  plexamp:
    container_name: plexamp
    build:
      context: ./
    image: plexamp:v1.0.5
    devices:
      - "/dev/snd:/dev/snd"
    network_mode: host
    restart: unless-stopped

It needs the Dockerfile above and the server.json file to be in the same folder as docker-compose.yml. Also you need to install docker-compose to RPi. After the installation run docker-compose up plexamp. This builds and starts the container. After a first build you can start the container with docker-compose start plexamp.

2 Likes

Would it be possible to supply a similar Headless Package for x86_64 instead of ARM? The ARM package is running very nicely with my HiFiBerry Digi + Pro.
I would like to achieve the same with my Debian home server.

Thanks in advance.

2 Likes

Just wanted to thank everyone, especially @elan. I’ve been using a pi display that would start Plex-web on startup in full screen to play music in my backyard. I don’t know what got me to this thread, I fell into the Plex wormhole but I’m sure glad I found it.

Just one more reason for me to love Plex!

Now to conquer having a Plex controller for my backyard projector…

Hey, glad you got it working!! :smile:

Another vote for an ARM v6 compatible build. Would love to run this on my PI zero w.

2 Likes

Count me in also…

2 Likes

@elan Any tips on how to get Plexamp to not resample the audio? All my 24/96 music is playing back at 44.1 even though Plex info saying it is using Direct Play

I think you’d need to make your own mpd.conf override to specify device parameters? Or else set the audio device up the way you want it before you start Plexamp (as I think the mpd by default uses existing device parameters).

I’m a noob but managed to get Plexamp up and running on Rpi3 / hifiberry DAC+. Works great.

I do notice my syslog and daemon.log files are gathering data at MB’s per day.

My question how do I curtail or restrict Plexamp from generating all these messages…(I have checked Plexamp is the culprit.)

Not too familiar with nodejs and server/application house keeping.

To date when those files have grown too big i have culled them with “cat /dev/null >”

Assistance would be much appreciated.

Thanks for the tip @elan. I’ve tried all kinds of mpd/alsa configs but no luck. I always see this in the logs.

Aug 30 20:48:48.969: player: Got device format: 44100:f:2
Aug 30 20:48:49.332: ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: stream 0, timescale not set
Aug 30 20:48:49.336: ffmpeg: codec 'alac'
Aug 30 20:48:49.336: decoder: audio_format=96000:32:2, seekable=true
Aug 30 20:48:49.336: decoder: Shared device format set to 44100:f:2, will convert if required
Aug 30 20:48:49.336: decoder: converting to 44100:f:2
Aug 30 20:48:49.337: libsamplerate: setting samplerate conversion ratio to 0.4

My vanilla MPD 0.20.20 install has no issues negotiating the correct sample rate to output to my USB DAC. What version of MPD is plexamp built with? Is it possible that the replaygain/cross-fade features are forcing the output to 44100 ?

I had success implementing this on my Raspberry Pi 3 Model B with a Kuman PiFi DAC+ board. It took a bit of sorting to make sure I had the correct drivers enabled in Raspian, but once it was set I was able to play beautifully…

Slight off topic question: I assume this source code runs without any GUI front end at all (hence ideal for a headless system). Is there any plan to have a version of Plexamp with full GUI for Raspberry Pi? The thought would be a small touch screen connected to the Pi that shows just the Plexamp GUI full screen…

I am not sure that would jive with the Plexamp interface, but I thought I would ask.

pm

1 Like

Hmm, I don’t think so, as I use a DAC set to 88.2k over here and that’s how MPD opens. I’m less familiar with Linux, though, and IIRC we use the MPD default driver on that OS instead of our customized one. If you’re a dev feel free to PM me and maybe I can help.

No current plans, no. I do sort of dig the idea of a wall-mounted screen with visualizer, but hey, not much spare time these days :sweat_smile:

1 Like

I decided to take a shot at setting up pipe audio output for plexamp. The end goal being to have forked-daapd pick up this pipe automatically and output the audio to multiple airplay receivers. Long story short, I didn’t get it working, but I think my approach was on the right track. Maybe someone can provide some guidance to get this working.

To change plexamps output I’m editing the mpd.conf file /home/pi/plexamp/resources/helpers/linux-arm/mpd.conf.

#audio_output {
#  type "alsa"
#  name "my audio device"
#  mixer_type "software"
#}

audio_output {
    type            "pipe"
    enabled         "yes"
    name            "multiroom"
    path            "/share/forked-daapd/airpipe"
    format          "44100:16:2"
}

samplerate_converter    "1"
bind_to_address         "127.0.0.1"
port                    "36600"
buffer_before_play      "15%"
audio_buffer_size       "16384"

I’ve commented out the default output settings and tried adding the pipe.
For forked-daapd to pick up a pipe audio needs to be PCM16 raw format. Maybe I’ve got the formatting wrong??

The behavior I’m seeing is when changing to the pipe output, restarting plexamp via ‘systemctl restart plexamp’, and setting the player to “PlexPiAmp” (my pi), the plexamp screen on my mac just stays blank.
image

Here are the contents of the tmp/mpd.log file. I don’t think it’s even attempting to play audio.

Sep 16 14:37:51.054: client: [0] opened from 127.0.0.1:51032
Sep 16 14:38:01.006: player: Got device format: 44100:f:2
Sep 16 14:38:01.006: decoder_thread: setting replaygain track=-6.170000 album=-6.900000
Sep 16 14:38:01.007: decoder_thread: setting mixramp in=1.97 0.00;3.25 0.10;6.20 12.60; out=-51.00 0.17;-39.36 2.07;-28.90 2.37;-21.66 2.57;-17.86 2.67;-12.21 2.77;-5.85 2.87;-2.01 2.97;0.37 3.07;3.16 3.27;6.51 4.47;
Sep 16 14:38:01.634: ffmpeg: codec 'mp3'
Sep 16 14:38:01.635: decoder: audio_format=44100:16:2, seekable=true
Sep 16 14:38:01.635: decoder: Shared device format set to 44100:f:2, will convert if required
Sep 16 14:38:01.635: decoder: converting to 44100:f:2
Sep 16 14:38:01.889: output: opened plugin=alsa name="my audio device" audio_format=44100:f:2
Sep 16 14:38:01.889: output: resetting output clock.
Sep 16 14:38:01.889: replay_gain: scale=0.451856
Sep 16 14:38:22.063: player: played "http://127.0.0.1:20000/proxy/file.mp3?source=29a24fd90c27a5e5f3134baa2c175b93e0fd9816&endpoint=%2Flibrary%2Fparts%2F55%2F1504843126%2Ffile.mp3%3Fdownload%3D1%26X-Plex-Client-Identifier%3D811c7acb-8c96-4ac4-9848-4216cdf14e54%26X-Plex-Session-Identifier%3D403b9173-93ec-4d8a-a949-faea0ac2afd1"

and systemctl status plexamp

● plexamp.service - Plexamp
   Loaded: loaded (/lib/systemd/system/plexamp.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2018-09-16 17:35:04 UTC; 7min ago
 Main PID: 1724 (node)
   CGroup: /system.slice/plexamp.service
           └─1724 /usr/bin/node /home/pi/plexamp/server/server.prod.js

Sep 16 17:35:23 raspberrypi node[1724]:     at /home/pi/plexamp/server/server.prod.js:1:624917
Sep 16 17:35:23 raspberrypi node[1724]:     at Generator.next (<anonymous>)
Sep 16 17:35:23 raspberrypi node[1724]:     at r (/home/pi/plexamp/server/server.prod.js:1:618243)
Sep 16 17:35:23 raspberrypi node[1724]:     at /home/pi/plexamp/server/server.prod.js:1:618389
Sep 16 17:35:23 raspberrypi node[1724]:     at new Promise (<anonymous>)
Sep 16 17:35:23 raspberrypi node[1724]:     at /home/pi/plexamp/server/server.prod.js:1:618187
Sep 16 17:35:23 raspberrypi node[1724]:     at e.setAudioParameters (/home/pi/plexamp/server/server.prod.js:1:624954)
Sep 16 17:35:23 raspberrypi node[1724]:     at /home/pi/plexamp/server/server.prod.js:1:625742
Sep 16 17:35:23 raspberrypi node[1724]:     at Generator.next (<anonymous>)
Sep 16 17:35:23 raspberrypi node[1724]: debug: GET /player/playback/createPlayQueue?source=29a24fd90c27a5e5f3134baa2c175b93e0fd981

I’d include application log output but I don’t know where to find it.

Some hints…

As defined in mpd.conf:
log is /tmp/mpd.log
rpi $ tail -f /tmp/mpd.log

port is 36600

rpi $ mpc -p 36600 <command>
some-pc $ mpc -h RPI -p 36600 <command>

mpd supports multiple outputs, just add both and use

$ mpc outputs
$ mpc enable [ID]
$ mpd disable [ID]

and follow the logs…

good luck :wink:

Anyone make any progress with Pi Zero?

Please release a package for x86! I’d like to have it running headless on volumio2.

I’m currently running plexamp on an Ubuntu VM piping audio to volumio2 (x86) through pulseaudio-dlna which then pipes it to snapcast for multiroom audio (it then ends up back at the Ubuntu VM where a snapclient sends it down a specific output of a 7.1 channel audio card).

I want a remote controllable headless plexamp to simplify my setup (and remove the audio delay caused by the use of dlna).

Also building the packaged mpd (linux plexamp) with pipe support would simplify things massively and allow for much more flexibility. I managed to get plexamp working with the Ubuntu supplied mpd for pipe support but because of the way plexamp is packaged it makes it difficult to modify the included files and updates will kill the configuration.

Did this issue get resolved as I have exactly the same problem. RPi3B+ with hifiberry digi+pro running on Raspian Lite. I have also tried many configuration settings in mpd and ALSA but still get the - player: Got device format: 44100:f:2 - which seems to be the start of the issue.

Is there an easy way to install PlexAmp on RPi3? Like an rpi image?

There is not. It is only possible in the way described above.

:frowning:
Can you please make one for people without technical knowledge?

2 Likes