Skip to content

About

a simple cd player written in python made with raspberry pi in mind

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

68 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💿 Raspberry Pi Python CD Player

A lightweight, standalone audio CD player written in Python using VLC and hardware GPIO controls, built specifically for the Raspberry Pi.

Python Platform License: GPL-3.0


📖 Overview

This project turns a Raspberry Pi into a dedicated, low-latency CD player with a physical interface (1602 LCD and tactile buttons).

Unlike heavy media distributions, this player is built for speed and resource efficiency—running at ~1.5% CPU utilization on a Raspberry Pi 3B+.

Key Features

  • Ultra-low Resource Footprint: Minimal CPU and RAM usage powered by Python and python-vlc.
  • Physical Controls: 6 hardware buttons for playback navigation and an HD44780 1602 LCD screen for track info.
  • Fast Boot Ready: Tested and optimized for both Raspberry Pi OS and Alpine Linux (for near-instant boot times).
  • Expandable Audio: Works with standard outputs and external I2S DACs (e.g., PCM5102).

🎯 Motivation

After building a custom TPA3116 amplifier to replace a budget stereo receiver, the jump in audio quality inspired the creation of a dedicated physical CD player.

Existing solutions had key drawbacks:

  • Volumio: Locked core CD playback functionality behind a subscription paywall, and third-party plugins (like Nanomesher) spun the disc drive at full speed, creating excessive acoustic noise.
  • rAudio: Suffered from intermittent playback stuttering and audio lag.

The goal here was to create a lean, quiet, distraction-free player that boots fast and plays directly via physical buttons and a screen—no sluggish web UI required.


🛠️ Hardware Requirements

  • Raspberry Pi (tested on Raspberry Pi 3 Model B+)
  • USB or SATA (via adapter) CD/DVD drive
  • 1602 LCD Display (I2C or direct GPIO)
  • 6x Tactile Push Buttons (Play/Pause, Stop, Next, Previous, etc.)
  • (Optional) PCM5102 I2S DAC for high-fidelity analog audio output

📦 Installation & Setup

Note: It is strongly recommended to install and run this application inside a Python virtual environment (venv).

1. System Dependencies (Raspberry Pi OS / Debian)

Install the required audio and build packages:

sudo apt-get update
sudo apt-get install -y \
  python3 \
  python3-pip \
  python3-venv \
  vlc \
  libiso9660-dev \
  libcdio-dev \
  libcdio-utils \
  libdiscid0-dev \
  swig \
  cython \
  gcc

2. Repository & Virtual Environment Setup

Clone the repository and set up your Python environment:

git clone https://github.com/trybula/RpiPythonCDPlayer.git
cd RpiPythonCDPlayer

# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r install_scripts/pip_requirements.txt

3. Configuration & Running

  1. Review and adjust pinouts and settings in config.ini to match your hardware layout.
  2. Run the application:
python boot.py

🏔️ Alpine Linux Notes (Fast Boot)

To drastically reduce cold-boot times, this player can be run on Alpine Linux. A few tips if you decide to go this route:

  • Missing Libraries: libiso9660 and libcdio-utils are generally not required on minimal Alpine configurations.
  • GPIO Permissions: Ensure your user account is in the appropriate GPIO group or permissions are set in /dev/gpio*.
  • lgpio Compilation: lgpio may need to be compiled from source (see helper scripts in install_scripts/lgpio_compile.sh).
  • ALSA Output: If audio routes to a dummy output device by default, initialize VLC with direct ALSA parameters in your script:
    instance = vlc.Instance('--aout=alsa', '--alsa-audio-device=plughw:0,0')

📚 Guides & Extra Setups

Refer to the repository scripts and documentation for additional hardware integrations:


🗺️ Roadmap

  • Add optional Web UI for remote status checking
  • Optimize display refresh loop (redraw LCD content only when track data changes)
  • Complete E-Paper Display (EPD) integration guide

📄 License

This project is open-source software licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for details.



### Key Improvements Made:
1. **Professional Formatting:** Added badges, section hierarchy, clean bullet points, and syntax-highlighted shell blocks.
2. **Improved Tone:** Softened informal phrasings (e.g., *"idk why"* and *"some time ago i made"*) into clear, informative engineering context while retaining the personal project motivation.
3. **Clearer Installation Flow:** Separated system dependencies from Python package requirements and clarified the use of `venv`.
4. **Structured Hardware & OS Sections:** Broken down requirements and the Alpine Linux tips into skimmable bullet points.

About

a simple cd player written in python made with raspberry pi in mind

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages