Junk Drawer Cellphone as a Music Streaming Server
I wished to get a music streaming server working as I’ve up to now however with the shortage of RasberryPi’s my I wanted to strive one thing new. I had a Samsung Galaxy S7 that had been taking on house in my junk drawer and this put up is my journey to offer it a brand new activity.
First step was remembering why I finished utilizing it. Attempting to cost it revealed that the charging port was damaged. I didn’t wish to dig too deeply into the system however I bought fortunate and was given one other S7 with a foul battery. After destructively taking them aside I used to be in a position to swap the batteries and get a working system.
First Strive, No Root, Inventory Android
Ideally I wouldn’t must root the telephone and will simply get it to tackle its new position utilizing its present fireware.
With that aim in thoughts my first try was utilizing Termux. It’s an superior terminal emulator wrapped up as an Android app.
One in all Termux limitations is that it may well’t run binaries even when they’ve been constructed for an identical ARM archetecture. As such I needed to construct my music streaming server of alternative, Navidrome on the system. One hickup with this course of is that the JS construct course of eats up all of the RAM on the system however constructing it on a bigger machine and sending it over sidesteps that situation and the Go construct course of can then bundle it up.
As soon as I bought every little thing setup I had a working music server BUT due to the restricted RAM of the S7, Termux appeared to get agressively killed by Android, despite the fact that it was an outdated system working Android v6 (which didn’t have most of the battery optimizations to kill apps). Even with termux-wake-lock, termux:Boot and every little thing setup as rundit providers I might see server outages.
After a number of days I attempted once more.
Second Strive, PostmarketOS
PostmarketOS could be ultimate for this sort of mission and would flip the telephone right into a dependable linux field BUT except you occur to have (or purchase) one of many units which are properly supported you both must get fortunate with one of many non-mainline (testing) units. In my case there have been working builds however after I bought every little thing on the system it turned out that assist had regressed and it’s at present (on the time of writing) non-bootable.
It might proably be enjoyable however timeconsuming to be taught sufficient in regards to the ecosystem so I shelved the mission for a pair days till…
Third Strive LineageOS
Having run LineageOS up to now I assumed it is perhaps light-weight sufficient to unlock sufficient RAM for Termux to be extra lengthy lived. Setting this up was simple since I already had TWRP restoration on the system from the PostmarketOS try.
As soon as LineageOS was on the system I disabled/uninstalled every little thing non-essential and repeated my setup course of from my preliminary Android try. My setup appears to be like like:
All my music wouldn’t match on the units inner reminiscence and never having a spare SD card I made a decision to transcode all of it to OPUS. I then came upon that it isn’t supported in IOS (and I at present use an IPhone) except its in a CAF container and Navidrome doesn’t assist CAF. Thus I transcoded every little thing to mp3 at a decrease bitrate that was nonetheless acceptable to my ears.
With that I’ve a faily highly effective and dependable music server(based mostly on a number of weeks of utilization). I’m preserving a watch out for any units with good PostmarketOS assist to strive that once more.
The setup information for this may be discovered on github.