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
Raspberry Pi Forum New reworked driver for Wolfson/Cirrus Logic 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
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 390 replies
  • Subscribers 744 subscribers
  • Views 43186 views
  • Users 0 members are here
  • raspberry_pi
  • raspeberry_pi_accessories
Related

New reworked driver for Wolfson/Cirrus Logic audio card

hiassoft
hiassoft over 9 years ago

I've been working on a driver rework, mainly to get rid of the requirement to carry around a bunch of patches to upstream driver code, and also to fix some outstanding issues and introduce some new features.

 

Most issues have been ironed out so here's the first public release.

 

Edit: the driver has been included in official RPi kernels. Just run sudo rpi-update to install it.

You still have to install the mixer scripts and add the /etc/modprobe.d file. See my website for details

RPi Linux driver for Wolfson / Cirrus Logic Audio Card

 

Source: https://github.com/HiassofT/rpi-linux/tree/cirrus-ng-4.9.0

Precompiled kernel: http://www.horus.com/~hias/tmp/cirrus/cirrus-ng-linux-4.9.0.tgz

New mixer scripts: http://www.horus.com/~hias/tmp/cirrus/cirrus-ng-scripts.tgz

 

Important notes:

  • The new driver bases on the rather fresh kernel 4.9.0 which means there's some risk of (yet unknown) issues. Use it at your own risk and please run "rpi-update" to get the latest firmware before installing the new driver.
  • The soundcard name has been changed from "snd_rpi_wsp" to "RPi-Cirrus", also several ALSA controls have been removed and new ones were added. This means the old usecase scripts and any custom-made scripts will no longer work. Use the new mixer scripts instead of the old usecase/listen scripts.
  • The new driver supports setting (and receiving) of the S/PDIF channel status bits (aka AES bits). If you add an ALSA card configuration file this means applications like Kodi can do proper AC3/DTS passthrough. A sample card configuration file (plus the mixer scripts) can be found here: https://github.com/HiassofT/rpi-cirrus-config
  • I haven't fully updated the documentation on my website RPi Linux driver for Wolfson / Cirrus Logic Audio Card  yet, will do that during the next weeks/months. But except for the things noted above most stuff should still work as in previous driver versions.

 

Please report back if you tested the driver (either successfully or unsuccessfully), any feedback will help me!

 

so long,

 

Hias

  • Sign in to reply
  • Cancel
