diff options
author | mms <michal@sapka.me> | 2024-06-21 21:51:41 +0200 |
---|---|---|
committer | mms <michal@sapka.me> | 2024-06-21 21:51:41 +0200 |
commit | 969e012f115b2978c5bd41a76b5fcedbefdca5ae (patch) | |
tree | 2a7a634b1281cb06b73b15eb25d67f7a988e69f7 | |
parent | 1cf91fb865ab7914f0addeec87978711143033f2 (diff) |
fix: remove old file
-rw-r--r-- | content/articles/music-server.md | 159 |
1 files changed, 0 insertions, 159 deletions
diff --git a/content/articles/music-server.md b/content/articles/music-server.md deleted file mode 100644 index 93667dd..0000000 --- a/content/articles/music-server.md +++ /dev/null @@ -1,159 +0,0 @@ -+++ -title = "Adding simple music server to my network" -author = ["Michał Sapka"] -date = 2022-05-25T22:26:00+02:00 -lastmod = 2023-12-29T23:08:16+01:00 -categories = ["article"] -draft = false -weight = 2005 -abstract = "As part of my partitioning with streaming services, I have created a small music server on my home network. This article touches on how to get music, how to store and how to actually listen to it." -+++ - -_This is an old article, and even though it is still valid, I no longer use Linux_ - -One of my goals for 2022 is to not pay for music subscriptions anymore. -Nowadays, it's really easy and cheap to actually own my music. - - -## Getting music {#getting-music} - -Internet is full of cheap, used CDs and new music is ready for purchase on sites like Bandcamp. -Since I mostly listen to dead people, CDs are my primary source. - -The first problem is having something to put a disc in. -I've gotten myself a cheap USB-CD/DVD drive. -It's very loud, but since I use it only for getting the data to my computer, it's not a problem. - -I rip (a word that I have not seen in a long time) on MacBook using XLD app. -I plan to move this step to Linux soon. - -[XLD homepage](https://tmkk.undo.jp/xld/index_e.html) - -I rip the music to FLAC, which seems to be standard. -It's lossless and most file-based players have no problems with it. -Of course, not everywhere. -iOS is always problematic, but I don't listen to music on the go very often, so it's a problem for future me. - -A single album in FLAC takes about 200-300 MB. -I still remember MP3 days, where it would go down to 60 MB or less, but back then storage and transfer were actually expensive. -I don't hear any noticeable difference between FLAC and good compressed file, but again - storage and transfer is cheap, Furthermore I have a single high-res album where half an hour takes 750 MBMB and there is zero difference. -Well, now I know, and I won't buy-high res ever again :) - - -## Storing and serving music {#storing-and-serving-music} - -The music will be accessed by multiple devices on local network, so putting it on the Home Server makes perfect sense. -I now have a dedicated share "music" which is shared via Samba and NFS. - -Samba seems better than NFS, but then NFS on Linux is simpler to set up. - -For Samba, I need to add read+write access to Music share for each user from Synology web UI. - -NFS on the other hand doesn't support users, but devices instead. -The first step is to set static IP for my devices (which is always a good idea). -How exactly this should be approached depends on the setup, but I use UniFi Dream Machine and forcing IP for a device is very straight forward. -After I have static IPs, I can add read/write access for those addresses, also via Synology web UI. - -Served music is so small, that this does not add any noticeable overhead for the server. - - -## Accessing the music on Linux {#accessing-the-music-on-linux} - -First, I needed to install NFS support. I use Arch, so: - -```shell -pacman -S nfs-utils -``` - -Then I checked if the share actually exists. My server's address is 10.0.1.200. - -```shell -showmount -e 10.0.1.200 ------------------- -Export list for 10.0.1.200: -/volume2/music 10.0.1.10 -``` - -Voilà! Next step: check if it works - -```shell -mkdir /mnt/music -mount 10.0.1.200:/volume2/music /mnt/music/ -cd /mnt/music -ls -``` - -And listing worked. -Noice. -To automate it for future, and to allow non-root users to actually mount the drive I added a new mount to /etc/fstab: - -```shell -10.0.1.200:/volume2/music /mnt/music nfs _netdev,noauto,x-systemd.automount,x-systemd.mount-timeout=10,timeo=14,users,x-systemd.idle-timeout=1min 0 0 -``` - -After the first user accesses /mnt/music, the drive will be mounted. - - -## Playing the music using CMUS {#playing-the-music-using-cmus} - -We have access to the files, let's play it. -Every modern music player for Linux should work with Flac, but I've chosen CMUS. -It's fast, it's terminal based, and it supports VIM keybindings. - -[CMUS on Github](https://cmus.github.io/) - -```shell -pacman -S cmus -``` - -After we open cmus, we need to add music. -It's done similarly to VIM, via an ex command. - -```shell -:add /mnt/music/ -``` - -And a few seconds later, the music is visible in the player. -Using CMUS requires reading the manual - -```shell -man cmus-tutorial -``` - -but the basics I needed to play something from Artist/Album view were: - -| key | descrition | -|-------|---------------------------------------| -| j | go up | -| k | go down | -| tab | change active window (artists/tracks) | -| space | expand artist to album list | -| c | play track / pause track | -| e | add track to queue | -| q | exit | - -Extra bonus: after first configuring system I had some problems with audio not working from time to time. -Moving from Pulse to Pipewire solved them all. - -[Pipewire webpage](https://pipewire.org/) - - -## Listening on Mac via CMUS {#listening-on-mac-via-cmus} - -I have no idea how to auto mount a server on MacOS, so after every reboot or network change, I need access the Samba share via Finder. -After it's mounted, I can access it under /Volumes/music. - -On Mac I also use CMUS, so all of the above apply as well. -One difference is adding the files due to different location - -```shelll -:add /Volumes/music -``` - - -## Next up {#next-up} - -This doesn't solve all my needs. In the future I need to find out how to: - -- access the music outside my home network -- how to marry this setup with my multiroom system (Sonos + Homepods) |