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 Driver fixes and updates to kernel 3.18.16 and 4.0.5
  • 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 180 replies
  • Subscribers 720 subscribers
  • Views 29214 views
  • Users 0 members are here
  • raspberry_pi
  • raspeberry_pi_accessories
Related

Driver fixes and updates to kernel 3.18.16 and 4.0.5

hiassoft
hiassoft over 11 years ago

Edit: Current kernel versions and install/config instructions are also available from my webpage http://www.horus.com/~hias/cirrus-driver.html

 

During the last few weeks I fixed various issues in the Wolfson/Cirrus driver and rebased it so it works with the current RPi kernel versions (3.18.16 and 4.0.5).

 

You can download the patches from my GitHub repository. The 3.18 kernel with Cirrus drivers is in the cirrus-3.18.y branch, the 4.0 kernel with Cirrus drivers is in the cirrus-4.0.y branch. I'll rebase and update these branches from time to time so that the Cirrus driver and my changes will stay on top of the commit list.

 

If you just want to have an updated 3.18.16 kernel you can download precompiled binaries from here. Just unpack the tarball in the root directory. Before you do that it might be a good idea to update the firmware files (bootcode.bin, start*.elf and fixup*.dat in the boot directory) to the latest version.

 

Here's a list of my changes:

- Added the FLL1 setup back so that switching between 44.1kHz and 48kHz (and other sample rates) works fine.

- Don't register Arizona IRQ if it's set to 0. The Cirrus driver uses polling here and if we register an interrupt handler for irq 0 we get lots of "spurious interrupt" messages spamming dmesg in kernel 3.19 and newer. IRQ 0 is wrong anyway.

- Include DCVDD patches from the Cirrus linux-drivers repository. These patches make sure the WM8804 chip is initialized properly. Without this patch I sometimes had SPDIF audio out only on the right channel.

- Disable spidev0 in Cirrus device tree overlay. That's mainly a safety precaution so that userspace programs trying to access spi0.0 won't interfere with the WM8804 reset line. I'm not 100% sure this is needed at all, so maybe I'll remove it some time later.

 

And some important notes:

I haven't included the mmap patch, this is already supported in the upstream kernels but currently disabled by default. To enable mmap support add the following line to config.txt:

dtoverlay=i2s-mmap

 

If you compile the kernel on your own please note that the devicetree overlays have now been moved to arch/arm/boot/dts/overlays.

 

Kernel 4.0 now uses spi_bcm2835 by default (the older spi_bcm2708 module is available via a devicetree overlay) so you have to extend your /etc/modprobe.d conf file and add a pre-depend for spi_bcm2835 as well. It's safe to have both the old and the new module in here, so just use this configuration:

softdep arizona-spi pre: arizona-ldo1
softdep spi-bcm2708 pre: fixed
softdep spi-bcm2835 pre: fixed

 

so long,

 

