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
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 763 subscribers
  • Views 49483 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
  • mskyaxl
    mskyaxl over 9 years ago in reply to hiassoft

    Thanks, its working fine but what I find really annoying is that I cannot use apt-get to install packages.

     

    Happy new year!

     

    Alex

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • phxang
    phxang over 9 years ago

    Thank you Hias for detailed instructions. I did all exactly and sound appeared.

    But I have problem. Sound goes only from single source.

    Raspberry Pi 3, Raspbian Jessie, compiled 4.9.0 kernel without any config changes.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • phxang
    phxang over 9 years ago in reply to phxang

    PulseAudio helped me to solve some problems. But I still can't listen from mpd and other applications together. I think something in mpd config, but I can't discover it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • phxang
    phxang over 9 years ago in reply to phxang

    All fine! PulseAudio | Music Player Daemon Community Wiki | Fandom powered by Wikia

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • phxang
    phxang over 9 years ago

    Can I boost DMIC sensitivity?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • hiassoft
    hiassoft over 9 years ago in reply to phxang

    Hi Andrey!

    Can I boost DMIC sensitivity?

    Yes. You can change "IN2L Digital Volume" and "IN2R Digital Volume". By default these are set to 116 which is -6dB. Setting these to 128 would be 0dB (each step is 0.5dB). You can also set them to more than 128 - just try different values and see what works best.

     

    BTW: The purpose of the "usecase" mixer scripts is to give you a quick start, usually you'll have to tweak the settings (boost/attenuate signals, add/remove filters, use different routing etc). Remembering which input/output corresponds to which mixer can be hard, therefore I created a bunch of helper functions and definitions in rpi-cirrus-functions.sh to simplify that. Feel free to change that to your needs, modify it or use it in your own scripts.

     

    For example, the "Record_from_DMIC.sh" script calls the "record_from_dmic" function in rpi-cirrus-functions.sh. It looks like that:

    # args: [ VOLUME [ DIGITAL_VOLUME ] ]
    record_from_dmic() {
            reset_dmic_in
            reset_filter
            reset_rpi_in
    
            # default input gain 0dB and digital gain -6dB
            setup_dmic_in "${1:-0}" "${2:-116}"
    
            # route input through high pass filter to remove DC
            setup_high_pass_filter $dmic_in_signals
            set_mixer $rpi_in_signals $filter_signals
    }

     

    You can pass 2 additional arguments to that function, volume (which should be 0 when using DMIC) and the digital volume (eg 128). If these are not set, the default values 0 and 116 will be used when calling setup_dmic_in.

     

    If you want you can also remove the high-pass filter, drop the "set_high_pass_filter" line and change the set_mixer call below to "set_mixer $rpi_in_signals $dmic_in_signals" - then DMIC won't be routed through the high-pass filter but sent directly to the RPi audio input.

     

    If you want to mix multiple (analog) inputs into your output signal have a look at what "Cirrus_listen.sh" does, eg in the case of listening to DMIC on line-out:

     

    First it configures the DMIC input, like the record function:

    setup_dmic_in 0 116

    Then it sets the lineout volume to the default (128 means 0dB)

    mixer "${line_out} Digital Volume" 128

    and routes the input signal (in this case "$dmic_in_signals) to the specified input of the line-out mixer (default is 2):

    set_mixer $line_out_signals $dmic_in_signals 32 2

     

    Each mixer block inside the WM5102 has 4 inputs, the "Playback" scripts/functions use the first one, the listen scripts by default the second one, so if you like you can add 2 more signals (eg line-in and headset-in) to the remaining 2 mixer inputs.

     

    The "32" in the set_mixer call specifies the volume of the input. 32 is 0dB. Change it to your needs, for example to boost dmic-in or attenuate line-in.

     

    so long,

     

    Hias

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • kevin1313
    kevin1313 over 9 years ago in reply to hiassoft

    Has anyone reported issues with wifi connectivity/throughput with the 4.9.0 kernel? I am losing wifi ability to get to internet, remote into the RPi2 from a laptop, and lose streaming from minidlna server about every 5-30 minutes. It doesn't actually disconnect me from the router but it doesn't seem to let me access anything until I disconnect wifi and re-connect.

     

    I am running a Rasp Pi2 with the latest Jessie installed. I updated to Jessie before trying to compile the 4.9.0 kernel. The kernel update worked as the audio card was working, but shortly afterward I noticed the loss of wifi. I have read on internet about wifi connectivity issues with RPi and Jessie but with 12 hours to days between losing wifi. I am not getting that long of a span.

     

    I am still fairly new to the Rasp Pi/Linux. So this is most likely something I have messed up, but I was curious if anyone else had seen an issue with wifi?

     

    But after trying to isolate which software may be causing the issue by removing them, I finally went back to an image I had just before updating to 4.9.0 kernel. Wifi does not seem to be acting up.

     

    Thanks,

    Kevin

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • hiassoft
    hiassoft over 9 years ago in reply to kevin1313

    Hi Kevin!

     

    I can't comment on the WIFI issues, I'm only using wired network with the RPi 3 here.

     

    But if you are having problems with kernel 4.9 it would be best to switch to the official RPi firmware (just to be sure), test with that and then report issues/regressions in the RPi kernel 4.9 thread https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=167934 - if there's some regression it'll hopefully be fixed soon and then I can pick up the fix in my Cirrus builds.

     

    If the issues are only present in my builds but not in the official RPi kernel please post about it here.

     

    To switch from the Cirrus kernel to the official one run the following 2 commands (the first one forces rpi-update to "forget" about the currently installed kernel, overwriting the kernel with the Cirrus build doesn't play nice with rpi-update and it may think the latest version is already installed - if /boot/.firmware_revision is removed it'll start from scratch and get the latest official revision)

    sudo rm /boot/.firmware_revision
    sudo BRANCH=next rpi-update

     

    Once you are finished with testing you can just reinstall the Cirrus kernel (re-run the sudo tar zxf ... command).

     

    so long,

     

    Hias

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • kevin1313
    kevin1313 over 9 years ago in reply to hiassoft

    So use the pre-compiled kernels? I have been compiling them but that takes a little over 3 hours.

     

    That was a quick response! Thanks.

     

    I will let you know how things go.

     

    Kevin

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • kevin1313
    kevin1313 over 9 years ago in reply to kevin1313

    Well when I went back to the official kernel, the wifi issue went away as far as I can tell but of course the audio card no longer works either. It will be hard for me to explain the issues I see when using the new 4.9 kernel. I used iperf to try to get a measurement for wifi speed. But it didn't seem to change. The speed test was showing the speed to stay about the same even when it was bogging down on my screen when remote accessing the RPi2 with RealVNC. My best test is watching a movie using minidlna on RPi2 to play to Roku stick's media player. Sometimes the movie will start playing normally but then the media server loses connection after 10 minutes or so. The time it lasts varies from just a few minutes to half hour or so. Most recently the server isn't disconnecting but the movie has to buffer(which it normally never did) every couple of minutes which leads me to believe the transfer rate over wifi is low, but the iperf test seemed to show that it was still about the same(800MBs/sec, I think).

     

    Would you recommend using one of the previous versions of your kernel? Do you think that would possibly get me a more stable wifi connection?

     

    Thanks,

    Kevin

    • 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.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube