Skip navigation

All entries in this blog series:

 

 

The end of the challenge is nearing, so here's my final post on this project.

I have had a major setback when resuming coding after the build, but I did manage to get a fully functional FM/Internet Radio combo in time.

 

 

Disaster ...

 

After having finished the build from part 4, I was getting ready to resume coding on my interface and its functionalities.

I booted my BBB Radio, started the browser and my interface was totally blank.

No reason to panic (yet), as I might have left the code broken the last time I worked on it. That's when I discovered my index.cgi file was 0 bytes big.

 

Disaster ... The code was gone and I had no backup to recover at least some of it. Luckily, my images, stylesheets and config files were still intact.

I desperately searched for a copy of my index file but didn't manage to find any. There was nothing left but to start over and start making backups!

 

That was a bummer which was most likely entirely my fault, but a lesson learned ... the hard way. I'm still not sure what happened exactly, but I assume I left the file open and didn't properly shut down the BBB, or at least something along those lines.

 

With only two weeks left before the end of the challenge, I started coding again ...

 

Demo Time!

 

Pfew, I made it ... with only a few days to spare. Here's a set of demos of what I managed to get done for this challenge.

 

Controls

 

It's possible to control the Beaglebone Black Radio in various ways:

  • Touchscreen using the LCD cape
  • Wireless keyboard/mouse combo
  • From a smartphone/tablet/pc

 

Each of the controls have their (dis)advantages. For example, the LCD cape is useful for navigation and actions using big buttons. It is however less adequate for entering data.

This disadvantage is compensated by the wireless keyboard/mouse combo or by accessing the interface from another device such as a smartphone.

 

You'll see me using some of those different controls in the videos below.

 

 

Listening

 

This video demonstrates the controls to listen to the radio. The controls allow you to switch between FM or Internet radio, start, stop, browse the available channels and set the volume.

 

 

You can hear the moment it switches between FM and internet streaming. The audio levels also seem to be different. I'll have to find a way of aligning this.

photo 1.PNG

 

Managing Channels

 

I developed a simple radio channel management interface which you can view in the video below. It allows you to add new channels and edit or delete existing channels.

The configured channels are stored in a configuration file on disk to make them persistent across reboots.

 

 

Managing channels can also be done (more easily) from a smartphone:

photo 3.PNG

 

Configuration

 

Finally, a short video on setting some parameters for the SDR receiver stick. The list could be extended to support a larger set of configurable parameters.

For now, it allows to configure the modulation type, gain and sample rate which are provided to the "rtl_fm" command. Changes are also stored in a configuration file on disk.

 

 

photo 4.PNG

 

Diagram, Components and Code

 

Below you will find all the information required to better understand or even build this particular Beaglebone Black Radio.

All suggestions/improvements/additions are more than welcome, I'll also gladly answer any questions you might have regarding this build.

 

Diagram

 

I made a simple diagram of the different components involved and how everything is connected.

It's more of an integration project where different existing components are combined into one solution, all glued together with a web application developed in Perl.

bbb_radio (2).png

 

Components

 

The list of electronic components used in my project:

 

ComponentHeader 2
Beaglebone BlackBeagleBoard.org - BeagleBone Black
LCD Touch CapeCircuitCo:BeagleBone LCD4 - eLinux.org
USB Wifi AdapterUWN200 b/g/n USB wireless adapter | Logic Supply
USB SDR ReceiverSoftware Defined Radio Receiver USB Stick - RTL2832 w/R820T ID: 1497 - $22.50 : Adafruit Industries, Unique & fun DIY el…
Audio AmplifierStereo 2.8W Class D Audio Amplifier - TS2012 ID: 1552 - $9.95 : Adafruit Industries, Unique & fun DIY electronics and ki…
SpeakersSpeaker - 3 Diameter - 4 Ohm 3 Watt ID: 1314 - $1.95 : Adafruit Industries, Unique & fun DIY electronics and kits
Powered USB HubLogiLink® | USB 2.0 Hub, 4-Port LogiLink® | 16.03.2014
USB SoundcardUSB 2 0 External MIC Speaker 3D 5 1 Channel Audio PC Sound Card Adapter Brown | eBay
Wireless Keyboard & Mouse ComboRii 2.4GHz Wireless Mini PC Keyboard Touchpad V2 Black: Amazon.co.uk: Computers & Accessories

 

Code

 

And finally, a link to the source code of my web application used to control the radio: BeagleboneBlackRadio on GitHub

Information on setting up the Beaglebone Black and getting the components installed and running can be found in the previous posts of this challenge.

 

 

Thank you

 

As you can see in the picture below, we're having fun with our new radio! Thank you for giving us the opportunity to participate in this Roadtest Challenge.

Screen Shot 2014-03-23 at 14.33.50.pngphoto (1).JPG

All entries in this blog series:

 

 

This week's post is all about the actual build. No coding, no software at all, a lot of pictures though. Here we go.

 

Original idea

 

My original idea, as proposed in my Roadtest application, was to "sandwich" all of the components between two sheets op plexiglass and provide access to the LCD for control.

photo 2.JPG

Because I'm not the handiest man around, I thought of designing the plexi sheets I would need and have them laser cut through some online laser cutting service.

I started searching for laser cutting services nearby, but once I saw the price to get what I wanted cut, I quickly abandoned that track. Way too expensive!

 

It was time to learn a new skill. I went to the local hardware store, bought a sheet of plexi, some drill bits, and got started ...

 

Getting started

 

Problem #1: How do I cut a piece of the right size, from the bigger sheet ?

 

I found that locking the plexi between two pieces of wood, making some cuts and snapping off the piece worked best.

This was after I tried using an electric saw, manual saw, and what not ...

 

photo 3.JPGphoto 4.JPG

photo 5.JPGphoto 4.JPG

 

Problem #2: Cutting clean circles

 

From my little experiment with the electric saw earlier, I noticed that cutting too fast (and most likely with the wrong blade/drill bit/...) the plexi was melting.

I needed to cut two big circles for my speakers though, so I tried to drill slowly using a hole saw (meant for wood).

 

photo 5.JPG

 

So far, so good, the hole saw did the trick. On the the third and final problem.

 

Problem #3: Cutting a clean rectangle

 

Moving from success to success, I was more and more afraid of messing up and having to start all over again.

 

The last thing I needed to do, was to cut a rectangle out of the middle for the LCD touch cape to fit in.

I used a Dremel with a cutting disc to slowly cut out the shape. The plexi was melting, but I figured I would clean the edges using sandpaper afterwards.

photo 1.JPGphoto 1.JPG

 

I started fitting the components to see if my work was at least usable:

 

photo 2.JPGphoto 3.JPG

The different components fitted nicely, but the cut edges were very messy. So I came up with an idea to mask all of that ...

 

Customising

 

