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
  • 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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Blog Can you hear the Wolf(son) calling? Setting up and using the Wolfson Audio Card
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
GPIO Pinout
Raspberry Pi Wishlist
Comparison Chart
Quiz
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: cstanton
  • Date Created: 14 Mar 2014 2:40 PM Date Created
  • Views 4996 views
  • Likes 5 likes
  • Comments 60 comments
Related
Recommended
  • wolfson
  • raspberry
  • audio
  • pi
  • microelectronics
  • micro
  • raspberry_pi
  • wm5102
  • raspeberry_pi_accessories
  • electronics
  • hd_audio
  • card
  • hd

Can you hear the Wolf(son) calling? Setting up and using the Wolfson Audio Card

cstanton
cstanton
14 Mar 2014
image

 

This audio card will push your Pi.

 

The Wolfson Audio CardWolfson Audio Card has taken a good amount of time to come forth from Wolfson Microelectronics and with decent reason. They want to make sure that they have it right and something that you can work with. As with any audio setup it takes a little time to optimise and get it setup correctly, but once you're there then you have a potentially powerful portable audio sensation in your hands. The audio codec with digital signal processor for voice, WM5102 even won an award in 2013 for innovation from the Institute of Engineers and Technology (IET)


The package for the Wolfson Audio Card comes in the standard Raspberry PiRaspberry Pi add-on box that you may be used to if you've picked up a GertduinoGertduino or Pi FacePi Face. The box clearly informs you as to the features the device comes with and where to go for more information. Chances are you're going to need it.

 

Upon opening the packaging you're presented with the regulation anti-static bag containing your card along with a slip of paper covering regulations compliance and rather curiously, a plastic screw. It seemed odd at first why there was a lone screw in the box, but once I fitted the audio card to the Raspberry Pi it became clear.

 

To ensure that the boards push/pogo-pins make contact with the Raspberry Pi, using an unpopulated header next to the GPIO breakout it needs the screws to make sure that the board is pushed securely to the Pi. I found it stranger that it wasn't a metal screw, but this makes sense after making sure that it was fully in, it potentially touches on some on-board circuitry and we wouldn't want any short-outs to happen.

 

Before getting started with the setup, make sure that you have any USB devices that you're going to use with it, plugged in. I had the unfortunate experience later when I exchanged my USB devices for others that the Raspberry Pi restarted. There is warning of using USB hubs in the user manual so I suspect this is related and possibly an issue with power.

 

The best choice to get started is to write the SD Card image provided on element14 to get started with the card, there are a number of modifications and hacks to the stock Raspbian kernel and installed modules that have been necessary to get the device to work.

If you're running Windows then you can download Win32DiskImager to write the image to the SD Card, so long as you have Administrative rights and a way to connect your SD Card to your computer. Or if you're running Linux you can use the dd command to write it to your /dev/<device name> card. If you need to check this, then typing 'man dd' at a terminal will help you with the dd command, and typing 'dmesg' at a terminal will help you to determine what your SD Card is referred to as.

 

You have the option of downloading and compiling the kernel/driver source code and apply the patches to it to get it to work and then install the modules; but unless you're comfortable with cross-compiling on a faster computer and debugging any problems that occur you're going to be waiting a long time, not just for compiling on your Pi but also downloading the source files for the Raspbian kernel. Hopefully Wolfson Microelectronics or a member of the community will bring out a Raspbian package to install from or the changes will be integrated into the Raspbian OS by default in the future.

 

*Edit*: Ragnar Jensen has pulled out the compiled kernel and modules for the Wolfson Audio Card along with the use case scripts and put them into a compressed file that you can extract on your existing Raspbian installation. Note that this will lock you down to using a specific kernel that will not be updated when you update Raspbian, you can get it from here.

 

The SD Card needs to be of Class 6 or higher, especially if you want to read/write high quality audio, of note is that the Raspbian installation, which I downloaded at least, has been modified by Wolfson and attempts to overclock the Raspberry Pi to 900mhz with slight voltage alteration. This can be disabled in the config.txt in the /boot/ folder by finding the relevant lines and removing them.

 

So, let's test it by playing music! When you have booted your Pi with your audio card attached and SD Card setup you will want to open LXTerminal on the desktop, then type one of the relevant commands, assuming that you are in the /pi/home directory, based on how you want to listen to your music:

 

