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 - USB Audio and listening to fm radio
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Nitin_Bhaskar
  • Date Created: 19 Feb 2014 3:57 AM Date Created
  • Views 976 views
  • Likes 3 likes
  • Comments 2 comments
  • usbaudio
  • bbb
  • sdr
  • beaglebone_black_radio
Related
Recommended

Beaglebone Black Radio challenge - USB Audio and listening to fm radio

Nitin_Bhaskar
Nitin_Bhaskar
19 Feb 2014

After setting up the rtl-sdr software as defined here, next step to enable the USB sound card as planned. Unfortunately I don't have any USB sound card as of now, so i emulated one as described here. BBB has the audio output on HDMI port by default, so it is necessary to disable that, to ensure the audio playback on USB sound card. This can be done by changing uEnv.txt after "BEAGLEBONE" drive shows up on your host system. Change the uEnv.txt to

 

optargs=quiet capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN

 

This ensures that HDMI is disable and USB sound card will be the default sound output/input device on BBB.

 

Add "/usr/local/lib" to LD_LIBRARY_PATH, so that rtl_* commands does not throw any error for LD_LIBRARY_PATH update.

 

root@beaglebone:~# export LD_LIBRARY_PATH=/usr/local/lib/

 

Next connect the USB sound card and RTL2838U to BBB using powered USB hub. and enter command "lsusb".

 

root@beaglebone:~# export LD_LIBRARY_PATH=/usr/local/lib/
root@beaglebone:~# lsusb
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 008: ID 1fc9:2046 NXP Semiconductors
Bus 001 Device 005: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T

 

This ensures that both NXP Semiconductors sound card and RTL2838U is now connected to BBB.

 

You can also use "aplay -L" to list the available sound cards

 

root@beaglebone:~# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=Demo
    NXP Audio Out Demo, USB Audio
    Default Audio Device
sysdefault:CARD=Demo
    NXP Audio Out Demo, USB Audio
    Default Audio Device

 

The output of USB sound card can be tested using.

 

root@beaglebone:~# cat /dev/urandom | aplay -r 48k
Playing raw data 'stdin' : Unsigned 8 bit, Rate 48000 Hz, Mono
^CAborted by signal Interrupt...

 

All you hear is noise on headphones or external speaker connected to USB sound card image

 

Now we are good to listen to any FM radio station by following command,

 

root@beaglebone:~# rtl_fm -f 91.9e6 -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 92200000 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

 

"rtl_fm" is the application name for streaming FM radio and it takes following parameters in above mentioned command,

"-f" : frequency, which in our case is 91.9MHz or 91.9e6Hz

"-s" : Sample rate, which is 200k

"-r" : Output rate of 48k

The output from rtl_fm is piped to "aplay" which takes following pararmeter in above command

"-r" : Sample rate of 48k

"-f" : Sample Format, which in our case is 16 bit little endian

 

Short video:

 

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

Attachments:
uEnv.txt.zip
  • Sign in to reply
  • Nitin_Bhaskar
    Nitin_Bhaskar over 11 years ago in reply to onebeartoe

    Thanks Roberto,

     

    rtl_am is not available after "make install" of the rtl-sdr software. I am trying to explore the options available to tune to AM stations too.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • onebeartoe
    onebeartoe over 11 years ago

    Awesome, Nitin!  I looked around for rtl_am, but didn't find it. 

     

    Is there a way to play AM stations?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
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