oszuidwest / rpi-audio-encoder

Software to turn a Raspberry Pi into a production grade audio encoder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rpi-audio-encoder

This repository contains the audio streaming software for ZuidWest FM in the Netherlands. It uses a Rapsberry Pi 4 and a HiFiBerry Digi+ I/O as audio input. As encoder ffmpeg is used, which is combined with Supervisor to manage the process via a webinterface. It sends audio to an Icecast2 or SRT server.

This encoder resides in the studio and is connected to an Optimod. It can stream to any Icecast or SRT server. Our server software to complete the audio stack can be found in this respository.

How to prepare the Rapsberry Pi

  • Install Raspberry Pi OS Lite 11 (bullseye) 64-bit
  • Run sudo raspi-config to set timezone, Wi-Fi country and expand the filesystem
  • Follow the guide on https://www.hifiberry.com/docs/software/configuring-linux-3-18-x/ to set-up the HiFiBerry
  • Ensure you are root by running sudo su
  • Download and run the install script with the command /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/oszuidwest/rpi-encoder/main/install.sh)"

How to configure the audio processor

  • Connect the digital output of the audio processor to the input of the HiFiBerry
  • Ensure the processor is sending out 48khz 16-bits audio. The HiFiBerry can't resample. This is hardcoded.
  • If possible, configure the digital output to send SPDIF data. AES/EBU could work, but is not 100% the same standard.

This is an example for an Orban Optimod:

Audio encoding presets

There are a couple of audio encoding configurations:

  • mp2 sends MPEG-1 Audio Layer II audio on 384 kbit/s. This is considered the gold standard for compressed broadcast audio.
  • mp3 sends MPEG-1 Audio Layer III audio on 320 kbit/s. This is the highest quality mp3 possible.
  • ogg/vorbis sends OGG Vorbis audio on 500 kbit/s. This is the highest quality ogg/vorbis possible.
  • ogg/flac sends FLAC audio in an OGG wrapper on ~1200 kbit/s. This is the highest possible uncompressed audio.

Experimental SRT support

In the future we would like to use SRT for streaming. This is integrated on experimental basis now. It's working in FFmpeg, but the server side (Liquidsoap) is still in beta. A working SRT implementation of the server software can be found here and will be merged when Liquidsoap 2.2.0 is out of beta.

For more about SRT:

About

Software to turn a Raspberry Pi into a production grade audio encoder

License:The Unlicense


Languages

Language:Shell 100.0%