| Crates.io | somars |
| lib.rs | somars |
| version | 0.1.3 |
| created_at | 2025-07-16 15:40:19.499087+00 |
| updated_at | 2025-07-16 15:40:19.499087+00 |
| description | A rusty soma.fm player |
| homepage | https://github.com/skammer/somars |
| repository | https://github.com/skammer/somars |
| max_upload_size | |
| id | 1755689 |
| size | 590,283 |

A Rust implementation of a SomaFM internet radio player with TUI interface and UDP control.
cargo install --path .
Note: Requires pkg-config and libasound2-dev (Linux) for audio support:
sudo apt-get install pkg-config libasound2-dev
Note: The default UDP port is 8069. When using --listen, ensure the port is available.
Use --port to specify a different port for both listening and broadcasting.
somars [OPTIONS]
--log-level <1|2> - Log verbosity (1=minimal, 2=verbose)--station <ID> - Auto-play station on startup (e.g., groovesalad)--listen - Enable UDP control listener--port <NUM> - Set UDP port for both listening and broadcasting [default: 8069]--broadcast <MSG> - Send UDP command to network and exitplay - Start/resume playback
stop - Stop playback
volume up - Increase volume by 10%
volume down - Decrease volume by 10%
volume <N> - Set volume (0.0-2.0)
tune <ID> - Switch to station by ID
tune next - Switch to next station (wraps around)
tune prev - Switch to previous station (wraps around)
select up - Move selection up in station list
select down - Move selection down in station list
toggle - Toggle between play and stop
# Send play command (default port 8069)
echo "play" | nc -u -w0 localhost 8069
# Send to custom port
echo "volume 0.5" | nc -u -w0 localhost 9070
# Broadcast stop command to all instances on default port
somars --broadcast "stop"
# Broadcast to custom port
somars --port 9070 --broadcast "tune groovesalad"
# Using socat with broadcast
echo "tune groovesalad" | socat -u - udp-datagram:255.255.255.255:8069,reuseport,broadcast
↑/↓ - Navigate stations
Enter - Play selected station
Space - Toggle pause/play
+/- - Adjust volume
? - Toggle help screen
q - Quit
If you are getting errors that look like ALSA lib pcm.c: 8526: (snd_pcm_recover) underrun occurred being printed in terminal, try adding the following to /etc/default/alsa:
default-fragments = 5
default-fragment-size-msec = 2
/etc/pulse/daemon.conf:
CODE: SELECT ALL
default-fragments = 5
default-fragment-size-msec = 2
MIT License
Note: This project is not affiliated with SomaFM. Please support SomaFM at somafm.com.