Onward: How I setup my DietPi SBC as a local music streaming server. I use Navidrome and OwnTone.

Navidrome

Navidrome is an open-source audio streaming server for audio files written in Go. Since it utilizes the Subsonic API, there are many client applications to choose from. I prefer this because the API has a rich feature set, including downloading of audio files (locally cached for off-line playback), which is better than the MPD protocol.

I install Navidrome via dietpi-software.

The default setup exposes the Navidrome server and web UI on port 4533 with /mnt/dietpi_userdata/Music as the default data directory. The latest version supports Jukebox mode, multiple Libraries, external lyrics files, and so much more.

The configuration file is at /mnt/dietpi_userdata/navidrome/navidrome.toml, and I changed a few Navidrome Configuration Options to:

  • disable external integrations
  • disable cache and transcoding (to save my SD card from wear)
  • disable Favourites / Stars
DataFolder = '/mnt/dietpi_userdata/navidrome/data'
MusicFolder = '/mnt/data/Music/'
LogLevel = 'error'
SessionTimeout = '24h'
AuthRequestLimit = '5'
AuthWindowLength = '20s'
ScanSchedule = '@every 1h'
EnableLogRedacting = 'true'
Scanner.Extractor = 'taglib'
EnableInsightsCollector = 'false'
CoverJpegQuality = '75'
CoverArtPriority = 'embedded'
AutoTranscodeDownload = 'false'
Deezer.Enabled = 'false'
EnableExternalServices = 'false'
EnableFavourites = 'false'
EnableGravatar = 'false'
EnableStarRating = 'false'
ImageCacheSize = '0'
LastFM.Enabled = 'false'
ListenBrainz.Enabled = 'false'
TranscodingCacheSize = '0'
UILoginBackgroundUrl = ''

Upload Music via File Browser

Rather than NFS or Samba, I install File Browser also via dietpi-software. File Browser is a web-based remote file manager, and I sue this to upload Music to my device.

The default setup exposes the File Browser web UI on port 8084 with /mnt as the default data directory.

Playback via the Navidrome Web UI

Easy, nothing to install.

Alas, the web UI does not support Jukebox mode. Jukebox mode is playing music on the DietPi’s audio output itself, rather than streaming audio to the client.

Playback via Amperfy for MacOS and iOS

I use Amperfy which is open-source, and has free apps availabe on the Mac App Store and iOS App Store

They integrate well with the OS and even support features like lyrics! Amperfy does not support Jukebox either.

OwnTone

I want to be able to stream music to AirPlay enabled devices (like a Mac or HomePod). Searching high and low, the only easy-to-deploy solution I found was OwnTone. OwnTone is an open-source audio media server that streams audio to iTunes (DAAP1), Roku (RSP), AirPlay devices (multi-room), and Chromecast!

It is not available in the DietPi software list, but is, fortunately, easy to install. The documentation points to a guide for installing on Raspberry Pi, but the steps are identical for DietPi:

wget -q -O - http://www.gyfgafguf.dk/raspbian/owntone.gpg | sudo gpg --dearmor --output /usr/share/keyrings/owntone-archive-keyring.gpg
sudo wget -q -O /etc/apt/sources.list.d/owntone.list http://www.gyfgafguf.dk/raspbian/owntone-bookworm.list
sudo apt update 
sudo apt install owntone

The default setup exposes the OwnTone server and web UI on port 3689. To configure, edit /etc/owntone.conf. The most important setting are shown below:

general {
    uid = "root"
    db_path = "/mnt/dietpi_userdata/owntone/songs3.db"
    logfile = "/var/log/owntone.log"
    loglevel = fatal
#   cache_dir = "" 
}
library {
    name = "My music on %h"
    port = 3689
    directories = { "/mnt/dietpi_userdata/Music" }
}

Again, to reduce SD wear, I disabled the cache. I just need OwnTone as a remote control for AirPlay.

OwnTone uses up more resident memory than Navidrome, so the choice is yours. I do have problems with AirPlay and have to re-start OwnTone quite a bit.

Playback via the OwnTone Web UI

To enable paring with an AirPlay device (a Mac or speaker), ppen the Web UI and head to Settings. Devices are discovered automatically via mDNS, so just enable it and enter the pairing code if applicable.

I tried playback to a mac, and I noticed it does not sync well with the Control Center controls to play or pause audio. Just don’t use the Web UI from a mac... instead use the built-in Music App!

Playback via macOS Music App

This is probably the best player since it integrates so well with the OS Control Center.

  • Open the Music.app.
  • In the navigation tree-vew on left, right click My Library
  • Change it to My Music on DietPi or whatever your device is called, per configuration in the file above. This external “library” should automatically be discovered...
    • if it is not discovered, you’ll need to restart OwnTone.
    • if it is discovered but selecting it does nothing then, you’ll need to restart OwnTone.
  • Navigate your albums and play as normal, either from the Music app or the Control Center.

Alas, external Lyrics are not supported.

Conclusion

I use Navidrome as my music server. If I knew how to configure it in Jukebox mode to connect via Airplay then I would not need OwnTone. I sadly can’t figure it out.