Hias

  • Sign in to reply
  • Cancel
  • e14 Contributor
    e14 Contributor over 10 years ago

    So I have an rpi 3 and I have raspbian jessie running successfully.  I am extremely new to programming and especially new to linux.  I don't understand the steps or the jargon.  If it's possible I'd greatly appreciate some more specific and step by step instructions to follow. 

     

    I went to Hiasoft's site and clicked on the blue highlighted precompiled kernel link labeled cirrus-linux-4.4.14.tgz and then my rpi 3 began to download the file.  When it was finished downloading, it automatically opened the Xarchiver program and showed files labeled "lib" and "boot".  I have NO IDEA where to go from there. 

     

    I need cirrus audio card to receive a couple audio inputs and sent them to alsa to mix,level, and preamp the audio, then send out via a single output to an amplifier. 

     

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • ray1112
    ray1112 over 10 years ago in reply to hiassoft

    Thank you Hias for you help.

    I can try Volumio, it's working.

    FYI: I also can try RuneAudio by using ARCH linux kernel based on you patches:

    ArchLinux ARM kernel packages with driver for Cirrus Logic/Wolfson Audio Card

    Raspberry Pi2/3 with Cirrus Logic Audio Card : Raspberry Pi • RuneAudio Forum

    Vladimir

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 10 years ago

    Hi Matthias!

     

    I am just a Linux tinkerer and know only enough to be dangerous. I have a live nature audio streaming website that I have been using Raspi B+ with Darkice for streaming. I wanted to upgrade to Pi 3 with Cirrus Logic audio running Darkice. I have tried numerous times to upgrade the Raspi B+ image to Pi 3 with the Cirrus logic card support and have the same result. Once I reach the point of having my Darkice image upgrade to Pi 3 I check aplay -l I get the message that the Raspi internal audio adapter is there. After I include your recommended updates of installing the 4.4.14 pre-compile kernel, make the additions to /boot/config.txt, generate the /etc/modprobe.d/cirrus.conf file with the required content, then reboot, I running the aplay -l command. A message is displayed that I have no audio adapters available.

     

    I have added dtdebug=1 to the /boot/config.txt, rebooted the system then tried to use the paste command as you describe in your instructions to collect the information needed for debug. After reading through many of the postings on thread, I saw where you talked about the paste command providing a url that would referenced the location of the data I have collected. When I used the paste command, it acts like a cat command and displays results on the terminal that I am entering the command into. I can't figure out where that url is located. I did copy the output displayed in the terminal and have it available in a file that's about 80KB in size.

     

    I believe that you would take one look at this information and see what I am doing wrong. I know that what I am trying to do is possible because I read where other people before have made the Raspi 3, Cirrus Logic, Darkice combination work.

     

    Could you suggest some way that I could get this file with the results of the paste command to you? Once I figure out how the get this combination of hardware/software to work, I would like to make the image available to future Linux novices that would like to have it. I know Grant from Soundtent has expressed interest in a copy of the image.

     

    Additionally, once I get past the issue with the audio adapter being operational, I will have a question about; Note: You have to start the appropriate scripts before you can use the card. For example:. Can I just put the play command, ./Playback_to_Lineout.sh -q, in rc.local so the Cirrus audio card will be ready to stream once the Raspi has completed the boot process?

     

    Thanks for both making the functioning combination of Pi 3 and the Sirrus Logic audio card doable and for all the time you put into helping novice Linux users, like myself, make this stuff work! Sorry about all these words just to ask two questions.

     

    BTW - If you are curious about the website: livenaturesongs,com.

     

    Sincerely,

     

    Joel Goodwin

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

    Hi Matthias,

     

    Firstly, many thanks for your excellent work.  I have been using your set-up for some time now without any issues at all.  However, I'm trying to get the Cirrus Card working with my Pi3 together with a Waveshare 5 inch HDMI USB touchscreen.

     

    Waveshare  http://www.waveshare.com/wiki/5inch_HDMI_LCD_(B) provides an image for the Pi3, which works fine, using Raspbian 4.4.13 (Linux raspberrypi 4.4.13-v7+ #4 SMP Mon Jun 20 13:20:54 UTC 2016 armv7l GNU/Linux). 

     

    With this image, the touch function of the screen works OK with the Pi3.  If I then use one of your pre-compiled Cirrus kernels (e.g. 4.4.14), the sound card works OK, but the touch function of the screen no longer works, presumably because the kernel for the touch screen has been over-written by the Cirrus pre-compiled kernel.

     

    I would be really grateful if you (or someone) could provide some guidance on how I can get the Waveshare screen to work alongside my Cirrus audio card, using the Pi3 Waveshare image as a starting point.

     

    Many thanks in advance.

     

    Hystrix

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 10 years ago

    Hi,

     

    many thanks for your great work! I use this kernel daily on my Arch Linux RPi connected to my Hifi amp.

     

    Unfortunately, there is a problem starting with the current version of systemd 231 and the Cirrus kernel binary, background info:

     

    https://github.com/systemd/systemd/issues/3882

     

    Could you enable SECCOMP support in your kernel binaries? Version 231 of systemd doesn't work with kernels that have SECCOMP disabled, leaving you basically with an unusable system.

     

    I was able to get my system working again by downgrading systemd.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 10 years ago in reply to e14 Contributor

    If you are using Arch Linux please try kernel packages from headless.audio.

    I'm using these kernels with latest systemd without any problems.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • gerbrand
    gerbrand over 10 years ago

    When an update on a system with working audio card has been done (bootloader or rpi-update) involving the kernel, will it be enough to download and extract the tar to get a working audio card again?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • gare-bear
    gare-bear over 9 years ago in reply to hiassoft

    Is one to assume that if the steps in post 137 work then the card is working?

    Re: Driver fixes and updates to kernel 3.18.16 and 4.0.5

     

    While it may sound like a stupid question, I was under the impression my card was not working because the usecase-scripts were not outputting audio? Am I wrong to assume these files should output sound?

     

    I want to thank everyone in this discussion for their contributions especially Hias. Saved me lots of time and headache (although I do think what it took for us to get to a working card on Pi3 is pretty ridiculous). On a side note, does anyone a good API/Library I could use to send audio out through the Cirrus? What i'd like to do is setup the RPi 3 as an A2DP server using Bluetooth, connect another device and send the audio out through the Cirrus.

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

    Hi hiassoft

     

    I tried this (July 18, 2016) post along with your site instructions RPi Linux driver for Wolfson / Cirrus Logic Audio Card

    Unfortunately failed, tried it a couple times to be sure I didn't miss anything.

     

    Using pi B+ , cirrus logic board , latest volumio 2.031

     

    I've tried multiple guides and images. The errors:

    mounting devices failing:

    /dev/loop0

    mounting overlay on /mnt/ext/union failed no such device

    mounting /mnt/static on /mnt/ext/union/static failed invalid argument

    ...

    finish initramfs, continue booting volumio

    switch_root: error moving root: invalid argument

     

    then kernel panic - not syncing: attempted to kill init!

    then gives stack info

    entering kdb dur to keyboard entry

    kdb>

     

    I'm lost here, I'm totally new to pi

    anyone help? thanks

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

    Just tested current volumio (2.041) with the steps outlined in my post and it worked fine. Triple-check that you didn't miss anything.

     

    so long,

     

    Hias

    • 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