Skip to content

balenaPhono is a project for Raspberry Pi that takes the audio output from a turntable or any other audio device and creates a shoutcast/icecast network stream. This project is great for anyone looking for a cheap and simple way to play vinyl on Sonos speakers.

Notifications You must be signed in to change notification settings

SamEureka/balenaPhono

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Feb 27, 2023
ac186ac · Feb 27, 2023

History

32 Commits
Feb 27, 2023
Dec 22, 2021
Mar 8, 2022
Feb 27, 2023
Feb 27, 2023
Dec 22, 2021

Repository files navigation

turntable image balenaPhono

A turntable phono/AUX/USB network streamer

balenaPhono is a project for Raspberry Pi that takes the audio output from a turntable or any other audio device and creates a shoutcast/icecast network stream. This project is great for anyone looking for a cheap and simple way to play vinyl on Sonos speakers.


Equipment needed:


Install

Running this project is as simple as deploying it to a balenaCloud application. You can deploy it in one click by using the button below:

balena deploy button


Post install setup:

  1. In the balenaCloud console for your new device check the log for any errors. You may need to change the DARKICE_DEVICE variable to match your device. Take a look here for troubleshooting tips.

  2. Get the local ip address for your device from the balenaCloud console.

  3. To play the stream in a browser window:

    http://<device-ip>/rapi.mp3

  4. To add your stream to your Sonos system:

    You must use the Sonos desktop controller app to add a custom stream to Sonos. Click on Manage > Add Radio Station and enter the url for the stream (using your device local ip) "http://<device-ip>/rapi.mp3". Also enter a Station Name and click OK.


Device Variables:

Variable Example Value Note
PORTAL_SSID balenaPhono Wifi-connect captive portal SSID **Check out wifi-connect page for additional variables.
PORTAL_PASSPHRASE balenaPhono Wifi-connect captive portal Passphrase
PORTAL_LISTENING_PORT 8000 *Changed from the default port 80 due to conflict with Icecast server
CHECK_CONN_FREQ 120 This is the wifi-connect polling wait time in seconds. The default is 120 seconds, I usually set mine to 3000.
REBOOT_SLEEP_TIME 1d Default is 1d (one day). Will work with d m s (days, minutes, seconds). It is a sleep time for the balenaBooter. Darkice audio streams have a tendency to get corrupted after a few days of up time. balenaBooter reboots the host once a day to keep things clean. Looking for a better way... if you have ideas.
ICECAST_LOCATION Interwebs Where your stream is hosted from or where you are located.
ICECAST_ADMIN_EMAIL balenaAdmin@localhost Used for the Icecast status page, doesn't need to be real
ICECAST_CLIENTS 10 How many clients can connect to your stream. Keep it low if you are using a Pi Zero
ICECAST_SOURCE_PASSWORD b@13n4! Password used by Darkice to connect to Icecast. Must be the same as DARKICE_PASSWORD
ICECAST_RELAY_PASSWORD b@13n4! Not exactly sure what this one is for. You can change it with this device variable!
ICECAST_ADMIN_NAME balenaAdmin Username for logging into the admin portal.
ICECAST_ADMIN_PASSWORD b@13n4-@dm1n! Password for the admin portal
ICECAST_HOSTNAME balenaPhono Hostname for the Icecast server
ICECAST_PORT 80 Port that Icecast server listens on. Needs to be the same as DARKICE_PORT
ICECAST_MOUNT_POINT rapi.mp3 Should end in .mp3 for MP3 streams and .ogg for Ogg Vorbis encoding
ICECAST_STREAM_NAME balenaPhono Name of your stream.
ICECAST_STREAM_DESC A stream from AUX/Phono Description of your stream.
ICECAST_GENRE Vinyl The genre of your stream.
DARKICE_DURATION 0 Duration of the stream in seconds. Set this to 0 to disable.
DARKICE_BUFFER_SECONDS 1 How many seconds the stream buffers before playing. Minimum value: 1 (seems to work fine)
DARKICE_RECONNECT yes Automatically re-connect to Icecast
DARKICE_DEVICE plughw:0,0 Source device for your stream. Very hard to find information on this setting. Try this man page. The default setting here worked on a pi zero w. On a pi3 I had to change it to plughw:1,0 Good Luck!
DARKICE_SAMPLE_RATE 44100 Sample rate of the source audio. You shouldn't need to change this.
DARKICE_BITS_PER_SAMPLE 16 Bits per sample. You shouldn't need to change this one either.
DARKICE_CHANNEL 2 How many channels. 2 for stereo... 1 for mono
DARKICE_BITRATE_MODE cbr Accepts cbr, abr, vbr. Read the man page for more info
DARKICE_FORMAT mp3 Format of the stream sent to the IceCast2 server. Supported formats are 'vorbis', 'opus', 'mp3', 'mp2', 'aac' and 'aacp'
DARKICE_BITRATE 320 Bit rate to encode to in kBits / sec (e.g. 320). Only used when cbr or abr bitrate modes are specified.
DARKICE_SERVER localhost Icecast server address or url
DARKICE_PORT 80 Icecast port. Needs to be the same as ICECAST_PORT
DARKICE_PASSWORD b@13n4! Needs to be the same as ICECAST_SOURCE_PASSWORD
DARKICE_MOUNT_POINT rapi.mp3 Needs to be the same as ICECAST_MOUNT_POINT
DARKICE_NAME balenaPhono Name of the stream.

Getting Help

  • Google is your friend!
  • Submit an issue on this repo and I'll help if I can.

Reference:


Credits:

About

balenaPhono is a project for Raspberry Pi that takes the audio output from a turntable or any other audio device and creates a shoutcast/icecast network stream. This project is great for anyone looking for a cheap and simple way to play vinyl on Sonos speakers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published