cTune is a ncurses based internet radio player written in C for Linux.
Aside from playing a radio stream you can search and browse stations as well as keep a list of favourites.
It uses the RadioBrowser API to search and get radio stream information.
Click here to watch the video (~45MB)
- Play/search/browse radio stations using the RadioBrowser API
- Favourite stations from search/browse results
- Add/Edit custom local-only stations to favourites
- Sort favourites based on name/country/bitrate/codec/source/etc...
- Context-based help for key bindings (F1 key).
- Plugin system for playback (demuxing/resampling) and sound output (PCM)
- UI Themes
- Mouse support
Usage: ./ctune [OPTION]...
--debug prints out all debug messages to the log
-f --favourite add station to favourites when used in conjunction with "--play"
-h --help display this help and exits
-p --play "UUID" plays the radio stream matching the RadioBrowser UUID
-r --resume resumes station playback of the last session
--show-cursor always visible cursor
-v --version prints version information and exits
type | file name | path | description |
---|---|---|---|
executable | ctune |
/usr/bin/ |
cTune application binary |
man | ctune.1.gz |
/usr/share/man/man1/ |
cTune man page |
configuration | ctune.cfg |
~/.config/ctune/ |
where the configuration is stored |
configuration | ctune.fav |
~/.config/ctune/ |
where the favourite stations are stored |
logging | ctune.log |
~/.local/share/ctune/ |
log file for last runtime (date/timestamps inside are UTC) |
logging | playlog.txt |
~/.local/share/ctune/ |
playback log containing the stations and songs streamed during last runtime* |
*In case you want to find the name of a song/station that you liked and forgot to write down or favourite.
Both the application log and playback log are overwritten when ctune
is launched again.
Most configuration options are accessible via the options menu.
Click here for a full breakdown of the configuration file's key-value pairs.
functionality | libraries |
---|---|
Network | OpenSSL, POSIX sockets, Curl |
Playback | FFMpeg/VLC, Pipewire/SDL2/PulseAudio/ALSA/sndio |
Recording | lame |
Parsing | json-c (static) |
Requires the following to be installed on the system first:
cmake
version 3.17 and the CMake extra-modules packagegit
for fetching the reposffmpeg
,vlc
player libraries*lame
for recording streams to mp3curl
andopenssl
librariessdl2
orpulsedaudio
oralsa
orsndio
orpipewire
sound library/servers*pandoc
andgzip
for the man page
(*) The relevant plugins will be compiled for whatever libraries can be found on the system.
From there:
- Clone the repository
git clone https://github.com/An7ar35/ctune.git
- Get in the directory with
cd ctune
- run
cmake . -DCMAKE_BUILD_TYPE=Release
(append-DCMAKE_INSTALL_PREFIX=</path/to/directory>
if you want to specify a custom directory for the installation) - run
cmake --build .
- run
sudo cmake --install .
- Done.
Just run sudo xargs rm < install_manifest.txt
from within the cloned directory.
Or, alternatively:
cmake . -DCMAKE_BUILD_TYPE=uninstall
sudo cmake --build . --target uninstall
Finally, for both approaches, run sudo mandb
after to purge the ctune
entry for the man database
The package is available in the AUR repository under ctune-git
. Install using your favourite AUR package browser/installer.
Alternatively just download the
PKGBUILD
file into an empty staging folder and runmakepkg -si
from inside. The rest should take care of itself.
The version of ffmpeg libs packaged with ubuntu 22.04.1 LTS are too old. Since the API changed I've updated the calls in ctune which breaks compilation for older ffmpeg libs.
No PPA but here are copy/paste commands to install all the required programs and development libraries you would need before compiling ctune
:
sudo apt-get install gcc libncurses5 git cmake cmake-extras make man pandoc gzip
sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev libavdevice-dev libavfilter-dev libssl-dev libcurl4-openssl-dev libncurses5-dev libbsd-dev libpulse-dev lame
For more input/output plugins, install the required lib too. Once all these are on the system compiling from source should work without hiccups.
Docker is only there for testing purposes and only works on linux with either pulseaudio
or pipewire-pulse
installed and running.
It uses the Arch docker image as base. The docker-compose.sh
script creates the container and runs it (final size = ~1GB).
Linux x64 with a UTF-8 locale.
As a baseline v1.3.2 works on ArchLinux with:
- FFMpeg (libavformat 59.27.100, libavcodec 59.37.100, libswresample 4.7.100)
- VLC (3.0.21)
- Pipewire (1:1.2.2)
- PulseAudio (17.0)
- SDL (2.30.6)
- ALSA (1.2.12)
- sndio (1.7.0)
- OpenSSL (3.3.1)
- Curl (8.9)
- nCurses (6.5)
- libbsd
- lame (3.100)
Q. What are the key bindings?
A. Press F1
to get a contextual list of key bindings in the UI.
Q. How do I use the mouse?
A. Check out this guide.
Q. I'm getting weird symbols where the icons are supposed to be. What's going on?
A. Your terminal font does not support the unicode characters used. Either change the font or switch back to ASCII icons from the Options menu.
Q. Can I change the look?
A. Yes. There are internal preset themes available in the Options menu and, if these don't strike your fancy, a custom theme can be specified inside ctune's configuration file.
Disclaimer: I've writen this software primarily for myself so temper your support-level expectations accordingly.
That being said, if you find a bug you are welcome to open a ticket. I'll try to deal with it time allowing. Same for bug PRs.
For tickets, please include the following to help diagnose the source of the problem:
- Basic information:
- (UI bugs) Terminal/Shell used if it's a UI bug (e.g.: Konsole 21.04 using BASH 5.1.8)
- Version of cTune used and what sound output/libraries it was compiled/run against (run
ctune --version
to get a print out of all that info)
- Bug description
- What seems to break and where
- What triggers the bug - how did the bug manifest itself + steps to reproduce it
- (UI bugs) A screenshot of the issue
- Logs and Configuration
- Configuration used (see inside
ctune.cfg
) - The cTune error log (run
ctune --debug
to generate more granular and useful info during execution) - Copy of the system log's (
syslog
) cTune runtime specific entries where the bug occurred (output ofjournalctl --utc -b -0 | grep ctune
if you're usingsystemd
)
- Configuration used (see inside
Thank you.
Copyright @ 2020-24 E.A.Davison.
Licensed under AGPLv3