Capturing and Streaming Vinyl Audio

Author name

March 14, 2024

with Icecast & DarkIce

With your HiFiBerry and ALSA configurations complete, it’s now time to capture audio from your vinyl setup and stream it across your home. In this guide, we’ll set up Icecast and DarkIce—two powerful tools for creating a reliable, high-quality vinyl streaming solution directly to your Apple HomePods.

What are Icecast and DarkIce?

  • Icecast is an open-source audio streaming server capable of broadcasting audio streams over the network.
  • DarkIce is an audio streamer that captures live audio, encodes it, and sends it directly to Icecast.

Together, these tools enable real-time streaming of your analog vinyl audio across your home network.

Installing Icecast

Step 1: Install Icecast

On your Raspberry Pi, install Icecast using:

sudo apt install icecast2

During installation, you’ll be prompted to configure passwords—make sure to keep track of them.

Step 2: Configure Icecast

Edit the Icecast configuration file:

sudo nano /etc/icecast2/icecast.xml

Set the passwords and hostname to your preferences:

<authentication>
    <source-password>your_password</source-password>
    <relay-password>relay_password</relay-password>
    <admin-user>admin</admin-user>
    <admin-password>admin_password</admin-password>
</authentication>

<hostname>raspberrypi.local</hostname>

Save changes and restart Icecast:

sudo systemctl restart icecast2

Installing and Configuring DarkIce

Step 1: Install DarkIce

Install DarkIce on your Raspberry Pi:

sudo apt install darkice

Step 2: Create DarkIce Configuration File

Create or edit DarkIce configuration:

sudo nano /etc/darkice.cfg

Use the following example configuration:

[general]
duration        = 0      # duration in s, 0 forever
bufferSecs      = 1      # buffer, in seconds
reconnect       = yes    # reconnect if disconnected

[input]
device          = hifiberry # Soundcard device for the audio input
sampleRate      = 44100   # sample rate 11025, 22050 or 44100
bitsPerSample   = 16      # bits
channel         = 2       # 2 = stereo

[icecast2-0]
bitrateMode     = cbr       # constant bit rate ('cbr' constant, 'abr' average)
#quality         = 1.0       # 1.0 is best quality (use only with vbr)
format          = mp3       # format. Choose 'vorbis' for OGG Vorbis
bitrate         = 320       # bitrate
server          = 127.0.0.1 # or IP
port            = 8000      # port for IceCast2 access
password        = password    # source password for the IceCast2 server
mountPoint      = vinyl.mp3  # mount point on the IceCast2 server .mp3 or .ogg
name            = Record Player

Step 3: Create and Enable DarkIce as a System Service

To ensure DarkIce runs continuously:

sudo nano /etc/systemd/system/darkice.service

Add the following:

[Unit]
Description=DarkIce Vinyl Streamer
After=icecast2.service network-online.target sound.target
Wants=icecast2.service network-online.target


[Service]
ExecStartPre=/bin/sleep 10
ExecStart=/usr/bin/darkice -c /etc/darkice.cfg
Restart=always
RestartSec=5
User=admin
Group=admin
Nice=-10

[Install]
WantedBy=multi-user.target

Start and enable the service:

sudo systemctl daemon-reload
sudo systemctl start darkice
sudo systemctl enable darkice

Verify the Streaming

Open a browser and visit:

http://raspberrypi.local:8000/vinyl.mp3

You should hear your vinyl stream playing clearly.

Troubleshooting Common Issues

If you experience issues:

  • Verify passwords in Icecast and DarkIce configuration files match.
  • Ensure your HiFiBerry DAC+ADC Pro is properly configured via ALSA.
  • Restart Icecast and DarkIce after configuration changes.

What’s Next?

Your vinyl audio streaming is now up and running. Next, we’ll cover setting up OwnTone to integrate your stream seamlessly with Apple HomePods and enable multi-room playback.

Next post: March 28, 2024, Multiroom Playback & AirPlay 2 Integration via OwnTone

3 thoughts on “Capturing and Streaming Vinyl Audio”

Leave a Comment