I designed and printed some custom pieces to:

  • hide my messy work
  • protect the speakers
  • hide the LCD cape buttons (as I don't use them)
  • give the overall build a nice look

 

I designed the pieces in Sketchup, based on the measurements I had made to cut and drill the plexi.

 

Screen Shot 2014-03-09 at 21.44.31.pngfront.PNG

 

After a few test prints and some corrections, I printed the final version of each piece:

  • speaker grill
  • LCD cover
  • radio stand

photo 4.JPGphoto 2.JPG

photo 3.JPG

 

End Result

 

Here it is, the end result. My Beaglebone Black Radio in all of its glory:

photo 5.JPGphoto 5.JPGphoto (10).JPG

The cables at the back still require some more cleaning up, but overall I'm very satisfied with the result!

 

With the build done, I can now spend the remaining time of the challenge on finalising the software side of the project.

All entries in this blog series:

 

 

I don't have a lot of experience programming, I am however familiar with scripting and HTML. This is why I planned to create the interface for the radio in HTML/Perl.

 

Webserver

 

In order to be able to server the web interface of the radio, a webserver is required. While searching, I came across other people using "lighttpd" on the Beaglebone, so I decided to give it a try.

 

Installation

 

The lighttpd package needed to be installed:

 

root@beaglebone:~# opkg install lighttpd











 

The installation also took care of setting up the necessary files to start the webserver automatically:

 

ln -s '/lib/systemd/system/lighttpd.service' '/etc/systemd/system/multi-user.target.wants/lighttpd.service'
Job for lighttpd.service failed. See 'systemctl status lighttpd.service' and 'journalctl -xn' for details.
Adding system startup for /etc/init.d/lighttpd.











 

Once installed, I checked the status of the newly installed webserver:

 

root@beaglebone:~# systemctl status lighttpd.service
lighttpd.service - Lightning Fast Webserver With Light System Requirements
   Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled)
   Active: failed (Result: exit-code) since Sat 2000-01-01 01:36:45 UTC; 18s ago
  Process: 917 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd.conf (code=exited, status=255)
   CGroup: name=systemd:/system/lighttpd.service

Jan 01 01:36:45 beaglebone systemd[1]: Starting Lightning Fast Webserver With Light System Requirements...
Jan 01 01:36:45 beaglebone lighttpd[917]: 2000-01-01 01:36:45: (network.c.379) can't bind to port:  80 Address already in use
Jan 01 01:36:45 beaglebone systemd[1]: lighttpd.service: main process exited, code=exited, status=255/n/a
Jan 01 01:36:45 beaglebone systemd[1]: Failed to start Lightning Fast Webserver With Light System Requirements.
Jan 01 01:36:45 beaglebone systemd[1]: Unit lighttpd.service entered failed state











 

The webserver could not bind to port 80 because it was already in use. This was caused by another webserver already running on the Beaglebone.

 

Disabling default webserver

 

Following commands were used to disable the Beaglebone's default webserver:

 

root@beaglebone:~# systemctl disable bonescript.service
root@beaglebone:~# systemctl disable bonescript-autorun.service
rm '/etc/systemd/system/multi-user.target.wants/bonescript-autorun.service'
root@beaglebone:~# systemctl disable cloud9.service
rm '/etc/systemd/system/multi-user.target.wants/cloud9.service'
root@beaglebone:~# systemctl disable bonescript.socket
rm '/etc/systemd/system/sockets.target.wants/bonescript.socket'











 

Lighttpd was now able to start and bind to port 80 successfully. The default index page was accessible.

 

CGI/Perl support

 

With the webserver installed and running, it was time to activate the cgi modules.

 

In the lighttpd config file, I uncommented the "mod_cgi" module along with other CGI related parameters:

 

root@beaglebone:/www/pages# nano /etc/lighttpd.conf

## modules to load
server.modules              = ( "mod_access",
  "mod_cgi",
  "mod_accesslog" )

#### CGI module
cgi.assign                 = ( ".pl"  => "/usr/bin/perl",
                               ".cgi" => "/usr/bin/perl" )









 

I restarted the webserver to apply the changes:

 

root@beaglebone:/www/pages# /etc/init.d/lighttpd restart
Restarting Lighttpd Web Server: stopped /usr/sbin/lighttpd (pid 125)
2000-01-01 00:42:04: (plugin.c.169) dlopen() failed for: /usr/lib/mod_cgi.so /usr/lib/mod_cgi.so: cannot open shared object file: No such file or directory
2000-01-01 00:42:04: (server.c.676) loading plugins finally failed
lighttpd.











 

Even though I enabled the CGI module in the config file, the webserver refused to start. The module needed to be installed separately:

 

root@beaglebone:/www/pages# opkg install lighttpd-module-cgi
Installing lighttpd-module-cgi (1.4.31-r2.3) to root...
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/base/lighttpd-module-cgi_1.4.31-r2.3_armv7a-vfp-neon.ipk.
Configuring lighttpd-module-cgi.











 

With the CGI module now activated and installed, lighttpd was happily starting.

 

root@beaglebone:/www/pages# /etc/init.d/lighttpd restart
Restarting Lighttpd Web Server: no /usr/sbin/lighttpd found; none killed
lighttpd.











 

Testing a sample CGI/Perl page, I could validate the installation:

photo (2).JPG

 

User interface

 

I had a pretty clear idea of how I wanted my interface to look like, but before starting the actual implementation, I made some sketches.

 

Sketches

 

For the interface, I had three main menus in mind:

  • Listen: play controls, play mode (FM or Web) and channel selection
  • Manage: managing channels (add, edit, delete)
  • Configure: possibility to configure some settings of the radio

 

Implementation

 

While making the interface, I tried to avoid static values as much as possible. The interface should work on more than this very specific LCD and specific resolution alone.

 

By defining everything in proportions, the interface should look the same (or as much as possible at least) on different devices such as pc, smartphone, tablet, and LCD cape.

 

The code is still unstable, so I'm only providing a small preview here. The full code will be available once the interface is stable and finished.

Screen Shot 2014-02-27 at 21.52.51.png

 

Some screenshots/pictures of the interface accessed from different devices:

 

On the LCD cape:

 

photo 1.JPG

 

On the smartphone in landscape mode:

 

photo 2.PNG

 

And finally, on the laptop:

 

Screen Shot 2014-02-27 at 22.00.28.png

 

There is still a lot of work to be done, but I hope to post the final result soon!

 

Testing

 

Below you will find a video of a small test of the interface:

 

The radio is playing in FM mode. I then press on the web icon to switch to internet radio for the same channel.

You can hear a switch, but I'm not sure the difference between FM and internet radio can clearly be heard.

After that I press the pause (should perhaps become a "stop" button) to stop playing any music.

 

 

That's it for this week's post, stay "tuned" for more!

All entries in this blog series:

 

 

In this blog post, I document the actions that were required in order to get all hardware components of this project to run.

 

 

Beaglebone Black

 

After watching Ben Heck's episode on the BBB, I knew there were different ways to connect to it:

  • Using an HDMI monitor and USB keyboard/mouse
  • Using the mini USB connector
  • Over the network via SSH
  • Using the LCD cape

 

I connected the BBB on my local network using a UTP cable and powered it with a 5V power supply.

 

photo (4).JPG

 

After booting, the IP address was reported on my router:

 

Screen Shot 2014-02-17 at 18.53.45.png

 

SSH is enabled by default, with no password for user "root":

 

Fredericks-MacBook-Air:~ fvan1$ ssh root@192.168.0.192

The authenticity of host '192.168.0.192 (192.168.0.192)' can't be established.
RSA key fingerprint is d2:2d:7d:e6:9f:8e:03:38:f1:13:12:6d:f9:30:ad:0d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.192' (RSA) to the list of known hosts.
root@192.168.0.192's password:

root@beaglebone:~#


































 

I found an Adafruit tutorial on updating the BBB's OS step-by-step: Overview | BeagleBone Black: Installing Operating Systems | Adafruit Learning System

 

Even with the BBB already running the latest version of Angstrom, I thought it would be a good exercise to flash it to get familiar with the procedure.

 

I downloaded the latest Angstrom image from BeagleBoard.org - latest-images: BBB-eMMC-flasher-2013.09.04.img.xz

After the download completed, I extracted the image and used "dd" to put it on an SD card.

 

I first listed the devices to get the proper disk id:

 

Fredericks-MacBook-Air:~ fvan1$ diskutil list

/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *251.0 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            250.1 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *7.9 GB     disk1
   1:             Windows_FAT_16 RECOVERY                1.3 GB     disk1s1
   2:             Windows_FAT_32 boot                    58.7 MB    disk1s5
   3:                      Linux                         6.5 GB     disk1s6



































 

Then, I unmounted the SD card:

 

Fredericks-MacBook-Air:~ fvan1$ diskutil unmountDisk /dev/disk1

Unmount of all volumes on disk1 was successful



































 

Finally, I wrote the image to the SD card using dd:

 

Fredericks-MacBook-Air:~ fvan1$ sudo dd if=Downloads/BBB-eMMC-flasher-2013.09.04.img of=/dev/disk1 bs=1m

3488+0 records in
3488+0 records out
3657433088 bytes transferred in 2280.014020 secs (1604127 bytes/sec)






























 

40 minutes later, the image was written on the SD card, and ready to flash the BBB.

 

I inserted the microSD card in the proper slot on the BBB, held down the "user boot" button while powering it on. The 4 user LEDs lit up, and I released the "user boot" button.

 

40-45 minutes later, the 4 user LEDs remained lit up, meaning the flashing was done.

 

photo 1.JPG

 

I powered down the BBB, removed the microSD card and powered it back on.

 

When I tried to log in via SSH again, a message appeared telling me the remote host key had changed.

This is for me an indication the flash was executed. I removed the exisiting entry from my known_hosts file and was able to log in via SSH again.

 

 

LCD Cape

 

The LCD cape provided for the roadtest is the "BeagleBone LCD4 Cape" from beagleboardtoys.com.

It supports resolutions up to 480x272 and has a resistive touch screen and some buttons.

 

The pins at the back of the LCD cape are numbered, just as on the BBB. I ensured the pin numbers were aligned and connected the cape.

 

I'm not sure if done on purpose or not, but the bottom part of the Adafruit BBB enclosure can still be used with the LCD cape connected.

This provides a firm and protective base for the BBB.

photo 2.JPGphoto 1.JPG

Even the LCD cape's power button fits nicely between the BBB's ethernet and power port.

 

After booting a calibration screen was displayed:

photo 3.JPG

I had to repeat the calibration a few times, as it kept saying a mis-click was detected. On the fourth ( ! ) attempt, the calibration was accepted.

 

Once the calibration was done, the desktop was available:

photo 4.JPG

Using the latest version of Angstrom, I can say the LCD cape was really plug-and-play.

 

 

Wifi Adapter

 

The wifi adapter provided for this challenge is the UWN-200 from Logic Supply.

 

Instructions on how to install it on the BBB are provided on the website. It is also mentioned that in the latest Angstrom image (2013-09-04), the drivers for this UWN-200 wifi adapter are included by default.

 

The remaining thing to do was to configure the wireless interface by editing/creating the wifi config file:

 

root@beaglebone:~# wpa_passphrase <ssid> <passphrase>

network={
  ssid="<ssid>"
  #psk="<passphrase>"
  psk=103f69f05b3fdd791067919813682829d5999a1be2a1e3a2c1b608c1def6d1d9
}

























 

root@beaglebone:~# nano /var/lib/connman/wifi.config

[service_home]
Type = wifi
Name = <ssid>
Passphrase = <encrypted_passphrase_from_previous_command>

























 

The documentation also mentions that the ethernet connection needs to be removed for the wifi to connect automatically.

 

So I sent the reboot command via ssh, removed the ethernet cable, waited for the device to boot and checked my router again for the new IP address.

 

The BBB was accessible via wifi and the interface was indeed up and running :

 

root@beaglebone:~# ifconfig ra0

ra0       Link encap:Ethernet  HWaddr 00:0C:43:00:14:10
          inet addr:192.168.0.121  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:43ff:fe00:1410/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6572 errors:0 dropped:0 overruns:0 frame:0
          TX packets:307 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1487495 (1.4 MiB)  TX bytes:49645 (48.4 KiB)

























 

Again, very straightforward when using the latest Angstrom image.

 

Soundcard

 

I wanted to try two ways of getting audio from the BBB:

  • via HDMI
  • via a USB soundcard

 

HDMI

 

Using a microHDMI to VGA and Stereo out adapter, I was hoping to easily get audio out of the BBB.

photo (5).JPG

 

However, when listing the soundcards of the BBB, none were found:

 

root@beaglebone:~# cat /proc/asound/cards
--- no soundcards ---













 

root@beaglebone:~# aplay -l
aplay: device_list:252: no soundcards found...













 

After some searches online, I came across Beagleboard:BeagleBoneBlack HDMI - eLinux.org where it is stated that audio is only supported when using specific video resolutions.

 

I removed the LCD cape, tried listing the soundcards again, and there it was:

 

root@beaglebone:~# cat /proc/asound/cards

0 [Black          ]: TI_BeagleBone_B - TI BeagleBone Black
                      TI BeagleBone Black












 

root@beaglebone:~# aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: Black [TI BeagleBone Black], device 0: HDMI nxp-hdmi-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0












 

The soundcard appeared, but my microHDMI adapter still didn't show any video via VGA, nor was there any audio via the stereo jack.

 

I decided to park the HDMI audio solution for now and go with the hopefully more straightforward USB soundcard approach.

 

USB

 

I've ordered a USB soundcard for further testing, but it hasn't arrived yet.

 

This means I'll be proceeding without any soundcard for now, and will be coming back on this topic later on ...

 

 

SDR Stick

 

Then came the final and what I believed to be the most challenging component to get up and running: the SDR Receiver USB Stick.

 

Before working on the BBB directly, I wanted to test the SDR Stick on my laptop, as I had never worked with such a device before.

Via the SDR USB Stick's product page on Adafruit, I found a nice graphical tool ported to Mac: gqrx. I installed it and started playing.


In a matter of seconds, I was listening to the radio:

Screen Shot 2014-02-18 at 20.52.07.png

 

Knowing the stick was working, It was time to figure out how to install the necessary packages on the BBB.

 

While searching the net for information on rtl-sdr and BBB, I came across this page: Beaglebone RTL-SDR

 

Following the instructions, I executed following commands:

 

root@beaglebone:~# opkg update
root@beaglebone:~# opkg install libusb-1.0-dev
root@beaglebone:~# mkdir build
root@beaglebone:~# cd build/
root@beaglebone:~/build# git clone git://git.osmocom.org/rtl-sdr.git
root@beaglebone:~/build# cd rtl-sdr/
root@beaglebone:~/build/rtl-sdr# autoreconf -i
root@beaglebone:~/build/rtl-sdr# ./configure
root@beaglebone:~/build/rtl-sdr# make
root@beaglebone:~/build/rtl-sdr# make install



















 

(Note: You can find the full output of every command in the file attached to this post.)

 

I logged in via SSH and executed a test command to see if my rtl-sdr installation succeeded:

 

root@beaglebone:~# rtl_test -t

Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
Sampling at 2048000 S/s.
No E4000 tuner found, aborting.

















 

The device is recognised by the BBB and can now be used to listen to the radio!

 

However, without soundcard available or working (yet!), I ran the backend application on the BBB and the frontend on my laptop. This allowed me to run the SDR stick on the BBB, but control it from my laptop.

 

On the BBB:

 

root@beaglebone:~# rtl_tcp -a 192.168.0.121

Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuned to 100000000 Hz.
listening...
Use the device argument 'rtl_tcp=192.168.0.121:1234' in OsmoSDR (gr-osmosdr) source
to receive samples in GRC and control rtl_tcp parameters (frequency, gain, ...).











 

On my laptop, I started the gqrx application and provided the correct connection string, the BBB reported the client connected:

 

client accepted!











 

Radio was now working on my laptop via the BBB.

 

 

Conclusion

 

I managed to get all components provided in the roadtest kit up and running. The only pending hardware bit is getting a soundcard to work.

 

With (almost) all parts working, I can get started on the actual implementation of the features as described in my first post.

 

 

Update !

 

One day after posting this, my USB soundcard arrived. I should have been more patient ...

 

photo 3.JPG

 

Using the same commands as before, I tried detecting the USB soundcard after plugging it in:

 

root@beaglebone:~# cat /proc/asound/cards

0 [Set            ]: USB-Audio - C-Media USB Headphone Set
                      C-Media USB Headphone Set at usb-musb-hdrc.1.auto-1.1, full speed




 

root@beaglebone:~# aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: Set [C-Media USB Headphone Set], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0




 

Soundcard detected without any modifications. Feeling lucky, I tried playing out audio immediately:

 

root@beaglebone:~# rtl_fm -f 88.6e6 -s 200000 -r 48000 - | aplay -r 48k -f S16_LE

Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuner gain set to automatic.
Tuned to 88900000 Hz.
Oversampling input by: 6x.
Oversampling output by: 1x.
Buffer size: 6.83ms
Sampling at 1200000 S/s.
Output at 200000 Hz.
Playing raw data 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono




 

Audio was playing. Amazing. No need for driver installation, config file changes, etc ... just plug and play.

 

photo 4.JPG

All entries in this blog series:

 

 

 

This is my first post for the Beaglebone Black Radio Challenge. I have never worked with the BBB before, but I'm sure it will be a fun learning experience!

 

 

Project Description

 

For this challenge, I plan to create a FM/Internet radio combo with following features, using the Beaglebone Black:

  • All-in-one solution with integrated speakers and easy to use control interface
  • FM / Internet radio switching capabilities
  • Possibility to search and store FM / Internet radio channels

 

I will also attempt to display RDS messages in FM radio mode

 

 

GUI

 

The radio's interface should be straightforward and easy to use.

  • Options/actions should be made available through big buttons
  • Channel information should clearly be visualised
  • Some detailed information such as FM receive level, internet connectivity should be displayed in a status bar.

 

It seems the SDR USB stick also came with a remote control. Perhaps it can be integrated in the project as well, but I originally only planned control via the LCD touch screen.

 

 

Switching / Redundancy

 

In certain situations it might be more desirable to use FM instead of internet radio or vice versa.

 

For example:

  • Whenever possible, FM radio would be the preferred option as it doesn’t consume any internet bandwidth. But if due to certain conditions (e.g. due the structure of the building) the FM reception is not reliable or even possible, the system should switch to internet streaming.
  • When on holidays abroad, the regular FM channels wouldn't be available, so the only remaining option would be to use internet radio streaming in order to still be able to listen to your favorite channel.

 

The idea would be to monitor the FM reception level/quality (perhaps combined with other factors) to make the decision to switch to internet radio instead.

 

 

Audio output

 

The Road Test kit seems very interesting but it does lack one major component in order to build a usable radio: speakers.

 

I would test different options to provide connectivity for speakers, such as the HDMI port, a USB sound card, ... and see which is most useful and/or practical.

Shabaz has some interesting notes about the audio on the Beaglebone Black: BBB - Audio notes. I'm sure they will come in handy once I get started.

 

 

All-in-one solution

 

The provided case is not sufficient for the entire setup. This is why I would shoot for a “all-in-one” solution where I would create an enclosure able to contain:

  • BBB + LCD cape
  • Wifi USB stick
  • Radio antenna
  • Speakers

 

I’m thinking of two plexi glass panels (with cutouts for LCD and speakers) holding everything together in a good looking, but compact solution.

 

photo7.JPG

Early sketches of the solution in mind

 

Kit

 

My kit arrived yesterday. It looks great!

 

photo.JPG

Contents of the BBB Radio Challenge Kit

 

Unfortunately it's missing the Wifi USB adapter, but I've been told it should arrive any day.

 

 

 

photo 1.JPG

The BBB fitting nicely in its case


photo 3.JPG photo 4.JPG

LCD cape from beagleboardtoys.com


The different components look great and I can't wait for the weekend to start in order to have some quality time with my kit.


In the mean time, I'll be watching Ben Heck's Getting started with BBB video (again)!