element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
BeagleBone Black Radio Challenge
  • Challenges & Projects
  • Design Challenges
  • BeagleBone Black Radio Challenge
  • More
  • Cancel
BeagleBone Black Radio Challenge
Blog Beaglebone Black Radio Challenge - 2: Streaming Server Setup
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: tayken
  • Date Created: 25 Mar 2014 1:51 PM Date Created
  • Views 618 views
  • Likes 2 likes
  • Comments 0 comments
  • RoadTest
  • beaglebone_black
  • BeagleBone
  • sdr
  • challenge
  • beaglebone_black_radio
Related
Recommended

Beaglebone Black Radio Challenge - 2: Streaming Server Setup

tayken
tayken
25 Mar 2014

In this post I'll be talking about how to set another computer to act as a server between Beaglebone Black and Internet. Initially I was planning to use ffmpeg and ffserver but after a week of banging my head against the wall, I couldn't make it work. It would've been nice as I was planning to pipe the stream coming from netcat to ffmpeg so that lets say if I have two Beaglebone Blacks with their own RTL dongles with different ports, I could've streamed both radio stations from the same streaming server. Then I started thinking and decided to use a patch cable to connect my sound card's audio out to its line in and use ffmpeg to capture from line in. This also didn't work. While I was looking around for a solution, I found a blog post about streaming with icecast and darkice.

 

System Setup

I'm using an Ubuntu Desktop 12.04 as my streaming server. aplay comes default but for an Ubuntu Server system, you have to install that too. Now install icecast and darkice with

sudo apt-get install icecast2 darkice

During installation, it will ask you if you want to configure icecast. I chose not to and decided to use the default port and password but if you're going for development, it would be wise to change at least the default passwords. After installation, you also have to edit /etc/default/icecast2 to change line with ENABLE=false to ENABLE=true. After this, I created a configuration file darkice.cfg in my home directory with the following content:

[general]
duration = 0
bufferSecs = 1
reconnect = yes
[input]
device = default
sampleRate = 44100
bitsPerSample = 16
channel = 2
[icecast2-0]
bitrateMode = vbr
quality = 1.0
format = mp3
bitrate = 256
server = localhost
port = 8000
password = hackme
mountPoint = radio.mp3
name = radio

 

You can now either reboot your system or start icecast with:

sudo /etc/init.d/icecast2 start

 

Streaming

Now I ssh into Beaglebone Black and tune into NHK Radio (82.5 MHz) with:

root@beaglebone:~# while true; do rtl_fm -f 82.5M -s 44.1k - | netcat -l -p 8080; done

 

You may decide to put this as a script to be run at boot time or use screen, run it and detach. On the streaming server, I also use screen as I need multiple consoles and again, I need the commands to run even if I cut my ssh connection. I open up two consoles, in one start darkice with:

sudo darkice -c darkice.cfg

 

In the other, I start playing the received audio with aplay:

netcat 192.168.1.5 8080 | aplay -r 44.1k -t raw -c 1 -f S16_LE

 

As I have an audio patch cable connected, I don't have to use jack or set up a pulse monitor. So here is the network diagram explaining this system.

 

Fullscreen contentimage_52510.html Download
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>

 

And also here is a video with the usage. The first thing I do is go to the stream page and let my browser play the stream. Then I go to icecast status page and click the playlist link and it opens Media Player by default.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube