Brainy Pi

Available to select audience (currently beta)

Radio Stream on Brainy pi
Are you interested in creating your own internet radio station and streaming station ? In this blog, we’ll guide you through the process of setting up a streaming station on a Brainy pi – Raspberry pi Alternative using two powerful packages, DarkIce and Icecast.
DarkIce records and encodes audio from a microphone or other audio interface and sends it to a streaming server.
Icecast is a versatile streaming media server that supports various audio and video formats, making it perfect for creating everything from internet radio stations to jukeboxes.
Let’s get started on setting up your own streaming station on Brainy Pi using DarkIce and Icecast with easy steps given below

Required Components for setting up Streaming Station:

  • Brainy Pi
  • ethernet/wifi
  • sd card
  • USB Microphone

Step 1: Updating the System

Before installing any new packages we should always update the existing packages
1. To update use the command
sudo apt update
2. To upgrade use the command
sudo apt upgrade

Step 2: Installing the Req Packages on Brainy pi

1. Before installing the DarkIce and Icecast, on the Brainy Pi we need to install the darkice deb package.
Wget https://github.com/x20mar/darkice-with-mp3-for-raspberry-pi/blob/master/darkice_1.0.1-999~mp3+1_armhf.deb?raw=true
mv darkice_1.0.1-999~mp3+1_armhf.deb?raw=true darkice_1.0.1-999~mp3+1_armhf.deb
sudo apt-get install libmp3lame0 libtwolame0
sudo dpkg -i darkice_1.0.1-999~mp3+1_armhf.deb
2. After this, we can install icecast2
sudo apt-get install icecast2
3. During the installation process, it will ask you if you want to configure Icecast2. Select Yes.
  • The next screen will ask you to specify the domain name. Select OK to use the default hostname “localhost”.
  • Now, in the next steps, you will be required to add 3 passwords. The first one is to control access to media sources, the second is to use stream relays, and the third password is to grant access to the administration console. Click ‘ok’ to use the default password. The default username will be “admin”.
4. After installing Icecast2, we need to create adarkice config file to use the right sound card and talk to icecast2. Create a config file using the following command.
sudo nano darkice.cfg
  • Then copy and paste these configurations in the file:
# this section describes general aspects of the live streaming session
[general]
duration     = 0     # duration of encoding, in seconds. 0 means forever
bufferSecs   = 5     # size of internal slip buffer, in seconds
reconnect    = yes   # reconnect to the server(s) if disconnected
# this section describes the audio input that will be streamed
[input]
device          = plughw:0,0  # Soundcard device for the audio input
sampleRate      = 22050     # sample rate in Hz. try 11025, 22050 or 44100
bitsPerSample   = 16        # bits per sample. try 16
channel         = 2         # channels. 1 = mono, 2 = stereo
# this section describes a streaming connection to an IceCast2 server
# there may be up to 8 of these sections, named [icecast2-0] ... [icecast2-7]
[icecast2-0]
bitrateMode     = abr       # average bit rate
format          = mp3       # format of the stream: ogg vorbis
bitrate         = 320       # bitrate of the stream sent to the server
server          = localhost # host name of the server
port            = 8000      # port of the IceCast2 server, usually 8000
password        = lolcat123 # source password to the IceCast2 server
mountPoint      = Stream.mp3  # mount point of this stream on the IceCast2 server
name            =  Raspberry Pi Stream # name of the stream
description     = Broadcast from Raspberry Pi # description of the stream
#public          = yes       advertise this stream?
  • Save the changes using Ctrl+X > Y > Enter.
5. Then create another file named “darkice.sh” using the below command:
sudo nano darkice.sh
  • Paste the below line in the file. This line contains the address to the configuration file.
sudo /usr/bin/darkice -c /home/pi/darkice.cfg
6. Then make the darkice.sh file executable using the below command:
sudo chmod 777 /home/pi/darkice.sh
7. Next, start the Icecast2 service using the below command:
sudo service icecast2 start

Step 3: Web Interface on Brainy pi

1. To use the web interface, you have to get the IP address of your PI
  • To get the IP address use command
hostname -I
  • There are chances that you get more than one IP address, don’t worry this means you have not set the static IP address you can any IP address displayed on the terminal
2. NOW
  • With the IP in hand, you can go to the following web address in a web browser of your choice.
  • go to
 http://[PIIPADDRESS]:8000
  • Here 8000 is the port number
  • Upon going to the web address, you will be introduced to the Icecast2 web interface.
3. Click on M3U in the top right corner or enter Stream.mp3 to open the stream. If you’re able to listen to the content, the stream is running properly.

Endnotes

Installation of Internet radio and streaming station is implemented successfully on Brainy pi – Raspberry pi Alternative.
Reference: Link
0 Comments

Leave a reply

Your email address will not be published. Required fields are marked *

*