From 97259edc7f7d51e0728b5230da95c79f662a9d2e Mon Sep 17 00:00:00 2001 From: PedroEdiaz Date: Fri, 3 Oct 2025 15:47:00 -0600 Subject: [PATCH] README.md -> cdplayer.1 --- Makefile | 2 ++ README.md | 46 ------------------------------------- cdplayer.1 | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 46 deletions(-) delete mode 100644 README.md create mode 100644 cdplayer.1 diff --git a/Makefile b/Makefile index 55e9ad2..528acb3 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,8 @@ OBJ= \ CFLAGS = -Itinyalsa/include +all: $(BIN) + $(BIN): $(OBJ) $(CC) $(OBJ) -o $(BIN) diff --git a/README.md b/README.md deleted file mode 100644 index 8fd288f..0000000 --- a/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# cdplayer — Minimal CDDA Player for Linux - -**`cdplayer`** is a minimal CDDA (Compact Disc Digital Audio) player for Linux. -It plays audio CDs directly from `/dev/sr0` (or other CD devices) with almost -no dependencies — relying only on [**tinyalsa**](https://github.com/tinyalsa/tinyalsa). - - -## Features - -- Plays standard audio CDs via CD-ROM device -- Controlled using UNIX signals (no GUI or TUI) -- Depends only on `tinyalsa` for audio playback -- Extremely small and hackable C codebase - -## Build -To compile the program run `make` or: -```sh -cc -Itinyalsa/include -o cdplayer cdplayer.c tinyalsa/src/pcm.c tinyalsa/src/pcm_hw.c tinyalsa/src/snd_card_plugin.c -``` - -## Usage -```sh -./cdplayer cdrom [card=0] [device=0] -``` - -- `cdrom` — CD-ROM device like `/dev/sr0` -- `card` — ALSA sound card number (default: 0) -- `device` — ALSA PCM device number (default: 0) - -## Controls (via `kill`) -You can control playback using UNIX signals: - -Signal|Action -------|----- -`SIGUSR1`|Seek forward 1 minute -`SIGUSR2`|Seek backward 1 minute -`SIGSTOP`| Pause playback -`SIGCONT`| Resume playback - - -## Licence -0BSD – Zero Clause BSD License. See [LICENSE](./LICENSE) for details. -Feel free to use, modify, and share freely — no restrictions. - -## Contributing -Contributions are welcome! Feel free to submit issues or pull requests. diff --git a/cdplayer.1 b/cdplayer.1 new file mode 100644 index 0000000..4a281af --- /dev/null +++ b/cdplayer.1 @@ -0,0 +1,66 @@ +.TH CDPLAYER 1 "October 2025" "cdplayer 1.0" "User Commands" +.SH NAME +cdplayer \- A minimal CDDA (Compact Disc Digital Audio) player for Linux. +.SH SYNOPSIS +.B cdplayer +.I cdrom +[\fBcard=\fIN\fR] [\fBdevice=\fIN\fR] +.SH DESCRIPTION +.B cdplayer +is a lightweight command-line program to play audio CDs using the ALSA sound system. + +It reads raw audio from a CD-ROM device (such as +.I /dev/sr0 +) and outputs sound through the specified ALSA card and PCM device. + +By default, +.B cdplayer +uses ALSA card 0 and PCM device 0. +.SH OPTIONS +.TP +.I cdrom +CD-ROM device file, e.g. +.I /dev/sr0 +.TP +.B card=\fIN\fR +ALSA sound card number. Defaults to 0. +.TP +.B device=\fIN\fR +ALSA PCM device number. Defaults to 0. +.SH SIGNALS +Playback can be controlled by sending signals to the +.B cdplayer +process: +.TP +.B SIGUSR1 +Seek forward 1 minute. +.TP +.B SIGUSR2 +Seek backward 1 minute. +.TP +.B SIGSTOP +Pause playback. +.TP +.B SIGCONT +Resume playback. +.SH EXAMPLES +Play a CD from the first drive on the default sound card: +.RS +.nf +cdplayer /dev/sr0 +.fi +.RE + +Play a CD using ALSA card 1, device 0: +.RS +.nf +cdplayer /dev/sr1 card=1 device=0 +.fi +.RE +.SH LICENSE +0BSD \- Zero Clause BSD License. +.SH AUTHOR +Written by +.MT ppedroediaz@gmail.com +Pedro E. Díaz +.ME