A lightweight, standalone audio CD player written in Python using VLC and hardware GPIO controls, built specifically for the Raspberry Pi.
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+.
- 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).
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.
- 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
Note: It is strongly recommended to install and run this application inside a Python virtual environment (
venv).
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 \
gccClone 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- Review and adjust pinouts and settings in
config.inito match your hardware layout. - Run the application:
python boot.pyTo 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:
libiso9660andlibcdio-utilsare 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:
lgpiomay need to be compiled from source (see helper scripts ininstall_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')
Refer to the repository scripts and documentation for additional hardware integrations:
- 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
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.