Showing posts with label Raspberry Pi headless at coffee shops. Show all posts
Showing posts with label Raspberry Pi headless at coffee shops. Show all posts

setup a Raspberry Pi to stream to Broadcastify using Darkice

setup a Raspberry Pi to stream to Broadcastify using Darkice

I am trying to setup a Raspberry Pi to stream to Broadcastify using Darkice.
I have followed the setup process outlined on this website:
The issue I'm currently facing is that I cannot get the service to work.
In /etc/init.d/darkice1 I have:

HOWTO - Ubuntu Darkice Configuration for Live Audio Feeds

HOWTO - Ubuntu Darkice Configuration for Live Audio Feeds

This HOWTO makes an assumption that you already have your input device, either mic or line-in configured as a capture device in the mixer and that your capture levels are high enough to get audio feeding into /dev/dsp (the OSS sound device).
In linux, your capture level is the level that will feed into the stream, this is where you wind up with either excessive hiss from too low an output from the scanner and too high a capture input boost or you can get distortion on the feed from too high a drive from the scanner ouput and/or too high a capture level drive.
I recommend a healthy level of output from the scanner/radio device and backing down the capture level to about 1/2 or until the feed is not distorted from the loudest level from the scanner/radio input device.

Raspberry Pi Broadcastify Script to alert feed owner to high number of listeners

Raspberry Pi Broadcastify Script to alert feed owner to high number of listeners

I've been running a feed for about a year. Most of the time, I'm under 20 listeners at a time. I had some event the other day where my listeners peaked at nearly 200. I wish I would have been notified at the time of the event so I could have added a feed alert or something...and potentially driven up the number of listeners further.

So I whipped up a python script to do just that. Here it is if anyone else wants to implement the same feature. This runs on a Raspberry Pi that supplies my feed.
 

Raspberry Pi 3 - Stream directly from a USB sound card

Stream directly from a USB sound card

  • Plug your scanner's headphone jack into the mic jack on the USB sound card dongle
  • Start alsamixer
pi@raspberrypi:~# alsamixer
  • press F6, choose the "USB Headphone Set" entry
  • press your tab key to select the "Capture" device volume control
  • use your "up arrow" key to adjust the level to it's lowest level possible (6)
  • press escape to exist alsamixer
  • run the following command to save the volume settings
sudo alsactl store
 

Install darkice with MP3 support on Raspberry Pi

Install darkice with MP3 support on Raspberry Pi

darkice-install-pi.sh
echo "deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi" | sudo tee --append /etc/apt/sources.list
sudo apt-get update
sudo apt-get install libmp3lame-dev
apt-get source darkice
cd darkice-1.2/
./configure --prefix=/usr --sysconfdir=/usr/share/doc/darkice/examples \
--with-lame --with-lame-prefix=/usr/lib/arm-linux-gnueabihf \
--with alsa --with-alsa-prefix=/usr/lib/arm-linux-gnueabihf
make
sudo make install


Raspberry Pi - USB 2.0 I tried changing it to 1.1

Thanks for the tips... It was a problem with the USB 2.0 I tried changing it to 1.1 originally (by adding that 1 line) The problem was, I added it into a new line (not in the same line) So I guess that was the difference. The sound quality is great now!

My next problem is:
I have the script to trim all the dead sound from the recording and save it. The problem is that when you listen to the broadcast, the sound is never 100% silent. There is like a slight static. As a result, there is never any dead time to trim out. Is there a way to set it up so it either doesn't pick up that slightly static, or a way for the recording to trim all that out?


Scanner feed using Rasberry Pi

Scanner feed using Rasberry Pi

Just an update, running 2 simultaneous feeds successfully on one Rasberry Pi. No overclocking necessary, or slowing of the USB port necessary, and it's staying cool and happy. Running 2 Griffin I-mic USB cards with line inputs and it sounds great.

Just create 2 different config files each with it's own filename, (such as darkice-feed1.cfg) unique sound card inputs, mountpoints and passwords, ect.


audio input for my 1st feed:
device = plughw:1,0

audio input for my 2nd feed:
device = plughw:0,0

open 2 shells, then run the feeds like this:

sudo nano /etc/darkice-feed1.cfg
sudo nano /etc/darkice-feed2.cfg

How wonderful it was to shut down my Windows XP machine after running it 24/7 after all these years!


Broadcastify Radioreference feed

Are you trying to run a RR/Broadcastify feed? If so, a couple simple things to check for starters:

1. If the feed is presently being run from another computer, you will need to stop that feed before trying to connect with darkice.

2. In your credentials the mount point is show in Technical Details like this /1234567. When you enter it in the darkice configuration you need to omit the leading /


Install Raspbian OS

Install Raspbian OS
All testing and configuration was done using Raspbian
  • Follow the instructions here to install the OS on the memory card you purchased:
Install pre-reqs and update raspberry pi to latest version
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git cmake libusb-1.0-0.dev build-essential lame 
sudo apt-get install libmp3lame-dev libvorbis-dev libshout-dev libtwolame0 libtwolame-dev
sudo reboot



Linux darkice configuration Raspberry Pi - Broadcastify

Linux darkice configuration Raspberry Pi - Broadcastify
Here's my darkice configuration if anybody's interested

Code:

[general]
duration        = 0        # duration of encoding, in seconds. 0 means forever
bufferSecs      = 2         # size of internal slip buffer, in seconds
reconnect       = yes       # reconnect to the server(s) if disconnected

[input]
device          = plughw:1,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         = 1         # channels. 1 = mono, 2 = stereo

[icecast2-0]
bitrateMode = cbr
format = mp3
bitrate = 16
channel = 1
lowpass = 5000
#sampleRate = 11025
server = xxxxxx.radioreference.com
port = ##
password = xxxxxx
mountPoint = xxxxxxxx
name = Feed name

[icecast2-1]
# This is for LAN access
bitrateMode = cbr
format = mp3
bitrate = 16
channel = 1
#lowpass = 5000
#sampleRate = 11025
server = localhost
port = 8000
password = xxxxxx
mountPoint = scanner1 # Stream location: 192.168.2.XXX:8000/scanner1.m3u
name = *LAN*Feed Name



Instructions for setting up a darkice feed to a local Icecast server and to RadioReference.

Instructions for setting up a darkice feed to a local Icecast server and to RadioReference.

Purchase a Raspberry Pi, Model B or B+. A model A would work but complicates the
setup considerably as it has no ethernet port. You will also need an 8 gb SD card,
power supply, usb sound card, audio cable, a set of earphones, and an ethernet cable.

Download my compressed SD card image from google and save it to your desktop or
laptop computer. Extract the file using a utility such as 7-Zip if using a Windows
computer. If using a Mac computer simply right click on the compressed file and
choose Extract. This will leave you with a file named something like darkice-icecast.img.

Now you are ready to image your SD card. Put your blank SD card into a card reader
connected to your Windows or Mac computer. If using a Windows computer you will
want a program called Win32DiskImager to put the image onto your SD card. If using a
Mac, try a program called PiWriter (its sister program PiCloner was used to create this
image.) This process may take a while (as in hours) so be patient. When complete, the
SD card image is ready to go.