Parents
  • timg73
    timg73 over 8 years ago

    Hias,

    A huge thank-you for all the work you've put into supporting the Cirrus Audio card.  Until now I've been using your kernel packages, and have just got round to trying the latest official 4.9 kernel which is also working very nicely.  It's a real shame that the Cirrus card has (or appears to have) gone out of production just when the software support became so good.  The older Wolfson cards are still available, so perhaps I'll get a couple and try modifying them to fit a 40-pin header.  Anyway, thanks again for everything you've done.  I really do appreciate it.

    Tim

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • hystrix
    hystrix over 8 years ago in reply to timg73

    The Cirrus Card does seem to be out of stock everywhere - what a shame.  I just started working on an alternative ultrasound sensistive microphone, since the electret type I was using has been out of production for years and is now virtually impossible to get hold of.

     

    What other options are there for recording audio at 192kHz with the Raspberry Pi?

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • marcelheijkoop
    marcelheijkoop over 8 years ago in reply to psyj

    John,

    Reading your posts I must admit my knowledge of filtering is not near your expertise.

    Stil I would like to ask you a question for possible use in the Cirrus Logic Audio Card.

     

    Currently I experiment/use the card to drive my speakers using the on board amplifier.

    Although rated at 1.4 to 2.8 watts in different documents I am impressed to what volume it produces with my speakers.

    It is enough for serious listening in house in my situation.

     

    Still as the speakers can be bi-amped , I was wondering if it would be possible to use the 2 channels to drive the low, and mid+high speaker separately and  gain a bit more efficiency by digitally filtering signals before amplifying them, and avoid losses in the speakerfilters.

    As the wolfson chips only have 1 stereo path I seen no output for a separate (sub) woofer output, not even if it is un-amplified signal for an external amp.

    But correct me if I am wrong.

     

    Do you see options to set separate low pass and high-pass filters to drive high and low drivers separately  ?

    And would it really output more efficient energy to the drivers to be noticeable ?

    If you could help me set filters around 400 Hz, I would like to try it .

    And as I have 2 cirrus cards I could use all 4 amp channels.

     

    Regards Marcel

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • psyj
    psyj over 8 years ago in reply to marcelheijkoop

    Hi Marcel,

     

    If I have understood your questions correctly the answer is yes to almost all of them!

    Perhaps if I explain the setup I actually use at home when listening to music it will give you a way of doing what you are seeking to do.  (Before I do I should explain that, if I remember the datasheet correctly, all 3 of the outputs from the 5102 are electrically equivalent, which is to say they can all drive 15 ohm loads)

     

    I have two speakers connected to a nice 1980s amplifier.  I also have an active sub-woofer.  The amplifier (and indirectly the speakers) is connected to the line out socket of the Wolfson.  The sub-woofer is connected to the headphone socket.  So one Wolfson card feeds 3 channels, it could do more.

     

    Now my sub-woofer has a built in low pass filter.  So all I need to do to get that to work is to connect both L and R channels from the input to the left (or right) mixer of the headphone ouput. That mixes stereo down to mono for the sub-bass output.

     

    For the main speakers obviously L and R are kept apart.  For each of the two channels the input goes to a LHPF block, then to a second LHPF block and finally to the line output.  This gives a very sharp cut-off and in this case the LHPFs are programmed as high-pass filters which are the complement of the (analogue) low pass filter built into the sub-woofer.  You could use just one LHPF block on each channel and have a softer roll-off.  This would be necessary if you need to put a low pass filter into the sub bass outputs. (Because the digitial core of the 5102 has just 4 LHPF modules)

     

    All of the connections and filter settings are programmed through Alsamixer, thanks to Hias excellent work.  Elsewhere in this thread I have described how to calculate the filter parameters, though a simpler way of doing it is to use the WISCE software to calculate the numbers.

     

    400Hz seems very high for a cross over frequency, is that what you need.  And do you know how rapid the roll-off needs to be?  If I understand correctly you want to low pass one pair(L/R)  of outputs and high pass the other pair.  Off-hand (though it is late) I cannot think of a simple way of passing the settings you require.

     

     

    So there are some challenges in the detail,  but I believe that all you want to do can be done, by a single 5102 board

     

    John

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • marcelheijkoop
    marcelheijkoop over 8 years ago in reply to psyj

    Hi John,

    I have done no calculations on my speakers, and also do not know where to get the data to do them.

    The column speakers do have quite some volume ( in liters ) but the low drivers are not as big as a separate ( active ) subwoofer would have.

    For the about 16 CM drivers I just guessed 400 Hz as a first attempt.

    And with very steep filtering handover is more pronounced and thus easy to noticed if not set correct.

     

    I understand your setup where you use line out and headset out to carry the same stereo signal, but filter them differently, and in combination with your external subwoofer speaker filter and mono , add combine this into 1 low signal that is amplified in that box.

     

    My idea was to use the 2 channels  in 1 card to both carry , f.i. the left channel.

    And then filter 1 to pass high, feed it to the on-board amplifier and feed the mid/high section of my speaker.

    And let the other to pass low , feed it to the on-board amplifier 2 and feed the low section of my speaker.

    This woud reduce my output to just the left channel, but with a separate amp for low and mid/high.

    If I remember correctly from playing with the alsa options the filters for left and right are separate, and routing of 1 signal channel in both output channels is possible.

     

    The experiment would be to see if one could obtain more effective output by filtering before amplification , and secondly if it would produce a noticeable result.

     

    .....

     

    Thinking of it a bit more now, using a second pi and card to drive the other channel would generate time differences in left/right channel reproduction and create distortion in the stereo image. And this is likely to be much more a disadvantage than the gain one could obtain from a bit more power.

     

    So if I would choose Mono output, the idea might be useful, but for stereo external amps are required to get a bit more output power.

     

    Regards, Marcel

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • psyj
    psyj over 8 years ago in reply to marcelheijkoop

    Those on  chip D class amplifiers are remarkable for what they do, but personally I would not use them.  You could arrange to use that amplifier for just the high frequency components where less power is needed (above 1kHz). That would still lead to you needing a stereo amp for the LF though.  I am fairly sure that some Lenevo tablets use the 5102 power amp to drive their speakers, so that gives an idea of where they do well.

     

    I am not sure whether you picked up on my observation that both the line out and headphone out are capable of driving 15 ohm loads (though I repeat I would not do it).  So conceptually you could have Left channel feeding two filters (one high pass, one low pass) and these two signals feeding the headphones out.  The Right channel could follow the same logic except it could feed the line out socket.

     

    However I presume you are using speaker out to drive your speaker, which is capable of driving 3 ohm loads. And there you have just two channels ...

     

      There are so rediculously cheap small class d amps out there eg

     

    PAM8403 Ultra Miniature Digital Power Amplifier Board Class D 2channels x 3W 8′′ | eBay

     

    at 0,30 euros.

     

    I would use a couple of those and protect my precious Wolfson!

     

    As to connecting two Wolfsons/Pi together, I wouldnt.  unifying the two I2S clocks represents a huge effort

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • marcelheijkoop
    marcelheijkoop over 8 years ago in reply to psyj

    Thanks John,

     

    Indeed I did not notice enough the line out  AND  headphones out both can carry the same signals with their own individual filters.

    Combined with external amps one could indeed build a setup for bi-amped speakers.

    I definitely want to experiment with that in combination with a multi channel amp I already own, it would just need 4 analogue  inputs to be active to 4 amp outputs.

     

    If combined with speakers out one could do a how-mid-high separation but that is fun in theory only I presume.

     

    On the D-amps indeed they do perform much better than people do credit them for.

    My experiments with the PAM 8403 boards are positive, but I prefer the on-board amp in the cirrus logic audio card.

    I really do recommend you test them once. Depending on the the effectiveness of your speakers it does create enough signal to enjoy your music.

    Combined with the digital silence of the card , it is ideal for a bed side audioset to wake you up in the morning , without the sound of the sea during the night.

     

    In need to do more reading on the amp used in the card....

    Edit :.As the 5102 you mentioned is rated at 2*20 Watt max and should not be fed with less than 8 volts.....

    Edit : confused the wolfson 5102 chip with an other popular chipmakers 5102.

    Edit :  2 watt D-amps according to chip datasheet

     

    Regards Marcel.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • analysis
    analysis over 8 years ago in reply to psyj

    Hi John 

    I hope that this finds you well!! I see the revised PCB could you send me the file for PCB fab  requirements like dimension length X Width (mm), Layers, thickness,

    you have any picture to take a look the PCB assembly

     

    Thanks in advance  

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • psyj
    psyj over 8 years ago in reply to analysis

    Hi,

     

    Here is the KiCAD file that I used.  You may want to add to it,  feel free!  And if you are going to get some made with gold plated pads for the pogo connector, please let me know  ..... I would like to buy a couple if possible

     

    Regards

     

    John

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • psyj
    psyj over 8 years ago in reply to analysis

    Hi,

     

    Here is the KiCAD file that I used.  You may want to add to it,  feel free!  And if you are going to get some made with gold plated pads for the pogo connector, please let me know  ..... I would like to buy a couple if possible

     

    Regards

     

    John

     

    Postscript:-  I cannot post the file directly, forum rules.  If you pass a private message with an email address, I will send it straight to you

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • analysis
    analysis over 8 years ago in reply to psyj

    Hi John   I can't  send you a  private message ...we must be  connected first 

     

    Best Regards 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • analysis
    analysis over 8 years ago in reply to psyj

    John , follow also me 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • analysis
    analysis over 8 years ago in reply to psyj

    John , follow also me 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • psyj
    psyj over 8 years ago in reply to analysis

    Hello Athanasios (and others)

     

    Producing printed circuit boards is certainly possible (and I have spoken to the fabricators), but I will need to add to the design I published some time ago.  I am putting this message out to the community in order to see what I should add to the design.  Hias has already suggested that the board should be larger so that it can support the wolfson.  But are there other useful things I should try and incorporate? I guarantee nothing, but suggestions are welcome!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • analysis
    analysis over 8 years ago in reply to psyj

    Hi John

    At first, I would like to thank you for your help

    Your prototype board meets Hias, hardware modifications, I have tested it also and works perfectly. 

    So why not to move forward with some printed circuit boards for test

    Remain the problem with the CAD layout to generate the Gerber

     

    All the best

     

     

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • spambake
    spambake over 8 years ago in reply to psyj

    Some basic things to add to the pcb would be a .1" pin header with any available GPIO pins (not being used by the Wolfson card), the I2C bus, and the UART.  Also a parallel row of ground pins and several 3.3V  and 5V pins.

     

    I use something like added onto the Cirrus card for indicator LEDs, a temperature sensor, a shutdown button,  RTC via I2C and GPS via UART.  A low noise LDO to convert the 5V to a clean 3.3V (or whatever voltage) for a preamp or something might come in handy for some uses.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • psyj
    psyj over 8 years ago in reply to spambake

    Hi Spambake,

     

    Very reasonable suggestions, many thanks.  The biggest problem with a 0.1 header would be that the board will need to be larger than the wolfson (which sits above it) in order to give access to the pins.  This would mean that the overall "footprint" will be greater than the raspberry beneath ..... not a problem in some instances. But when space is limited?  What do you (and others) think?

     

    The obvious thing to do would be to reproduce almost all of the 40 way header (including the gpio used by the wolfson) outwards  (giving access, eg, to I2C...... leaving the covered space of the PCB (beneath the Wolfson) unused.  A low noise LDO? maybe?  But in my limited experience getting a really low noise power supply it would be best to source from other than the raspberry.

     

    I had thought of an uncommited array of 0.1" pitch holes for prototyping,  but that rather shows my age!  Or some useful I2C device  .... but what?

     

     

    Athanasios

     

    How do you feel about adding a 40 way header to allow other connections? (Sadly that would not allow  stacking of further cards).  I am in two minds about whether to complicate the design (with extra risk),  but when the boards cost around 12 euros each (in small quantities) , plus VAT and delivery, it seems a shame to waste the board space?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • analysis
    analysis over 8 years ago in reply to psyj

    Hi John

    Sorry for the late response  I was busy lately with the case  

    with 40-way header and board, we have to make the case longer  .. I'm ok, let's make this project happen

     

    Sincerely 

     

     

    .image

     

     

     

    imageimage

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • psyj
    psyj over 8 years ago in reply to analysis

    Nice case design  .... how will you fabricate? 3 d printer?

     

    Have started work on a proper pcb design.  Trouble is my Kicad skills are limited.  Anybody more gifted out there ?? Please!.  There seems no point in making the daughter board anything other than a Pi hat shape, that way it gets support from the pi itself.  Two problems

     

    1) The wolfson card will overhang one side of the hat card.  The pink /green jack sockets will overhang the edge of both the hat and the pi by (probably) 5.08mm. Nothing I can do to avoid that because the 40 pin headers have to be offset from one another.

     

    2) That will impact your case design I guess.

     

    At the moment, I am thinking of putting an eeprom on the board (which if memory serves me well is on the cirrus version of this audio card).  And some i2c / power holes for flying leads.

     

    I would suggest that the board, whilst having the overall shape of a hat, does not have the slot for the camera flex, and that display flex cutout is left to the end user to cut out, otherwise production costs will rise.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • analysis
    analysis over 8 years ago in reply to psyj

    Hi John 

     

    CNC router  : )   Thanks for all your hard work it is much appreciated

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • psyj
    psyj over 8 years ago in reply to analysis

    Hi Athanasios (and others)

     

    Had some family problems here, so apologies for the delay.  The design is finally moving ahead ..... here is the alpha artwork (eg I have still to wire in the eeprom and change some pads around)  ... It gives some idea of what board space is still open

     

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • analysis
    analysis over 8 years ago in reply to psyj

    Hi John

     

    I hope that everything is well now, with you and yours 

    Well done for the Great work!

    Will be in touch 

     

    My best

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • psyj
    psyj over 8 years ago in reply to psyj

    Here is version 2 of the PCB  .... anybody see anything wrong?

     

    image

     

    The wolfson card overhangs this lower edge by 0.45 inches, this is the edge with the jack sockets.  The left hand edge of the wolfson (with the spidfs) sits directly over the left hand edge indent shown above, so the two cards are, in general, offset in this sense too. It would be nicer if the left and right edges aligned between hat card and wolfson card, but that is not possible since it would involve offsetting the 26 way connector and there is not enough space to route the tracks

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