A Python music player that emulates the classic iPod interface using Pygame, specially designed for Raspberry Pi Zero but compatible with any system.
- iPod Classic 6th Gen UI: Faithful interface design with authentic colors and fonts
- Functional Click Wheel: Simulated touch wheel with Menu, Play/Pause, Forward, Backward, and center buttons
- 2.8" Display: 358x269 resolution simulating the original iPod screen
- Smooth Animations: Transitions and animations just like the real iPod
- Music Library: Automatic scanning of MP3, WAV, OGG, FLAC, M4A, AAC files
- Browse by Artist/Album/Songs: Complete music organization
- Cover Flow: Album view with visual navigation (like real iPod Classic)
- Playback Controls: Play, pause, next, previous, shuffle, repeat
- Volume Control: Integrated volume adjustment
- Now Playing: Current playback screen with progress bar
- Video Player: Support for local video files
- YouTube Player:
- Video search with iPod virtual keyboard
- Trending music videos
- YouTube video playback
- Playlists: Basic playlist support
- WiFi Manager: WiFi network connection and management
- SQLite Database: Efficient music metadata storage
- Auto Boot: Runs automatically on startup
- Console Mode: Works without desktop environment
- Low Power: Optimized for Raspberry Pi Zero
- Framebuffer: Direct screen output without X11
To achieve a smooth 60fps-like experience on the Pi Zero's single-core ARMv6, this project implements:
- Direct Framebuffer Access: Bypasses the overhead of a Desktop Environment (X11). It can run straight from the CLI.
- Efficient Database: Uses SQLite for instant metadata retrieval, avoiding slow filesystem scans on SD cards during navigation.
- Threaded Playback: Audio and Video decoding are decoupled from the UI rendering to prevent stuttering during menu animations.
- Custom Input Layer: Maps GPIO or USB HID events to a virtual click-wheel logic, simulating the classic acceleration of the original hardware.
# Clone the repository
git clone https://github.com/davidmonterocrespo24/ipod-pygame.git
cd pygame-music-player
# Run the automatic installer
chmod +x quick_install_pi.sh
./quick_install_pi.sh
# Reboot to apply changes
sudo reboot# For complete installation with all optimizations
chmod +x install_pi.sh
./install_pi.sh
sudo reboot-
Clone the repository:
git clone https://github.com/davidmonterocrespo24/ipod-pygame.git cd pygame-music-player -
Create virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Add music:
- Create a
musicfolder in the project directory - Or place music in
~/Music - Supported formats: MP3, WAV, OGG, FLAC, M4A, AAC
- Create a
-
Run:
python src/main.py
- Arrow Keys โโ or W/S: Navigate menus
- Enter/Space: Select item
- Escape/Backspace: Go back/Previous menu
- In Now Playing:
- A/โ : Previous song
- D/โ : Next song
- P: Play/Pause
- V: Volume control
- Outer wheel: Slide to navigate
- Center button: Select
- Top button (Menu): Go back
- Bottom button (Play): Play/Pause
- Side buttons: Previous/Next
pygame-music-player/
โโโ src/
โ โโโ main.py # Main application
โ โโโ database.py # SQLite database management
โ โโโ playback.py # Playback control
โ โโโ renderer.py # iPod rendering engine
โ โโโ ui_config.py # iPod Classic visual configuration
โ โโโ menu_manager.py # Menu and navigation management
โ โโโ music_controller.py # Music controller
โ โโโ click_wheel.py # Click Wheel implementation
โ โโโ cover_flow.py # Cover Flow view
โ โโโ video_player.py # Video player
โ โโโ youtube_manager.py # YouTube management
โ โโโ youtube_player.py # YouTube player
โ โโโ wifi_manager.py # WiFi management
โ โโโ input_handler.py # Input handling
โโโ music/ # Local music directory
โโโ videos/ # Local videos directory
โโโ assets/ # Resources (fonts, images)
โโโ install_pi.sh # Complete installer for Pi
โโโ quick_install_pi.sh # Quick installer for Pi
โโโ requirements.txt # Python dependencies
โโโ README.md # This file
pygame-ce>=2.1.0- Enhanced graphics enginemutagen>=1.45.0- Audio metadataffpyplayer>=4.3.0- Video playbackyt-dlp>=2023.11.16- YouTube supportrequests>=2.31.0- HTTP requests
python3-pygame- System Pygamealsa-utils- ALSA audiolibsdl2-dev- SDL2 developmentpython3-dev- Python headers
Once installed, you can control the iPod with these commands:
# Control the service
ipod-control.sh start # Start
ipod-control.sh stop # Stop
ipod-control.sh restart # Restart
ipod-control.sh status # Status
ipod-control.sh logs # View logs
# Direct systemd commands
sudo systemctl status ipod-player
sudo journalctl -u ipod-player -fThe player automatically scans:
./music/(project directory)~/Music/(user directory)
- iPod Display: 358x269 pixels (2.8")
- Total Window: 358x431 pixels (3.5" diagonal)
- Click Wheel: 358x162 pixels
- File:
ipod_music_library.db - Auto-scan on startup
- Incremental metadata updates
# Check audio devices
aplay -l
# Configure audio output (Pi)
sudo raspi-config # Advanced Options > Audio > Force 3.5mm# Check framebuffer
ls -la /dev/fb0
# Add user to video group
sudo usermod -a -G video pi# Fix application permissions
sudo chown -R pi:pi /home/pi/ipod-music-player- Fork the repository
- Create your feature branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/new-feature) - Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Inspired by Apple's classic iPod design and built with love for the Raspberry Pi community.
Enjoy your iPod Classic experience on Raspberry Pi! ๐ง

