Headless Plex Client using HiFiBerry and Raspberry Pi 3

Plex media server is a great way to manage personal media collection (mp3 music, family videos and photos). I’ve been using Plex Media Server running in a Synology NAS for quite sometime to manage a sizeable collection of music, videos and photos.

I stream my personal collection, especially some of my favorite Indian musicians through the living room stereo and bedroom stereo (powered by a Class T Amplifier (Trends Audio Class-T TA 10.1) connected to a pair of Axiom speakers). This stereo system was running “Rasplex” for quite sometime on a Raspberry Pi with HifiBerry DAC+ Pro board, but lately been experiencing issues and bugs that’s been frustrating. And was looking for various alternatives that’ll seamlessly work with Plex to stream audio to my stereo. Recently, stumbled across a project promoted/implemented by Plex CTO to run PlexAmp run in Raspberry Pi.

This guide shows how I setup a headless PlexAmp using the latest build from Plex.

Hardware

HifiBerry Board

Install Ubuntu Server in Raspberry Pi

  • Install Ubuntu 11 (bullseye) in server mode, no graphical display.
    • Follow the steps in this page to install Ubuntu Server in Raspberry Pi 3 (Link) or here .
  • install ssh server in the ubuntu server.
    • sudo apt-get install openssh-server
    • and enable it by running following (so that ssh server will start when the system reboots):
      • sudo systemctl enable –now ssh

Configure and Enable HifiBerry Board

  • Follow instructions here to configure and enable Hifiberry board in ubuntu.
    • Hifiberry drivers are already included in the Linux Kernel for Raspberry Pi OS. So you just need to follow the instructions below.
    • vi /boot/config.txt file
      • comment out “dtparam=audio=on” line (Basically put a “#” in front of the line)
      • add audio=off to the “Enable DRM VC4 V3D driver” section
        • “dtoverlay=vc4-kms-v3d, audio=off” (I guess, this disables built-in driver!)
      • add following lines  to the same file.
        • dtoverlay=hifiberry-dacplus
        • force_eeprom_read=0
  • Then created /etc/asound.conf file with following:
                   pcm.!default {
                      type hw card 0
                   }
                   ctl.!default {
                      type hw card 0
                   }
  • Reboot “reboot”
  • run “aplay -l”
    • You should see following output:
    • card 0: sndrpihifiberry….

Install PlexAmp

Now that we’ve installed OS and HifiBerry is enabled and configured, next step is to install and enable PlexAmp client. As far I can tell, there is no guide to cleanly install and debug the client. I believe this software is still actively developed, but I was able to get it working with simple tweaks. Following is what I did:

  • To install PlexAmp (In server mode with no graphics) I followed instructions here.
  • first install nodejs server
    • sudo apt install nodejs
  • Download latest headless PlexAmp client for Raspberry Pi
  • Untar the file
    • tar -xvf Plexamp….tar.bz2
  • Go to “plexamp” directory
    • cd plexamp
  • Now run the node webserver
    • node js/index.js
    • Above step will start the PlexAmp client scripts that are part of the nodejs server.
  • At this point make sure you can see the “Raspberry PI” (screenshot below) in your iPhone or Android Plex client.
Check to make sure “hifiberry” shows up in the clients.
  • Once you confirm the PlexAmp client shows up in the iPhone app, you know the install and configuration is successful.
  • Next step is to make sure the PlexAmp client starts automatically when Raspberry OS bootsup. For doing that, you need to run PlexaAmp as a service.

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

That’s it.. you should be able to stream audio from your Plex app in iPhone, select PlexAmp as the client to play audio through your home stereo!. Enjoy.

If you are curious.. here is my setup:


Last Updated on August 25, 2022 by SK

Leave a Reply

Your email address will not be published.