Change README for manpage
This commit is contained in:
5
Makefile
5
Makefile
@@ -7,9 +7,14 @@ OBJ= \
|
|||||||
|
|
||||||
CFLAGS = -Itinyalsa/include
|
CFLAGS = -Itinyalsa/include
|
||||||
|
|
||||||
|
all: $(BIN) README
|
||||||
|
|
||||||
$(BIN): $(OBJ)
|
$(BIN): $(OBJ)
|
||||||
$(CC) $(OBJ) -o $(BIN)
|
$(CC) $(OBJ) -o $(BIN)
|
||||||
|
|
||||||
|
README: cdplayer.1
|
||||||
|
mandoc $< > $@
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
clang-format -i cdplayer.c
|
clang-format -i cdplayer.c
|
||||||
|
|
||||||
|
|||||||
54
README
Normal file
54
README
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
CDPLAYER(1) User Commands CDPLAYER(1)
|
||||||
|
|
||||||
|
NNAAMMEE
|
||||||
|
cdplayer - simple CD audio player using ALSA
|
||||||
|
|
||||||
|
SSYYNNOOPPSSIISS
|
||||||
|
ccddppllaayyeerr _c_d_r_o_m [ccaarrdd==_N] [ddeevviiccee==_N]
|
||||||
|
|
||||||
|
DDEESSCCRRIIPPTTIIOONN
|
||||||
|
ccddppllaayyeerr 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 _/_d_e_v_/_s_r_0 ) and outputs
|
||||||
|
sound through the specified ALSA card and PCM device.
|
||||||
|
|
||||||
|
By default, ccddppllaayyeerr uses ALSA card 0 and PCM device 0.
|
||||||
|
|
||||||
|
OOPPTTIIOONNSS
|
||||||
|
_c_d_r_o_m CD-ROM device file, e.g. _/_d_e_v_/_s_r_0
|
||||||
|
|
||||||
|
ccaarrdd==_N ALSA sound card number. Defaults to 0.
|
||||||
|
|
||||||
|
ddeevviiccee==_N
|
||||||
|
ALSA PCM device number. Defaults to 0.
|
||||||
|
|
||||||
|
SSIIGGNNAALLSS
|
||||||
|
Playback can be controlled by sending signals to the ccddppllaayyeerr process:
|
||||||
|
|
||||||
|
SSIIGGUUSSRR11
|
||||||
|
Seek forward 1 minute.
|
||||||
|
|
||||||
|
SSIIGGUUSSRR22
|
||||||
|
Seek backward 1 minute.
|
||||||
|
|
||||||
|
SSIIGGSSTTOOPP
|
||||||
|
Pause playback.
|
||||||
|
|
||||||
|
SSIIGGCCOONNTT
|
||||||
|
Resume playback.
|
||||||
|
|
||||||
|
EEXXAAMMPPLLEESS
|
||||||
|
Play a CD from the first drive on the default sound card:
|
||||||
|
cdplayer /dev/sr0
|
||||||
|
|
||||||
|
Play a CD using ALSA card 1, device 0:
|
||||||
|
cdplayer /dev/sr1 card=1 device=0
|
||||||
|
|
||||||
|
LLIICCEENNSSEE
|
||||||
|
0BSD - Zero Clause BSD License.
|
||||||
|
|
||||||
|
AAUUTTHHOORR
|
||||||
|
Written by Pedro E. Díaz <ppedroediaz@gmail.com>
|
||||||
|
|
||||||
|
cdplayer 1.0 October 2025 CDPLAYER(1)
|
||||||
46
README.md
46
README.md
@@ -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.
|
|
||||||
66
cdplayer.1
Normal file
66
cdplayer.1
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
.TH CDPLAYER 1 "October 2025" "cdplayer 1.0" "User Commands"
|
||||||
|
.SH NAME
|
||||||
|
cdplayer \- simple CD audio player using ALSA
|
||||||
|
.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
|
||||||
Reference in New Issue
Block a user