Transform your vinyl collection into a wireless, multi-room listening experience!
Stream audio from any USB turntable to Sonos speakers using a Raspberry Pi. No subscriptions, no cloud servicesβjust pure analog warmth delivered to your modern wireless speakers.
Perfect for audiophiles and families who want to enjoy vinyl records throughout their home without complicated setups.
# On your Raspberry Pi
git clone https://github.com/tdionne/turntable-airplay-sender.git
cd turntable-airplay-sender
sudo ./install.shThat's it! The streaming server auto-starts on boot. Access the web UI at http://YOUR_PI_IP:8080
- Why This Project?
- Quick Start
- Features
- Demo
- Hardware Requirements
- Installation
- Usage
- Configuration
- Use Cases
- Troubleshooting
- Contributing
- License
π₯ Coming soon: Screenshots of the web interface and setup process
In the meantime, here's what you get:
- Web Control Panel - Gorgeous, responsive UI to control all your Sonos speakers
- Live Status Indicators - See which speakers are playing in real-time
- Smart Grouping - Automatically detects and displays grouped speakers
- Auto-Play Detection - Just drop the needle and music starts automatically
- Settings Dashboard - Configure everything from your browser
Ever wanted to play your vinyl collection through your Sonos speakers without buying expensive dedicated hardware? This project turns a $35 Raspberry Pi into a powerful bridge between your turntable and modern wireless speakers.
What makes it special:
- β‘ Auto-play detection - Power on your turntable, drop the needle, music starts automatically
- ποΈ Web interface - Control everything from your phone or computer
- π¨βπ©βπ§βπ¦ Family-friendly - Non-technical users can operate it easily
- π No subscriptions - No TuneIn, Spotify, or cloud services required
- π οΈ Fully customizable - Adjust gain, thresholds, and behavior to your needs
- π΅ Real-time audio streaming from USB turntable to Sonos
- π High-quality MP3 encoding (320kbps, 48kHz stereo)
- ποΈ Volume boost for quiet turntables (configurable gain)
- π€ Auto-play detection - Drop the needle, playback starts automatically!
- π± Family-friendly - Shows up in Sonos app Music Library
- π Web control interface for easy speaker selection
- π Multi-client support - Multiple speakers can listen simultaneously
- β‘ Auto-start on boot via systemd service
What you need:
- Raspberry Pi (3B+, 4, or 5 recommended) - Acts as the streaming bridge
- USB turntable - Any turntable with USB output (Audio-Technica, Denon, Sony, etc.)
- Also works with traditional turntables using a USB audio interface
- Sonos speakers - One or more Sonos speakers (Play:1, Play:5, Beam, Arc, etc.)
- Must support AirPlay 2 (most modern Sonos devices do)
- Home network - Wi-Fi or Ethernet connection for both Pi and Sonos
Tested configurations:
- β Raspberry Pi 3B+ with Audio-Technica AT-LP120XUSB
- β Raspberry Pi 4 with various USB turntables
- β Works with Sonos One, Play:5, Beam, and grouped speakers
- Raspberry Pi OS (Bullseye or newer)
- Python 3.9+
- ALSA for audio capture
- FFmpeg for encoding
- Dependencies auto-installed via
install.sh
# Clone the repository
git clone https://github.com/tdionne/turntable-airplay-sender.git
cd turntable-airplay-sender
# Run the install script
sudo ./install.sh
# Repository can now be deleted!
cd ..
rm -rf turntable-airplay-senderThis installs everything to /opt/turntable-streaming and sets up the systemd service.
If you prefer to run from the cloned directory:
# Install system dependencies
sudo apt-get update
sudo apt-get install -y \
python3-pip python3-dev python3-venv \
libasound2-dev portaudio19-dev \
libavahi-compat-libdnssd-dev \
libssl-dev libffi-dev ffmpeg
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install Python dependencies
pip install -r requirements.txt
# Copy and edit configuration
cp config.example.yaml config.yaml
nano config.yamlIf installed with install.sh:
# Start service
sudo systemctl start turntable-stream
# Enable auto-start on boot
sudo systemctl enable turntable-stream
# Check status
sudo systemctl status turntable-streamIf running manually:
source venv/bin/activate
python3 stream_server_v2.pyDirect control (command line):
python3 play_on_sonos.py "Living Room"Web interface (for family):
python3 web_control.py
# Open http://YOUR_PI_IP:8080 in browserSonos app (easiest for family):
- Add turntable playlist to Sonos Music Library (see FAMILY_INSTRUCTIONS.md)
- Browse β Music Library β Playlists β Turntable
- Play!
Edit config.yaml (or /opt/turntable-streaming/config.yaml) to customize:
- Input device: ALSA device string (e.g.,
plughw:2,0) - Sample rate: 44100 or 48000 Hz
- Volume gain: Boost quiet turntables (1.0-3.0, default: 2.0)
Enable automatic playback when you drop the needle:
auto_play:
enabled: true # Enable auto-play
default_speaker: "Living Room" # Which Sonos speaker to use
audio_threshold: 500 # Sensitivity (300-1000)
trigger_delay: 2.0 # Seconds to wait before triggeringHow it works:
- Server monitors audio levels in real-time
- When audio crosses threshold for
trigger_delayseconds - Automatically starts playback on your default Sonos speaker
- No need to manually start playback!
Testing auto-play:
# Test detection without starting the server
python3 test_autoplay.py
# Drop the needle and watch for trigger# Check USB devices
lsusb
# Check ALSA devices
arecord -l
# Test recording
arecord -D plughw:1,0 -f cd test.wav- Ensure Raspberry Pi and Sonos are on the same network
- Check firewall settings
- Verify Sonos supports AirPlay 2 (check Sonos app)
- Adjust buffer sizes in config.yaml
- Ensure Raspberry Pi has adequate power supply
- Check CPU usage:
htop
turntable-airplay-sender/
βββ stream_server_v2.py # Main HTTP streaming server (START HERE)
βββ audio_capture_alsa.py # ALSA audio capture from USB turntable
βββ play_on_sonos.py # Direct Sonos control via SoCo
βββ web_control.py # Web interface for family
βββ create_playlist.py # Generate .m3u playlist file
βββ device_discovery.py # Discover AirPlay devices on network
βββ turntable-stream.service # Systemd service for auto-start
βββ setup.sh # Initial setup script
βββ install-service.sh # Install as system service
βββ requirements.txt # Python dependencies
βββ config.example.yaml # Configuration template
βββ README.md # This file
For Daily Use:
stream_server_v2.py- The main server that captures and streams audioplay_on_sonos.py- Command-line tool to play on specific Sonos speakersweb_control.py- Web interface for family members
For Setup:
setup.sh- Run once to install dependenciescreate_playlist.py- Generate playlist for Sonos Music Libraryinstall-service.sh- Install as auto-starting service
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).
What this means:
- β You can use, modify, and distribute this software freely
- β You can use it for commercial purposes
β οΈ If you distribute modified versions, you must:- Share your source code under GPL-3.0
- Keep the same license
- Document your changes
This ensures improvements benefit everyone! See the LICENSE file for full details.
Perfect for:
- π Home vinyl listening - Play records in any room with Sonos
- π Parties - Stream to multiple speakers simultaneously
- π΄ Seniors - Simple auto-play makes it easy for non-technical users
- π§ Audiophiles - High-quality 320kbps streaming preserves vinyl warmth
- π DIY Gift - Build one for vinyl-loving friends/family
- π» Podcasters - Stream any audio source to Sonos
- π΅ Music production - Monitor audio from DAW through Sonos
We'd love your help! Here's how you can contribute:
- π Found a bug? Open an issue with details
- π‘ Have an idea? Share your feature request or improvement suggestion
- π§ Want to code? Fork the repo and submit a pull request
- π Improve docs? Documentation improvements are always welcome
- β Spread the word - Star this repo and share with vinyl enthusiasts!
Development areas that need help:
- Support for other speaker systems (Bose, HomePod, Chromecast)
- Mobile app for iOS/Android
- Advanced EQ and audio processing
- Better visualization/VU meters
- Automated testing
Join the discussion in Issues or start a Discussion!
Built using:
- SoCo - Python library for Sonos control (MIT)
- FFmpeg - Audio encoding (LGPL/GPL)
- Flask - Web framework (BSD)
- pyalsaaudio - ALSA audio capture (PSF)