This is my config to get snapcast working on android with termux and librespot. Requires the device to be rooted.
pkg update && pkg upgrade
pkg install git snapcast-server ffmpeg libandroid-spawn
git clone https://github.com/woliver99/snapcast-termux.git
bash "./snapcast-termux/setup.sh"
source "$HOME/.bashrc"
snapserver-start.sh
You might be wondering why im resampling librespot through ffmpeg. Currently Snap.Net iOS has a bug where it will crash if its not the default sampleformat. So i just end up resampling the librespot audio witch is 44.1kHz to 48kHz instead of properly fixing the problem.
- Properly kill ffmpeg
- Check if pid is running before killing
- Restart librespot stream after snapcast restart, Use: https://github.com/librespot-org/librespot-java/tree/dev/api