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 6839 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 Former Member

    Glad it was helpful for you image I did consider the MAX5556 as well, but I couldn't find it around where I live (I'm actually getting an HDMI to VGA + Audio converter with external power for a really small screen I got with VGA input. I just got curious thanks to Shazam's article and wanted to see if I could get a cheap DAC to work quickly, so I didn't look too hard, or on the net). I'm pretty new with this audio stuff (samples rate calculations, etc.), I'll have to read more on audio DAC's.

     

    Your explanation makes more sense to me now that I took a quick look at the TDA19988 datasheet (pages 25-26). How did you figure out what fs TDA1543 wants, though? I couldn't see it in the datasheet.

     

    I guess the TDA1543 should play without the 1/4, like you said, since the frequency drops down to 3.072MHz (1/4 of this is what the TDA1543 gets after two D-FF's in my circuit, I don't think 768KHz is good for us at all, all we get is 12KHz?) at the time of playing. I wonder if the initial 24.576MHz would be ok with the clock input of this chip (with 9.2MHz max. clock input), since BBB outputs this clock signal at all times, before we start playing the mp3. I'm at work right now, I'll try it tonight (along with different mp3's with different sample rates) when I get home.

     

    I'm still not sure about the opamp part of my circuit (and the PCB was kind of a mess), hopefully the IC's are still working after all the abuse :|

     

    Emrah

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

    Techno,

     

    I'm glad you observed that clock frequency change.  I've been knocking my head against the wall looking for compatible DACs based on that 24.576MHz clock.

     

    You see, the TDA19988 wants to see a clock equal to either 32fs or 64fs.  If the BBB really provides the chip with a constant 24.576MHz clock, then the audio sampling rate would be at least (24.576e6 / 64) divided by 2 channels = 192Khz.  This is within the HDMI specification but is rather high for desktop or embedded computer audio.  Most mp3 files would need to be up-sampled by the host.  This seemed unlikely to me, but I was rolling with it while looking at DACs.

     

    Damn few DACs filled the bill at 192KHz sample rate with a x64 clock.  There are only a few full-blown audio codecs out there that will do that.

     

    Now, if the BBB is shifting gears clock-wise based on the audio sample rate, the cheap DACs are back in play.  The numbers that you measured make sense.  A Ws clock of 48KHz means the sample rate was 48KHz, and if you multiply that by 64 you get 3.072MHz.  The legal multipliers for the TDA19988 are 32fs and 64fs -- so the Ws clock you observed is consistant with a 3.072MHz or 6.144MHz clock.

     

    Given this new information, the following DACs look pretty promising:

    UDA1334 (internal pll just like the TDA19988 chip, so it does not need a 512x clock)

    MAX5556 (but this chip needs a 512X clock in addition to the 32X clock, so it needs a 24.576MHz clock *also*)

    TDA1543 (I really think this will play without the divide-by-4.  Have you tried it?)

     

    Don

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

    I forgot to mention that I'm running Ubuntu 13.04 on my BBB (so I guess we're sorta on different tracks). This is where I used as resource: http://eewiki.net/display/linuxonarm/BeagleBone+Black

    I would rather go for a better DAC (such as a MAX9850 with up to 40MHz clock and a headphone amp, eliminating the need for 2 other ICs), but TDA1543 was all I could find around here :| Hopefully, you'll have more clues than I've had so far.

     

    Enjoy your travels 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,

     

    That's interesting. I wonder if anything has changed in an image. I believe I tested in the release that was 2 releases back from 6/6 dated image. When I played an audio file, I saw the frequency remain the same (24.576MHz) using the ffmpeg command line shown above. However, I will double-check, and with some other mp3 files too. I am interested to implement a DAC too.

    However, I am traveling for about 10 days, so unfortunately I won't be able to do this until I get back.

    At the time of writing, there were audio issues but there have been two released new software images since then, so I need to retest. I will likely test with a different DAC IC however, I have a couple but I'm undecided yet which one to implement first).

    • 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 again Shabaz,

     

    I have built the circuit, but I can't get any sound, other than some pops when I start to play an mp3 (I probably failed at the opamp part, no idea yet).

    The clock speed at pin 31 is 24.576MHz at rest, as you mention in your article, but when I start to play an mp3 as you showed above, the frequency drops down to it's eighth, ie. 3.072Mhz. I know this is further divided by 2 by another D-FF on the BBB. The datasheet of TDA19988 says it needs a 12Mhz for the CEC clock to run anyway.

    The normally low running WS (or R/L Clock) runs at 48.08KHz when an mp3 is played, the mp3 I'm playing is "Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16, 192 kb/s"

    I don't mean to take your time , so any quick tips?

    You also said "but the current software build has known HDMI audio issues", do you know what these are?

     

    Here's a link to the PDF, in case you need it.

    http://hipstercircuits.com/wp-content/uploads/2013/05/TDA19988.pdf

    • 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