Bit-perfect CD player for Raspberry Pi. Extracts audio to RAM with error correction via cdparanoia, then plays directly through ALSA. Eliminates read errors during playback.
- Bit Perfect Playback: Direct ALSA output, no alterations to PCM data
- RAM-based: Entire CD loaded to memory (eliminates read errors)
- Gapless: Seamless track transitions with double-buffer architecture
- CD-Text: Automatic metadata extraction (artist, album, track titles)
- Streaming Mode: Instant playback without RAM loading
- Classic Controls: Repeat (off/track/all), Shuffle, Quick Scan
- HEAD Display: MCUB Protocol v2.0.0 compatible (Arduino/ESP32)
- Hardware: GPIO buttons + WS2812 LED status indicator
- Raspberry Pi (tested on Pi 4)
- USB CD/DVD Drive
- cdparanoia (extraction)
- mpv (streaming mode)
- Optional: libcdio-utils (CD-Text), rpi-ws281x (LED), sg3-utils (SuperDrive)
git clone https://github.com/thestreamdigger/redram.git
cd redram
sudo ./install.shThat's it! Start with ./run.sh, insert CD, type load, then play.
# Full installation
sudo ./install.sh
# With Apple SuperDrive support
sudo ./install.sh --install-superdrive-udev
# Show help
./install.sh --helpscan - Quick CD check (~2s)
load [N] - Load CD (0=streaming, 1=standard, 2=precise, 3=rescue)
play - Play/pause toggle
pause - Pause/resume
stop - Stop playback
next/prev - Track navigation
goto N - Jump to track N
repeat - Cycle: off → track → all
shuffle - Toggle shuffle
tracks - List all tracks
eject - Eject CD
quit - Exit
> scan # Quick check (~2s)
> load # Load to RAM (~2-5 min)
> play # Start playback
> next # Next track (gapless)
> repeat # Enable repeat
> eject # Eject CD| Feature | Streaming (load 0) |
RAM (load 1-3) |
|---|---|---|
| Load Time | Instant | 2-5 minutes |
| Read Errors | Possible | Corrected |
| Track Switch | ~5ms | Instant |
| Gapless | No | Yes |
| RAM Usage | ~10MB | ~700MB |
Play: GPIO 17 (Pin 11) → GND
Pause: GPIO 26 (Pin 37) → GND
Stop: GPIO 27 (Pin 13) → GND
Next: GPIO 22 (Pin 15) → GND
Previous: GPIO 23 (Pin 16) → GND
Eject: GPIO 24 (Pin 18) → GND
Load: GPIO 25 (Pin 22) → GND
Internal pull-up enabled - no external resistors needed.
LED: GPIO 18 (Pin 12) → [470Ω] → WS2812 DIN
| Status | Color | Behavior |
|---|---|---|
| Ready | Blue | Solid |
| Loading | Yellow | Blinking |
| Loaded | Green | Solid |
| Playing | Green | Pulsing |
| Paused | Dim Green | Solid |
| Error | Red | Fast blink |
Edit src/config.py:
CD_DEVICE = '/dev/sr0'
ALSA_DEVICE = detect_audio_device() # Auto-detects
RAM_PATH = '/mnt/cdram'
RAM_SIZE = '1G'
GPIO_ENABLED = False # Set True for buttons
LED_ENABLED = False # Set True for WS2812| Mode | Indicator |
|---|---|
| Repeat Track | ⟳1 |
| Repeat All | ⟳ |
| Shuffle | ⤮ |
| Metric | Value |
|---|---|
| RAM Usage | ~700MB per CD |
| Load Time | 2-5 min |
| Playback Latency | <10ms |
| Gapless Transition | <1ms |
| CPU Usage | <5% |
lsblk | grep sr
cdparanoia -d /dev/sr0 -Q
sudo usermod -a -G cdrom $USERaplay -l # List devices
amixer sset 'PCM' 100% # Set volumesudo ./install.sh --install-superdrive-udev
# Or manual: sudo sg_raw /dev/sr0 EA 00 00 00 00 00 01This project is licensed under the GPL v3 License - see the LICENSE file for details.
- cdparanoia - CD extraction with error correction
- ALSA - Linux audio system
- moOde audio - Audiophile music player