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 29150 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

    Hi Rob!

    [    5.322951] spi0.1 supply DCVDD not found, using dummy regulator

    [    5.365942] arizona spi0.1: Unknown device ID: 0

    That's the culprit, you seem to be missing the softdeps. arizona-ldo1 needs to be loaded before arizona-spi, otherwise the chip won't be powered up correctly. Disabling regulator support in the kernel will have the same effect BTW.

     

    If everything's setup correctly it should look like this (note the "LDO1" and various "supply" messages and that the arizona driver found a WM5102):

     

    [4.228265] wm8804 1-003b: revision E
    [4.228602] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered
    [4.241035] LDO1: supplied by DC_1V8
    [4.241090] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered
    [4.294048] arizona spi0.1: WM5102 revision C
    [4.313641] Adding alias for supply MICVDD,(null) -> MICVDD,spi0.1
    [4.314060] Adding alias for supply MICVDD,(null) -> MICVDD,spi0.1
    [4.314072] Adding alias for supply DBVDD2,(null) -> DBVDD2,spi0.1
    [4.314082] Adding alias for supply DBVDD3,(null) -> DBVDD3,spi0.1
    [4.314093] Adding alias for supply CPVDD,(null) -> CPVDD,spi0.1
    [4.314103] Adding alias for supply SPKVDDL,(null) -> SPKVDDL,spi0.1
    [4.314114] Adding alias for supply SPKVDDR,(null) -> SPKVDDR,spi0.1

     

    so long,

     

    Hias

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

    Hi Hias, I finally have it working. On my SD card my boot up files are in a partition but it is not mounted on the rootfs. The config.txt in my parition was being ignored. When created /boot directory on the rootfs partition and copied filesthere and rebooted, it now picks up the config correctly, uses the preinit from the modprobe.d and all works fine.. 

     

    I want to thank you so much for your help as I would have been very lost without it..

     

     

    Best Regards

     

    Rob

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

    Many thanks again to hias.

     

    I have just finished upgrading my Raspberry Pi 3 to Arch Linux kernel 4.4.6 (the precompiled kernel supplied by hias) and I've just today gotten the sound card working.  Had some trouble with i2c which seems to be OK now, though I don't understand why there is no /dev/i2c*.  The problem appears to be that I had not copied the lib and overlay files from the tarball to my installation.  Nevertheless, aplay -l shows the card and mplayer plays music from mp3 files or streamed audio.  I post this here in case others are trying to do the same thing, it does work.

     

    Thank you hias for your dedication and fine work on this.

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

    Hi,

     

    I have question regarding audio routing.

     

    Is there a way to route any inputs i.e. the "line" input directly to the outputs i.e. the "SPDIF" output and have it enabled all of the time regardless of loading any apps?

     

    An example of this would be using an external USB audio interface in "Stand Alone" mode - in which any audio being received by the interface automatically passes through to the outputs.

     

    Thanks.  

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

    Yes, the Cirrus card can for example route LineIn to SPDIF out. Read more about it in this thread:

    http://www.element14.com/community/message/114756/l/re-read-in-from-the-headset-jack-and-read-out-to-the-amplifier#11475…

     

    The "listen scripts" by Ragnar Jensen are what you are looking for, but you'll have to change the "SPDIF out Switch" mixer setting to "SPDIF Out Switch" (note the capital "O" in "Out", the name has changed in recent kernels).

     

    You can find out more about the internal routing of the card in this thread:

    Yes, the Cirrus card can for example route LineIn to SPDIF out. Read more about it in this thread:

    http://www.element14.com/community/message/114756/l/re-read-in-from-the-headset-jack-and-read-out-to-the-amplifier#11475…

     

    The "listen scripts" by Ragnar Jensen are what you are looking for, but you'll have to change the "SPDIF out Switch" mixer setting to "SPDIF Out Switch" (note the capital "O" in "Out", the name has changed in recent kernels).

     

    You can find out more about the internal routing of the card in this thread:

    http://www.element14.com/community/message/114760/l/re-a-lot-of-playback-items#114760

    and in the digital core section of the wm5102 datasheet

    https://www.cirrus.com/en/pubs/proDatasheet/WM5102_v4.2.pdf

     

    so long,

     

    Hias

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

    Amazing!

     

    Thank you so much Hias. Your help is greatly appreciated.

     

    All the Best,

     

    Alex

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

    Dear Hias,

     

    I may have missed something critical in this thread, but my situation is that I am trying to get the cirrus card running on a pi 3.

    I installed a fresh jessie, unpacked the 4.4.6 tar precompiled kernal file in root, downloaded the user scripts, adjusted the config.txt file, created the /etc/modprobe.d/raspi-blacklist.conf file, enabled device tree from the raspi-config.

     

    I still don't see any recognition of the card from the pi, and when I run any of the scripts I get:

     

    amixer: Control hw:sndrpiwsp open error: No such device

     

    Apologies if I missed a fix that was already in the thread. Thanks in advance for any advice!

     

    -Eric

     

    Here is my debug stuff:

    pi@raspberrypi:~ $ vcgencmd version | pastebinit

    http://paste.debian.net/441312/

    pi@raspberrypi:~ $ lsmod | pastebinit

    http://paste.debian.net/441313/

    pi@raspberrypi:~ $ aplay -l | pastebinit

    http://paste.debian.net/441314/

     

     

    pi@raspberrypi:~ $ vcdbg log msg 2>&1 | pastebinit

     

    http://paste.debian.net/441308/

    pi@raspberrypi:~ $ dmesg | pastebinit

    http://paste.debian.net/441309/

    pi@raspberrypi:~ $ /boot/config.txt | pastebinit

    You are trying to send an empty document, exiting.

     

     

    pi@raspberrypi:~ $ paste /boot/config.txt

     

    # For more options and information see

    # http://www.raspberrypi.org/documentation/configuration/config-txt.md

    # Some settings may impact device functionality. See link above for details

    # uncomment if you get no picture on HDMI for a default "safe" mode

    #hdmi_safe=1

    # uncomment this if your display has a black border of unused pixels visible

    # and your display can output without overscan

    #disable_overscan=1

    # uncomment the following to adjust overscan. Use positive numbers if console

    # goes off screen, and negative if there is too much border

    #overscan_left=16

    #overscan_right=16

    #overscan_top=16

    #overscan_bottom=16

    # uncomment to force a console size. By default it will be display's size minus

    # overscan.

    #framebuffer_width=1280

    #framebuffer_height=720

    # uncomment if hdmi display is not detected and composite is being output

    #hdmi_force_hotplug=1

    # uncomment to force a specific HDMI mode (this will force VGA)

    #hdmi_group=1

    #hdmi_mode=1

    # uncomment to force a HDMI mode rather than DVI. This can make audio work in

    # DMT (computer monitor) modes

    #hdmi_drive=2

    # uncomment to increase signal to HDMI, if you have interference, blanking, or

    # no display

    #config_hdmi_boost=4

    # uncomment for composite PAL

    #sdtv_mode=2

    #uncomment to overclock the arm. 700 MHz is the default.

    #arm_freq=800

    # Uncomment some or all of these to enable the optional hardware interfaces

    dtparam=i2c_arm=on

    dtparam=i2s=on

    dtparam=spi=on

    # Uncomment this to enable the lirc-rpi module

    #dtoverlay=lirc-rpi

    # Additional overlays and parameters are documented /boot/overlays/README

    # Enable audio (loads snd_bcm2835)

    dtparam=audio=on

    dtoverlay=rpi-cirrus-wm5102-overlay

    dtoverlay=i2s-mmap

    # Enable devicetree debugging

    dtdebug=1

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

    Hi Eric!

     

    You need to change the dtoverlay line in your config.txt to

    dtoverlay=rpi-cirrus-wm5102

     

    Note the removed "-overlay" at the end.

     

    It'd also be a good idea to update the GPU firmware to the latest version by running

    sudo SKIP_KERNEL=1 rpi-update

     

    Then I think you everything should be fine. Also check out the info in my webpage

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

     

    so long,

     

    Hias

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

    Thanks so much for responding so quickly!

     

    Unfortunately I'm still not getting the card to show up...

     

    Here is my current debug stuff:

     

     

    pi@raspberrypi:~ $ vcgencmd version | pastebinit

     

    http://paste.debian.net/441487/

    pi@raspberrypi:~ $ lsmod | pastebinit

    http://paste.debian.net/441488/

    pi@raspberrypi:~ $ aplay -l | pastebinit

    http://paste.debian.net/441489/

    pi@raspberrypi:~ $ vcdbg log msg 2>&1 | pastebinit

    http://paste.debian.net/441490/

    pi@raspberrypi:~ $ dmesg | pastebinit

    http://paste.debian.net/441491/

    pi@raspberrypi:~ $ paste /boot/config.txt

    # For more options and information see

    # http://www.raspberrypi.org/documentation/configuration/config-txt.md

    # Some settings may impact device functionality. See link above for details

    # uncomment if you get no picture on HDMI for a default "safe" mode

    #hdmi_safe=1

    # uncomment this if your display has a black border of unused pixels visible

    # and your display can output without overscan

    #disable_overscan=1

    # uncomment the following to adjust overscan. Use positive numbers if console

    # goes off screen, and negative if there is too much border

    #overscan_left=16

    #overscan_right=16

    #overscan_top=16

    #overscan_bottom=16

    # uncomment to force a console size. By default it will be display's size minus

    # overscan.

    #framebuffer_width=1280

    #framebuffer_height=720

    # uncomment if hdmi display is not detected and composite is being output

    #hdmi_force_hotplug=1

    # uncomment to force a specific HDMI mode (this will force VGA)

    #hdmi_group=1

    #hdmi_mode=1

    # uncomment to force a HDMI mode rather than DVI. This can make audio work in

    # DMT (computer monitor) modes

    #hdmi_drive=2

    # uncomment to increase signal to HDMI, if you have interference, blanking, or

    # no display

    #config_hdmi_boost=4

    # uncomment for composite PAL

    #sdtv_mode=2

    #uncomment to overclock the arm. 700 MHz is the default.

    #arm_freq=800

    # Uncomment some or all of these to enable the optional hardware interfaces

    dtparam=i2c_arm=on

    dtparam=i2s=on

    dtparam=spi=on

    # Uncomment this to enable the lirc-rpi module

    #dtoverlay=lirc-rpi

    # Additional overlays and parameters are documented /boot/overlays/README

    # Enable audio (loads snd_bcm2835)

    dtparam=audio=on

    dtoverlay=rpi-cirrus-wm5102

    dtoverlay=i2s-mmap

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

    Hi Eric!

     

    According to dmesg you seem still to be using the original 4.1.19 kernel.

     

    Try to extract the 4.4.6 kernel image again by running

    sudo tar zxf cirrus-linux-4.4.6.tgz -C /

    from the directory where you downloaded the precompiled kernel.

     

    Please report back if you get any error messages or warning from running that command. If everything worked fine you should get not output at all on the console, the command should just return to the prompt.

     

    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