CommandDescription
./Playback_to_Headset.shIf you want to use the black headphone jack
./Playback_to_Lineout.shif you want to use a set of powered speakers from the LineOut jack
./Playback_to_Speakers.shif you want to use a set of speakers powered from/connected to the header(s) on the board
./SPDIF_playback.shUse the S/PDIF digital connection on the board

 

These scripts are located in the 'pi' user account home directory (/home/pi) and they are just a set of commands for setting up AlsaMixer (aka amixer, which PEarle has gone into more detail in his tasty write-up here: Wolfson Audio Card - Command Line recording ) to use the relevant device for outputting the audio. Once you're familiar with Alsa and the scripts you can edit these as you see fit, they commit themselves such that they're persistent after a reboot of the Pi.

 

Once you have setup your output, we can run Music Player from the desktop, the playlist is already populated, then just play away. These audio files are in a very nice .flac format which is a non-loss audio compression standard. For me there was some delay before the play started, and there were gaps, clicks and pops. This is because I was using a Class 4 SD Card, I changed this for a Class 6 and played just fine. It still wasn't very fast on occasion though, with this particular Raspbian installation there is a CPU usage monitor on the taskbar which was regularly sitting at 100% usage.

 

Now, to record on the Wolfson Audio Card is a different matter, it isn't straightforward to install audio software such as Audacity and just record. The best way to check it is to run a command from the terminal again. To setup AlsaMixer using the scripts you can choose one of the following, assuming that you are in the /pi/home directory:

 

CommandDescription
./Record_from_Headset.shRecords from the boom mic' on a headset
./Record_from_lineIn.shRecords from a powered/amplified device/microphone on the line in jack
./Record_from_DMIC.shRecords from the stereo microphones that are situated on the Wolfson Audio Card
./SPDIF_record.shRecords from the digital S/PDIF connector

 

For recording, unfortunately I do not have any S/PDIF equipment, or a boom microphone style headset, so I mainly tested the on board digital stereo microphones! I can confirm that they're definitely in stereo, record quite clearly with minimal post-cleanup, but the channels were opposite to how they are marked on the board (left was right and right was left). Which is just a minor point really.

 

Fullscreen 5706.contentimage_30817.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>

 

In the picture to the left, in the audio file I recorded via command line and then loaded into Audacity you can see where I spoke into each left/right channel individually at an intentional offset.

 

You can also see what the record quality is like for silence up until that point, initially there is some raised audio level and the click of initialisation. It is probably a good idea to bare this in mind when you're recording and to do some post cleanup depending on what you're using it for.

 

The method suggested to record audio on the Wolfson Audio Card is specified in each of the .sh files, which you can run the command "less ./Record_from_DMIC.sh" to read. I didn't manage to get Audacity to record from the card directly as it only had options for S/PDIF - I am assuming this is because of how Audacity integrates with Alsa and that this is not currently setup in an ideal way even by switching with the scripts (use cases) provided. Edit: It's worth reading Ragnar's post below in the comments regarding using Audacity with the Wolfson Audio Card, in particular the post on altering the use case for the on board digital microphones (DC offset on microphones and workaround.).

 

All in all it's a nice little board but it's going to take a bit of polish and work from Raspbian/the Community/Wolfson microelectronics to get the process streamlined, but I'm thankful we now have the opportunity to do so! The results are definitely worth it.

  • Sign in to reply

Top Comments

  • Former Member
    Former Member over 11 years ago +2
    I have found that if I select wolfson_pi_soundcard: AIF:0 as input in Audacity, it will record from whatever I have selected with the "Record_from..." scripts. There is DC offset when recording from the…
  • Former Member
    Former Member over 11 years ago +1
    Hey Chris, Nice fyi..
  • Former Member
    Former Member over 11 years ago +1
    Thank you Chris for this very useful walk through/review.
Parents
  • Former Member
    Former Member over 11 years ago

    Hi!

    While I can record using the built in mic, I just get silence if using an external stereo mic.

    I've tried plugging both to the headset and to the pink connectors (btw, which one is to be preferred?)

    The jack has 2 rings and is connected to 2 mics, left and right. This system works fine if connected to

    a zoom h4n recorder, so I'm sure jack and mics perform ok.

    Could it be a hardware problem in the (new) wolfson board?

    Thanks

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

    image

     

    The headset jack on the Wolfson card is wired for Apple compatible headsets. As seen in the illustration above, it has four connections:

    • Tip - headphone left
    • Ring 1 - headphone right
    • Ring 2 - ground
    • Sleeve - microphone (mono)

    Don't connect your mic to the headset jack, you might accidentally harm it if you were to play sounds to the headset's headphone.

     

    Your stereo mic is wired like the "Generic Sound connector" in the illustration.

    The pink Line In jack is wired the same way, but your mic will not work there either because the Line Input expects signals much stronger than what a microphone produces.

    Mic levels are typically around one millivolt, while line levels are several hundred millivolts.

    You need a mic pre-amplifier. And you already have one, the H4n. With a cable like this:

    image

    you can connect the headphone/line out jack of the H4n to the Wolfson's Line in and use the H4n as a pre-amplifier.

    --

    Ragnar

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

    I had a look at the Marshall Major FX headphones with mic. and they appear to be provided with a 'tip, ring and sleeve' jack plug, shown in Ragnar's illustration (July 7th, 2014, above) of four jack plug types as the 'Headset Connector' version, second from the left. This means that they are a mono headset and mic. However, what is needed is shown in the fourth example of 'tip, ring, ring and sleeve' (left headphone, right headphone, ground and mic).  The mic connection is supplied with power from the Cirrus card. The microphone you refer to contains a 'coin' cell and is not a simple electret microphone and probably will not work (my powered electret mics also fail to work).

     

    The Apple earphone/mic required is the one used with their smartphones. I found several of the ear-bud plus 'Levallier' style microphone products on eBay for just a few pounds and they work well with the Cirrus board. If you want particularly good microphone quality then you should use a good microphone via an external microphone pre-amplifier and the Cirrus 'Line In' port.

     

    I could not find the model I purchased, but these seem to fit the bill,

     

    3.5mm In-ear Earbud Earphone Black with Microphone for iPhone iPad Smartphone UK | eBay

     

    Note the 'tip, ring, ring and sleeve' jack plug as opposed to other Apple compatibles with only a 'tip, ring and sleeve'.

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

    Thanks Roy for the quick answer.

    First of all I'd like to show you the jack of my headset because I cant notice the difference.

    image

    Are they "tip, ring and sleeve"?

    I will try with my roommate's iphone headphones later and i'll tell you.

    I need some quality capturing audio, thats why I would need some omni-MIC or something like that.

    The quality of the on-board DMICs are enaugh for me but for my project I was asked to try external mics.


    Thanks for your job and time.


    Alejandro.


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

    Hi Alejandro!

     

    I had a look around and found that those headphones are available in two versions; as ordinary headphones and as Apple-compatible headset. They are even available from the Apple store. Your connector is tip-ring-ring-sleeve, it as four metal parts with three black plastic insulators between them, just as on an Apple headset. Your Marshall headphones should work in the headset jack on the Wolfson card. If they don't it is not normal.

     

    The Audio-Technica microphone you linked to will not work without an adapter.

    --

    Ragnar

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

    Thanks Ragnar for your answer.

     

    What could be wrong? I am taking audio from line in, DMICs, using filters and equalizers, listen from line out and everything works but this.

    Could it be any hardware problem? I am using the example script from wolfson and I just listen silence.

     

    Thanks!

     

    Alejandro

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

    It could be broken hardware image

    It could also be dirt inside the jack. I had that problem on my iPhone once, none of my headsets worked at all and at first I thought the phone was broken. But when I shone a flashlight into the headset jack I discovered a small ball of dust at the bottom, that made it impossible to insert the headset plug fully. I had to use a very thin toothpick to get the dust-ball out but afterwards all my headsets worked image

    --

    Ragnar

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

    It could be broken hardware image

    It could also be dirt inside the jack. I had that problem on my iPhone once, none of my headsets worked at all and at first I thought the phone was broken. But when I shone a flashlight into the headset jack I discovered a small ball of dust at the bottom, that made it impossible to insert the headset plug fully. I had to use a very thin toothpick to get the dust-ball out but afterwards all my headsets worked image

    --

    Ragnar

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

    Thanks Ragnar for your answer again.

    I hope it is not a hardware problem, If I could try in another board...

    I cleant everything and it keeps like before.

    Thanks for your advice!

     

    Alejandro

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

    Hello again Ragnar,

     

    Sorry for bothering you. I don't know if it means something but I found a sony headset, which mic can record when I blow into it, it's like if there was no enaugh volume to hear my voice, even having "IN1R Digital Volume" and "IN1R Volume"  at max.

    Do you know why could it happen?

     

    Thanks again!

    • 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