Skip to content

About

Play and rip audio CDs on Linux: track list, MusicBrainz metadata, album art, FLAC/MP3/WAV ripping. Python + Qt. Linux only.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Linux CD Player

Linux only. This app uses Linux CD-ROM device interfaces (/dev/sr*, kernel CDROM_* ioctls) and the cdparanoia CD reader. It does not run on Windows or macOS, and there are no plans to port it.

A small desktop app to play audio CDs, browse the track list with album art, and rip tracks to FLAC, MP3 or WAV. Built with Python and Qt (PySide6).

Screenshot with demo data Screenshot taken with a fake test disc (no real album art or data).

Features

  • Auto-detects your optical drive and disc. Insert or eject a disc and the app notices within ~2 seconds.
  • Track list with titles, artists and lengths, looked up on MusicBrainz by disc ID. If several releases match (different pressings), pick one from a dropdown.
  • Album art from the Cover Art Archive.
  • Playback: play / pause / stop / previous / next, seek bar, volume, eject. Double-click a track to play it.
  • Ripping to FLAC, MP3 (V0) or WAV, with full cdparanoia error correction:
    • choose which tracks to rip (checkboxes, All/None),
    • tags written (title, artist, album, album artist, track number, year) and cover art embedded,
    • output organised as Artist/Album (Year)/NN - Title.ext, plus a cover.jpg,
    • overall progress bar and a cancel button.
  • Editable metadata: album, artist, year and every title/artist cell are editable. Useful when a disc isn't on MusicBrainz or you want different tags.

Requirements

What Why
Linux with an optical drive (internal or USB) reads the disc
Python 3.10+ runtime
PySide6 (Qt 6) GUI and audio output
requests MusicBrainz and Cover Art Archive lookups
cdparanoia reads and rips audio CDs
ffmpeg (with ffprobe) encodes FLAC/MP3 and writes tags + cover art

Your user needs read access to the drive (/dev/sr0). On most desktop distros the logged-in user gets this automatically; otherwise add yourself to the cdrom group.

MP3 output needs an ffmpeg built with libmp3lame. On Fedora that means the full ffmpeg from RPM Fusion (ffmpeg-free lacks it). FLAC and WAV work with any ffmpeg.

Install

1. System packages

Distro Command
Fedora / Nobara sudo dnf install cdparanoia ffmpeg python3-pip (ffmpeg from RPM Fusion for MP3)
Bazzite / Silverblue / Kinoite (atomic) sudo rpm-ostree install --apply-live cdparanoia (no reboot needed; ffmpeg is usually preinstalled)
Debian / Ubuntu / Mint sudo apt install cdparanoia ffmpeg python3-pip
Arch / Manjaro sudo pacman -S cdparanoia ffmpeg python-pip
openSUSE sudo zypper install cdparanoia ffmpeg python3-pip

2. Python packages

pip install --user -r requirements.txt

On distros that block system-wide pip (PEP 668), use a virtual environment:

python3 -m venv .venv && . .venv/bin/activate && pip install -r requirements.txt

3. Get the app and (optionally) add a launcher

git clone https://github.com/kranmal/linux-cd-player.git
cd linux-cd-player
./install.sh        # copies to ~/.local/bin and adds an app-menu entry

Or just run it in place: python3 cdplayer.py. To remove the launcher: ./install.sh --uninstall.

Usage

  1. Start the app (cdplayer after install.sh, or python3 cdplayer.py).
  2. Insert an audio CD. The track list, tags and cover art load automatically.
  3. Play: double-click a track, or press ▶. Use the slider to seek.
  4. Rip: tick the tracks, pick a format and output folder (default ~/Music), press Rip checked tracks. The folder opens when finished.

The status bar at the bottom tells you what the app is doing (reading disc, looking up album, ripping, errors).

How it works (short version)

  • The drive is polled every 2 s using the kernel's CDROM_DRIVE_STATUS ioctl (cheap, does not spin up the disc).
  • The table of contents comes from cdparanoia -Q. The MusicBrainz disc ID is computed in pure Python and looked up via the MusicBrainz web service, with a fuzzy TOC fallback.
  • Playback streams raw PCM from cdparanoia into a Qt QAudioSink (no GStreamer CD plugins needed). Seeking restarts the stream at a time offset.
  • Ripping runs cdparanoia per track to a temp WAV, then ffmpeg encodes and tags it.

See docs/ARCHITECTURE.md for details and docs/TROUBLESHOOTING.md if something doesn't work.

Testing

A hardware-free test suite uses a fake cdparanoia and requires no drive or network:

python3 tests/run_tests.py

It covers TOC parsing, disc ID calculation, playback timing, pause, seek, auto-advance, ripping to all three formats, tags and embedded cover art.

Known limitations

  • Tested on one setup: Fedora-based Bazzite (KDE, Wayland, PipeWire) with one USB drive and a standard audio CD. Other distros and drives should work but are untested.
  • Playback skips cdparanoia's error correction (to keep up in real time). Scratched discs may glitch when playing; ripping uses full correction.
  • No AccurateRip verification, no CUE sheet output, no CD-Text, no gapless/pregap handling, no multi-session or data/mixed-mode discs (audio tracks only).
  • Disc ID lookups on enhanced "CD-Extra" discs may not match; the fuzzy fallback usually finds them, and you can always edit tags by hand.
  • Pause is instant but the disc keeps being read ahead into memory for the current track.

Legal

Ripping is intended for discs you own, for personal backup and format shifting. Copyright law differs by country. You are responsible for complying with the laws that apply to you. The author accepts no liability for how you use this software.

Metadata comes from MusicBrainz (CC0 core data) and artwork from the Cover Art Archive. The app identifies itself with a User-Agent and keeps to MusicBrainz's 1 request/second limit. Please don't remove that.

Contributing

Issues and pull requests are welcome. Please run python3 tests/run_tests.py before submitting. If you test on other distros or drives, reports of what worked (or didn't) are very useful.

License

MIT

About

Play and rip audio CDs on Linux: track list, MusicBrainz metadata, album art, FLAC/MP3/WAV ripping. Python + Qt. Linux only.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages