element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • 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
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • 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
BeagleBoard
  • Products
  • Dev Tools
  • Single-Board Computers
  • BeagleBoard
  • More
  • Cancel
BeagleBoard
Blog BBB - Audio notes
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join BeagleBoard to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: shabaz
  • Date Created: 28 May 2013 9:51 PM Date Created
  • Views 6838 views
  • Likes 3 likes
  • Comments 17 comments
  • beaglebone_black
  • bb_black
  • beagle_bone_black
Related
Recommended

BBB - Audio notes

shabaz
shabaz
28 May 2013

EDIT: See here for details on how to build a DAC:  BBB - Building a DAC

 

The BBB, unlike the RPi, does not have an in-built analog audio output*. However, there is a USB port for a soundcard, and a HDMI interface. The nice thing about the latter is what it derives the audio from; a hardware I2S interface inside the AM3359, which sends data out to an NXP TDA19988 for conversion to HDMI. So, the possibility exists to obtain I2S directly, theoretically at up to 24bit/192kHz (128fs clock).

 

Just to confirm audio worked, I tried USB audio first quickly. Plugging in the nearest USB audio sound card works with the Beaglebone Black - I tried an old Creative SB1100. The whole thing was powered just from the USB connector on a laptop for this, and it worked, but probably an external power supply should be used.

 

There are some software bugs however, because the sound was lower volume in one ear, like a software mixer issue. Hopefully that will be ironed out in a release sometime (the BBB is only a few weeks old currently). Apart from the lower volume issue, the audio quality was extremely good.

 

This is the procedure to get audio  playing:

 

ls -ald /dev/dsp* (you will see /dev/dsp listed)

Plug in the sound card and repeat. Now you will see /dev/dsp1 also listed.

 

Get the sound card name:

 

aplay -L

 

in my case, I saw:

 

default:CARD=GO

 

 

Play an MP3 file:

ffmpeg -i test.mp3  -f alsa "default:CARD=Go" -re -vol 20 (where vol is 0-256; 0=silent)

 

top revealed about 14% CPU consumption on the particular MP3 file that was being played.

 

I tried to play the same audio file but directing to HDMI:

ffmpeg -i test2.mp3  -f alsa "default:CARD=Black" -re -vol 20

 

It did work, but the current software build has known HDMI audio issues and it was noticeable - it didn't sound great always. Not noise, but some other digital effect.

 

There is not much information on NXP's site for the IC that provides the HDMI interface (TDA19988), however the BBB reference manual (SRM) specifies that  I2S is used to it, clocked at 24.576MHz. I don't have an external DAC, but I was curious if it was truly I2S format as currently configured for the TDA19988. The I2S interface comes out to header P9:

 

BBB Description    Header pin          Description

SPI1_CS0            P9_28               Bitstream

SPI1_D0             P9_29               Left/Right clock

SPI1_SCLK           P9_31               Bit clock


 

The actual data is on the pin CS0, not D0.

 

Looking on a scope, it is clear that the 24.576MHz clock runs always, and the other two pins are low. When there is sound to play, the Left/Right clock begins to toggle (at 32 bits) and then after a short while the bitstream occurs. I couldn't determine which side the padding was for 16/24 bit audio, but these things are configurable on DACs anyway. I noticed the bit change occurs on rising edges of the bitclock, so they are read in on the falling edge of the bitclock.

So, in summary, it is configured as an I2S interface, and it would be rather easy to connect up a decent external DAC if desired (e.g. car audio applications).

I don't know enough about Linux audio, but it would be nice to even send high quality FLAC file content (e.g. from attached storage) after non-lossy conversion into an audio stream directly through the I2S interface.

 

* Although there is no analog output, there is the possibility to toggle pins (at up to 200MHz) for cheap audio, either as PWM, or with multiple pins and summing. It's very cheap just to use I2S  however, since some DAC ICs cost less than $1.

  • Sign in to reply
  • Former Member
    Former Member over 12 years ago in reply to shabaz

    Hello there!

     

    Thanks for sharing your experiences, your writing gave me hope that perhaps we can get audio output for our project with a minimal effort from the header pins. Could you please repost that schematic about the DAC?

     

    Thank you very much!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 12 years ago in reply to cstiegman123

    Hi Craig,

     

    Unfortunately I've done very little with USB audio (except to confirm that a basic USB soundcard could work), and most of the effort was directed at a non-USB DAC here, functioning using I2S. For the non-USB DAC, 24-bit should be possible, but I did not recompile the audio libraries, and I observed just 16-bit audio. 24-bit should be feasible in theory, it is something I'm looking forward to eventually trying too.

    The USB interface on the BBB should support your requirements, but I suspect it is down to the audio libraries and any drivers, which may need compiling. I just don't know enough about USB audio unfortunately. If you find a link to more information, do let me know.

    Regarding audio and MIDI apps, they will most likely run, assuming that the source code is available so that they can be compiled for the BBB. I have a USB MIDI cable which I originally used on Linux x64 so I could try to compile up some app on the BBB at some stage to try it, just out of curiosity.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • cstiegman123
    cstiegman123 over 12 years ago

    Hello Shabaz-

     

    Thank you so much for posting your article on USB Audio with respect to Beaglebone Black.  I was wondering if I could ask a few additional questions regarding this topic. Looking to use Beaglebone Black for audio purposes.

     

    On a high level, here is what I am looking for:

    - USB audio class version supported by BB Black -> Audio class 1.0 or Audio class 2.0 or both?

    - USB audio streams supported -> audio OUT only (playback) or audio IN only (recording) or both IN & OUT (simultaneous recording and playback)

    - USB audio clocking system supported -> Synchronous or Asynchronous or Adaptive or some combination of these 3 types

    - Digital audio bit resolution supported -> 16 bit only, 24 bit only or both 16 & 24 bit support

    - USB audio sampling rate support -> 32k/44..1k/48k/88.2k/96k etc.

    - USB audio configuration applications available on the BB Black platform -> Something similar to Audio MIDI Setup on Mac or Windows Sound utility.

    - Audio and MIDI applications available on the BB Black platform etc..

     

    Thank you in advance for whatever light you can shed on these inquiries.

     

    Best Regards,

    Craig

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to shabaz

    Hi Shabaz,

     

    I think I fried my chips, so I gave up. But if I come across a PCM5101, I'll go for it.

    Thank you schematics and another nice article, I'll check it out soon image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 12 years ago in reply to Former Member

    Hi Technoshaman,

     

    I've since tried a DAC, I went for TI PCM5101 which is quite low cost, and it appears to work well with the BBB.

    For an audio amp, I used ON Semi NCP2811A. The combination gives good results. See here for the circuit and notes.

    • 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 © 2026 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