navidrome reprise!

This commit is contained in:
Wouter Groeneveld 2022-03-05 15:38:55 +01:00
parent 2be4773255
commit fc09bb75f8
5 changed files with 72 additions and 2 deletions

View File

@ -13,7 +13,9 @@ The first major struggle. Should you create your own NAS/server[^nass] or should
[^nass]: I know these serve different purposes, but for brevity, let's not get into that.
**Power efficiency**. This excellent blog post on "[DIY NAS or Synology](https://blog.sugoi.be/posts/diy-nas-or-synology/)" sheds light on the (hidden) costs of creating your own machine. If you build your own system, a truly low-powered setup is difficult to achieve. A simple home PC PSU comes with way too much Watts (500+), usually needed to power Ryzen CPUs that easily drain more than `20 W` while idling. This is just the CPU: factor in motherboard, RAM, GPU, fans, ... and you've probably doubled that amount. The [2bay DS720+](https://www.synology.com/en-global/products/DS720+#specs) I ended up buying consumes `16.44 W` on access and `6.19 W` in hibernation. According to Sugoi's blog post, the difference in power over eight years is a surplus cost of `71%`! Given the ridiculous high prices of gas and electricity right now, I'd say store bought definitely wins here, even if you resort to smaller cases.
**Power efficiency**. This excellent blog post on "[DIY NAS or Synology](https://blog.sugoi.be/posts/diy-nas-or-synology/)" sheds light on the (hidden) costs of creating your own machine. If you build your own system, a truly low-powered setup is difficult to achieve. A simple home PC PSU comes with way too much Watts (500+), usually needed to power Ryzen CPUs that easily drain more than `20 W` while idling. This is just the CPU: factor in motherboard, RAM, GPU, fans, ... and you've probably doubled that amount[^meerk]. The [2bay DS720+](https://www.synology.com/en-global/products/DS720+#specs) I ended up buying consumes `16.44 W` on access and `6.19 W` in hibernation. According to Sugoi's blog post, the difference in power over eight years is a surplus cost of `71%`! Given the ridiculous high prices of gas and electricity right now, I'd say store bought definitely wins here, even if you resort to smaller cases.
[^meerk]: A [Meerkat mini desktop computer](https://system76.com/desktops/meerkat#specs) comes with a `120W` PSU. That's still a lot more than the NAS, but a lot less than your typical PC.
Our server is powered off between midnight and 7 AM. It's a local-only system, and even if it runs the DHCP and DNS server now, it's a great way to preserve both power usage and internet access at night. Self-constraints for the win!
@ -43,7 +45,7 @@ Right, so how much do hard disks costs? At first, I wanted to go for SSDs, not b
**RAID setup**. Another important note: HDDs are known to eventually fail. To protect your data, you're best off installing _multiple_ hard drives that function as a carbon copy. In case one fails, the other takes over. This is called a "RAID" setup, and there are multiple possibilities here. Of course, with only two bays, you're limited to RAID-1: one HDD is an exact copy of the other. That means that if you buy 2 x `4 TB`, there's not `8 TB` but only four available for you. If you buy a 4-bay system, you can resort to a hybrid setup or RAID-5: only one HDD will function as a copy, and there's room for expansion. The DS720+ does offer an external port that can connect with an (expensive) expansion bay, and two USB 3.0 ports that can connect `1 TB` USB HDDs.
If you were to rely on SATA SSDs, a Western Digital Red SA500 NAS SATA costs about `€525` for `4 TB`. Ouch! Just `1 TB` is still about `€120`, and you'd need two of them for a RAID setup. Just one tera is more than the fixed data we already have, so that's a no-go. Mechanical drivers it is---just make sure to dump that server in the basement or somewhere where the HDD rattle doesn't bother you.
If you were to rely on SATA SSDs, a Western Digital Red SA500 NAS SATA costs about `€525` for `4 TB`. Ouch! Just `1 TB` is still about `€120`, and you'd need two of them for a RAID setup. Just one tera is more than the fixed data we already have, so that's a no-go. Mechanical drives it is---just make sure to dump that server in the basement or somewhere where the HDD rattle doesn't bother you.
Unless I've made a grave mistake, two bays with `4 TB` disks more than suffices for us. The extra cost of four bays---"just in case"---from DS720+ to DS920+ (delta of about `€120`) is just not worth it.

View File

@ -0,0 +1,68 @@
---
title: "How To Stream Your Own Music: Reprise"
date: 2022-03-05T14:30:00+01:00
categories:
- retro
- software
tags:
- music
---
This is a follow-up to my own February blog post, [How To Enjoy Your Own Digital Music](/post/2022/02/how-to-enjoy-your-own-digital-music/). After thinking this through, buying a NAS, [and playing with it](/post/2022/02/thoughts-on-home-nas-systems/), now is the time to answer my own question: how to enjoy your own digital music collection nowadays?
Pinky swear it'll be my last post on self-hosting. For a while.
## The Why
The local record store owner told me I was the exception when I bought GZA's _Liquid Swords_ on CD. Almost all rap enthusiasts swear by LPs/vinyl---it's going through a real renaissance period. Most new LPs are priced at `€30` or more, and some older more obscure underground stuff is really hard to get. You guessed it: yet another hobby to sink too much money into. On the other hand, (digital) CDs are dirt-cheap. _Liquid Swords_ cost me `€6.90`. Ridiculously cheap---but that's a 1995 album. Most others are priced at around `€17`. Since I mostly listen to music while working (behind a PC) or on the road (in the car), I prefer digital audio.
While just relying on ripped `.mp3` files on your local HDD suffices, it's nice to have the ability to stream those. For me, the main advantage is having the collection available on-the-go, provided a music client has offline play capabilities. My smartphone's disk space is small, and I don't like having to re-copy/upload albums every so often. Yes, I've been spoiled with Spotify-like streaming services. It's damn handy, I'll give them that! A second advantage is easy sharing with family members.
## The How
Enter [Navidrome](https://www.navidrome.org/), a blazing fast "personal streaming service" that acts as your local Spotify server. It has been running in try-out mode for a few weeks and so far, I'm pretty impressed. It's simple, small, consumes little resources, can handle huge libraries, and immediately detects file changes. Do not expect the polish present in the current Spotify client though: the HTML5 client still has missing features (no universal search, no decent gapless playback, ...)---but still. You don't _have_ to rely on their default client.
To install docker, [use the offical Docker image](https://www.navidrome.org/docs/installation/docker/). If you have a Synology NAS, it's very easy: install the "Docker" application from the Package Center, click "Registry", find Navidrome, double-click to download. The only thing to configure is the volume; create a new shared folder called `music` and mount it at path `/music`. Done! Now the app should be available at your server IP:your local port (see screenshot below, mine's set at `9977`):
![](../navidrome-docker.jpg)
If you want to create a clean URL as an alias, setup the reverse proxy: go to Control Panel, click on Login Portal, tab Advanced, click on Reverse Proxy. Fill in the source (`HTTP`, hostname `cd.yourhost`, port `80`) and destination (`HTTP`, hostname `localhost`, port the local one set up in the Docker settings, mine's set at `9977`). This will not suffice, you also need a DNS server that tells you `yourhost` is actually your local server IP. Synology has a built-in DNS server (search for "DNS Server" in the Package Center), or you can rely on something like a Pi-Hole.
Great, now it's time to start populating that music folder! The location _does not matter_---Navidrome will auto-scan that path. After a while you can enjoy the music through a browser by simply surfing to `http://cd.yourhost/`:
![](../navidrome.jpg)
If you don't like the fact that it's a web app, no worries. Navidrome implements the Subsonic API, meaning all other music streaming clients that are compatible with Subsonic (development was stopped) are also compatible with Navidrome. [Here's a list of apps](https://www.navidrome.org/docs/overview/#apps) currently compatible with the Navidrome server. So far, I've tried:
- Subtracks for Android---a great looking app but no download play;
- Sonixd---a desktop client based on Electron that is slow, has issues with text rendering and doesn't listen to dedicated next/previous key buttons;
- Substreamer for Android and iOS---a mature smartphone app that fulfills all my wishes.
Linux users could also check out [Sublime Music](https://sublimemusic.app/) built on GTK. I haven't found a decent dedicated client for MacOS yet besides [SoundWaves](https://www.tellini.org/products/mac/soundwaves/) that I have yet to try. A [great overview of selfhosted music clients](https://github.com/basings/selfhosted-music-overview) can be found on GitHub. Some have true gapless playback, some feature download play. I really like Substreamer:
![](../substreamer.jpg)
It worked perfectly with Bluetooth in the car, it has light/dark modes, it can download albums if you want to keep your server local without having to open up a VPN tunnel, and it is very responsive. The iOS client is also good.
## The What
What to take into consideration when converting your CDs into `.mp3` files? Navidrome and its clients heavily rely on M3U meta tags. A music tagger such as [MusicBrainz Picard](https://picard.musicbrainz.org/), MP3Tag, or [Beets](https://beets.io/) is essential if you want to keep your library nice and clean. Picard and Beets rely on the online MusicBrainz database to auto-collect and upload metadata, which is a nice bonus in case you don't like typing it all out for yourself. That database is amazing, it even contains information about obscure Flemish compilations!
A few random tagging tips for Navidrome:
- If your CD is a compilation, set the `compilation` tag to `1`. Add `albumartist` as `Various Artists` if needed. For now, under the "Artist" tab, Navidrome can only search for `albumartist` tags. Search by song if you're looking for an artist on another compilation CD.
- If your album contains multiple CDs, set each `discnumber` accordingly, and if needed, add a `disctitle`. This will automatically show up in the Navidrome web app, but as far as I've tried, not be picked up by Substreamer.
- Think twice about the `genre` contents. It's a great way to quickly filter your collection.
- Dig up a `cover.jpg` file for each album, there's no need to embed it into the file itself, although it's possible.
- The `comment` tag is displayed below the album art. Go nuts!
As for the ripping itself, well... I still rely on my trusty [WinXP machine](/post/2020/10/building-a-core2duo-winxp-retro-pc/) and yes, still use [Audiograbber](https://www.audiograbber.org/) with `lame.exe`. Instant retro vibes! The LAME encoder comes with a few presets, of which probably only two are of use in 2022:
- The `--preset insane` option: a constant bit rate of `320 kbps`. The absolute highest quality but largest files. Average album sizes: `140 MB`.
- The `--preset extreme` option: a variable bit rate of around `260 kbps`. Still very high quality, I can't hear the difference and usually settle with this. Average album size: `105 MB`.
The jump in quality from `128 kbps` to 192 (and especially higher) is huge. It's up to you whether or not to exaggerate: if you have the space, why not. The Bandcamp albums are still downloaded as `.ogg` (+/- `190 kbps`), but the option to download larger files is there.
One last thing: invest in a good **headset** and **speaker**! The speakers of a MacBook or your average smartphone are laughably bad when trying to enjoy something with a deep bass or subtle tone differences. Over-ear Bose headphones are good enough for me, and the noise cancellation works wonders when my wife insists on watching TV. I realize better (and more expensive) options are available. I've enjoyed Sony in-ear buds too---while they lasted, before breaking down completely. Navidrome supports Sonos speakers through another daemon service, but I haven't tried that yet. Most of the heavy lifting is still done by the Pioneer box as seen in [my office setup](/post/2021/02/my-retro-desktop-setup/).
And that's how you stream your own music. Don't forget from time to time to dig through your CD collection and effectively use the CD itself on your retro Hi-Fi installation to sit down, relax, and do nothing but enjoy the music.

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB