portal/docs/broadcaster.md
2025-03-30 15:26:13 -07:00

2.7 KiB

Broadcaster Software (icecast and darkice)

Summary

User: grace Hostname: portal.local Password: emergence Running icecast and darkice. See icecast-darkice.md for setup instructions.

Bill of Materials

Hardware setup

  • Plug the mic into the the usb cable
  • Plug the usb cable into the pi
  • Plug the pi into the wall

Pre work

  1. install raspian lite 64 for raspi model 4b
  2. configure user and wifi and turn on ssh services when you install
  3. boot
  4. find the ip address of the pi and ssh to it

Setup instructions

Creature comforts

  1. sudo apt update && install git vim zsh
  2. sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Icecast2 and Darkice installation

Loosely following this tutorial: https://dev.to/shilleh/stream-audio-from-raspberry-pi-to-local-computer-1a1c

Install icecast2

  1. sudo apt install icecast2
  2. It will ask you for three passwords. Set them all as emergence.

Install darkice

  1. sudo apt install darkice
  2. sudo vim /etc/darkice.cfg
[general]
duration = 0 # Stream indefinitely
bufferSecs = 5 # Buffer for the input, in seconds
reconnect = yes # Reconnect to the server if disconnected

[input]
device = plughw:1,0 # Your audio capture device
sampleRate = 44100
bitsPerSample = 16 # Bits per sample
channel = 1 # 2 = stereo, 1 = mono

[icecast2-0]
bitrateMode = cbr # Constant bit rate
format = mp3 # Audio format
bitrate = 128 # Bitrate in kbps
server = localhost # Server name or IP
port = 8000 # Port number
password=emergence # Your Icecast password
mountPoint = portal # Mount point to stream to
name = Black Portal # Name of the stream
description = Black Portal Project # Description of the stream
url = http://blackportaldetroit.com # URL related to the stream
genre = politics # Genre of the stream
public = no # Do not list on public lists

Daemonize darkice

  1. sudo vim /lib/systemd/system/darkice.service
[Unit]
Description=Darkice Service
[Service]
User=root
Type=simple
Restart=on-failure
RestartSec=5
WorkingDirectory=/home/grace
ExecStart=/usr/bin/darkice -c /etc/darkice.cfg
[Install]
WantedBy=multi-user.target
  1. sudo systemctl daemon-reload
  2. sudo systemctl enable icecast2
  3. sudo systemctl enable darkice