cmdradio: The Ultimate Guide for Beginnerscmdradio is a lightweight command-line tool designed for streaming, managing, and interacting with internet radio sources. Whether you’re a developer who prefers terminal-based workflows, a power user automating playlists, or a casual listener who likes minimal interfaces, cmdradio offers a compact, scriptable way to play and control radio streams without the overhead of graphical players.
What cmdradio is and why it exists
Many radio players target GUI users and bundle features most terminal users don’t need. cmdradio focuses on simplicity, speed, and automation, making it ideal for headless systems, scripts, and users who prefer the command line. It typically supports common streaming formats (HTTP, SHOUTcast, Icecast), playlist files (M3U, PLS), and basic playback control features.
Key features (common across implementations)
- Stream playback from URLs or local playlist files
- Support for common stream formats (HTTP, MMS, Icecast/Shoutcast)
- Play, pause, stop, skip, and volume control via commands or flags
- Metadata display (track title, artist, stream name)
- Lightweight dependencies and low memory footprint
- Scripting-friendly — can be piped into shell scripts or cron jobs
- Optional recording or saving currently playing stream to file
- Minimal configuration, often via a small config file or environment variables
Installation
Installation methods vary by operating system and how cmdradio is packaged. Typical options include:
- Prebuilt binaries (download from project releases)
- Package managers (apt, Homebrew, pacman) if available
- Building from source (git clone, compile)
- Containerized use (Docker image)
Example (Ubuntu, generic steps):
- Install dependencies (e.g., build-essential, libcurl, alsa/pulseaudio dev libs).
- Clone the repository: git clone https://example.com/cmdradio.git
- Build: cd cmdradio && make
- Install: sudo make install
Example (Homebrew on macOS): brew install cmdradio
Basic usage
Typical invocation patterns (flags and exact syntax vary by implementation):
-
Play a stream URL: cmdradio play https://stream.example.com:8000/stream
-
Play a local playlist: cmdradio play ~/my-radio.m3u
-
Pause/resume: cmdradio pause cmdradio resume
-
Stop: cmdradio stop
-
Set volume (0–100): cmdradio volume 75
-
Show metadata: cmdradio info
Use the built-in help to see exact commands: cmdradio –help
Examples and common workflows
-
Run cmdradio on a headless Raspberry Pi and start at boot
- Add a systemd service that runs cmdradio play
on startup. - Use alsa or PulseAudio sink configured to your USB DAC or HiFi hat.
- Add a systemd service that runs cmdradio play
-
Record a favorite show to disk
- Start recording to a file: cmdradio record https://stream.example.com show1.mp3
- Automate start/stop with cron and a small shell script.
-
Build a custom aggregator script
- Maintain a text file of favorite stream URLs.
- Loop through URLs and play each for a set time using sleep and cmdradio play/stop.
-
Integrate with Home Assistant or other automation
- Use command-line switches or scripts invoked by your home automation system to control playback.
Configuration tips
- Configure default audio output (ALSA device, PulseAudio sink) in the config file or via environment variables.
- Set a reconnect policy for unstable streams (e.g., retry 5 times with exponential backoff).
- Limit disk usage if you enable recording (rotate files, keep last N recordings).
- If your streams use metadata, map metadata fields to display format you prefer (e.g., “Artist — Title”).
Troubleshooting
- No sound: check system audio (alsamixer, pactl), ensure cmdradio uses correct sink/device.
- Broken or unsupported stream: verify the URL in a browser or with ffmpeg/streamlink.
- Frequent disconnects: increase timeout/retry settings and test network stability.
- Metadata missing: some streams don’t send metadata; try another stream to confirm.
Alternatives and when to choose cmdradio
If you need graphical interfaces, advanced library management, or podcast features, consider players like VLC, Clementine, or Rhythmbox. Choose cmdradio when you want:
- Lightweight, scriptable playback
- Headless operation
- Easy automation and integration in shell environments
Security and privacy considerations
- Streams are typically unencrypted (HTTP). Prefer HTTPS streams when available.
- Running cmdradio on public machines or servers may expose stream URLs; treat them like any other configuration secret if needed.
- If recording, respect copyright and licensing of streams.
Extending cmdradio
- Plugins or scripts: add features like automatic song tagging, integration with scrobblers (Last.fm), or posting now‑playing info to social media.
- Web UI front-end: lightweight web server that issues cmdradio commands for users preferring a browser.
- Mobile remote control: expose a secure API endpoint for remote commands from your phone.
Resources and learning
- Project README and man page for exact flags and examples
- Audio subsystem docs (ALSA, PulseAudio) for output configuration
- Examples and community scripts to learn common automations
If you’d like, I can:
- Write a ready-to-use systemd service file to start cmdradio on boot.
- Create example shell scripts for rotating recordings or scanning playlists.
- Draft a short man-page-style cheatsheet with exact commands for a specific implementation — tell me which OS or cmdradio version you’re using.
Leave a Reply