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 29087 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
  • hiassoft
    hiassoft over 10 years ago in reply to e14 Contributor

    李 逍遥 schrieb:

     

    It alwanys prompt  Failed to register card: -517,but the wolfson audio card did work.why there are so many error prompt?

    -517 is -EPROBE_DEFER, that is the kernel deferred probing mechanism. It's not an actual error, just means some of the other components weren't available (in your case the bcm2708 I2S driver and the wm5102 driver) and that the kernel should retry later.

     

    Long story short: just ignore these messages if you finally get the "mapping ok" message.

     

    so long,

     

    Hias

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

    I've got a brand new rpi2 and Cirrus card that won't work with these instructions for some reason. Here's what i've done and corresponding dmesg output.

     

    -Fresh install of raspbian image "2015-11-21-raspbian-jessie-lite.zip"

    -Compiled 4.1.16 kernel from https://github.com/HiassofT/rpi-linux/tree/cirrus-4.1.y following instructions here https://www.raspberrypi.org/documentation/linux/kernel/building.md

    -Updated /boot/config.txt

    dtoverlay=rpi-cirrus-wm5102

    dtoverlay=i2s-mmap

     

    -Created /etc/modprobe.d/cirrus.conf:

    softdep arizona-spi pre: arizona-ldo1

    softdep spi-bcm2708 pre: fixed

    softdep spi-bcm2835 pre: fixed

    softdep snd-soc-wm8804-i2c pre: snd-soc-rpi-wsp-preinit

    softdep snd-soc-rpi-wsp pre: snd-soc-wm8804-i2c

     

    aplay -l

    aplay: device_list:268: no soundcards found...

     

    part of dmesg output

    [    6.231122] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered

    [    6.231139] snd-rpi-wsp sound: Failed to register card: -517

    [    6.276454] arizona spi0.1: WM5102 revision C

    [    6.284103] Adding alias for supply MICVDD,(null) -> MICVDD,spi0.1

    [    6.285701] Adding alias for supply MICVDD,(null) -> MICVDD,spi0.1

    [    6.285727] Adding alias for supply DBVDD2,(null) -> DBVDD2,spi0.1

    [    6.285737] Adding alias for supply DBVDD3,(null) -> DBVDD3,spi0.1

    [    6.285746] Adding alias for supply CPVDD,(null) -> CPVDD,spi0.1

    [    6.285756] Adding alias for supply SPKVDDL,(null) -> SPKVDDL,spi0.1

    [    6.285765] Adding alias for supply SPKVDDR,(null) -> SPKVDDR,spi0.1

    [    6.286457] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered

    [    6.286477] snd-rpi-wsp sound: Failed to register card: -517

    [    6.295818] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered

    [    6.295854] snd-rpi-wsp sound: Failed to register card: -517

    [    6.306516] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered

    [    6.306545] snd-rpi-wsp sound: Failed to register card: -517

    [    6.375541] MICVDD: supplied by DC_1V8

    [    6.722151] snd-rpi-wsp sound: wm5102-aif1 <-> 3f203000.i2s mapping ok

     

    Ideas?

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

    https://github.com/HiassofT/rpi-linux/tree/cirrus-4.1.16

    Not the y version should be used.

    Clem

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

    Fixed it. I did not have permission so the card would only appear if I ran "sudo aplay -l". The command to run is below.

     

    sudo gpasswd -a "replace_with_username" audio

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

    Eric Thornton schrieb:

     

    -Created /etc/modprobe.d/cirrus.conf:

    softdep arizona-spi pre: arizona-ldo1

    softdep spi-bcm2708 pre: fixed

    softdep spi-bcm2835 pre: fixed

    softdep snd-soc-wm8804-i2c pre: snd-soc-rpi-wsp-preinit

    softdep snd-soc-rpi-wsp pre: snd-soc-wm8804-i2c

    FYI: you can remove the last 2 softdep lines, they are no longer needed with the 4.1.16 kernel.

     

    so long,

     

    Hias

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

    I just uploaded a new kernel, based on 4.1.18:

    http://www.horus.com/~hias/tmp/cirrus/cirrus-linux-4.1.18.tgz

     

    No changes in the audio driver, but some USB and MMC fixes in the RPi tree.

     

    so long,

     

    Hias

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 10 years ago in reply to hiassoft

    Hias,

     

    the version 4.1.18 contains the comment:

    cirrus: silence probe deferral messages from register card

    The reason for the probe deferral (eg DAI not registered) is already

    logged, so there's no need for further dmesg spam

    So indeed the message

    snd-rpi-wsp sound: Failed to register card: -517

    has gone.

     

    But still there is the dmesg spam like

     

    [5.245000] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered
    [5.249957] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered
    [5.361766] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered
    [5.372619] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered
    [5.513485] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered
    [5.582022] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered
    [5.609680] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered
    [5.610961] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered
    [6.069378] snd-rpi-wsp sound: wm5102-aif1 <-> 3f203000.i2s mapping ok

     

    So it may make sense to also remove it.

     

    Uli

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

    Hi Uli!

     

    But still there is the dmesg spam like

     

    [5.245000] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered

    These messages are coming from the ASoC layer and I didn't want to touch these. I only silenced the messages from the Cirrus driver because they are somewhat redundant (ASoC already logged which device was missing) and they seemed to scare users - I received a lot of questions what this error -517 was.

     

    There have been several discussions on the kernel mailing lists how to deal with the probe deferral messages. Ideally you'd just get a single error message with all the details when the deferred probing mechanism finally failed. But this is rather tricky to do and so far there's no real solution to that yet. Obviously we can't silence all deferred probing messages, otherwise there'd be no easy way to find out what exactly went wrong in case of a real error.

     

    Until there's some accepted solution in upstream we just have to live with these (few) repeated log messages.

     

    so long,

     

    Hias

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

    I've uploaded a new kernel build, based upon 4.1.19:

    http://www.horus.com/~hias/tmp/cirrus/cirrus-linux-4.1.19.tgz

     

    I finally found out what was causing the issues on the new RPi3 (other soundcards where effected as well), this kernel build contains all the needed patches. Note: be sure you have a very recent Raspbian installation or update the GPU firmware if you are using a RPi3.

     

    Other changes in this build:

    • Add missing .owner field in snd_soc_card
      This prevents module unloading while the card is in use (which leads to a kernel crash) and makes ALSA slot ordering working.
    • Silence probe deferral messages from register card

     

    I've updated the docs on my webpage and added instructions how to use the slot ordering and how to disable the RPi on-board audio device

    http://www.horus.com/~hias/cirrus-driver.html

     

    so long,

     

    Hias

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 10 years ago in reply to hiassoft

    Hi,

     

    Today I acquired a Cirrus Audio Card and tested it with the kernel build 4.1.19. Everything works great until I load the experimental OpenGL support by adding dtoverlay=vc4-kms-v3d to /boot/config.txt -- The Cirrus card is nowhere to be found.

     

    Combing through dmesg I found this:

    bcm2708-i2s 3f203000.i2s: can't request region for resource [mem 0x3f101098-0x3f10109f]

    bcm2708-i2s: probe of 3f203000.i2s failed with error -16

     

    vc4-kms-v3d-overlay.dts doesn't seem to mention anything about using i2s so I'm stumped on what's the issue.

     

    Any hope or hints for further debugging?

    • 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