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 29102 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 Alex!

    I can see the card show up in "Audio Device Settings" as "snd_rpi_wsp (Alsa mixer) (Default)". But, when I try to choose the card in any audio program such as Sunvox or Jack - i.e. "hw:sndrpiwsp" or (hw:0,0) the card does not work. Instead, for instance, Sunvox will not load and hangs using Alsa and/or Jack gives me error "Could not connect to JACK server as client.

    You probably just forgot to run the "usecase" scripts. I've updated that section on my website, for SPDIF in/out you'll have to do this:

    ./Reset_paths.sh -q
    ./SPDIF_playback.sh -q
    ./SPDIF_record.sh -q

     

    Enabling the other playback paths (lineout, headset) as well won't hurt, the can be active in parallel.

     

    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

    Hi,

     

    Thanks for responding so quickly Hias.

     

    You are correct. I did not install "usecase" scripts.

     

    Everything works now!

     

    Thank you for adding the new instructions on your site. I followed them exactly.

     

    All the best,

     

    Alex

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

    I have been here:

    www.horus.com/~hias/cirrus-driver.html looking at the precompiled kernel and I see that the latest one is 4.1.19 and it says it works for Rpi3 (which I've just received).  I've just received an Rpi3 and have a Cirrus Logic - Element14 audio board on order.  I also have an Rpi2 with the audio board and I believe I got the kernel 4.1.13 from this site (and it works wonderfully well).  Unfortunately, the current Arch Linux supplies kernel 4.1.20.

     

    So my question would be - will there be a downloadable 4.1.20 pre-patched and compiled kernel available?

     

    If not, where can I find step by step instructions on how to patch and compile the kernel myself?

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

    I would at least try the 4.1.19 kernel and test the hardware compatibility on RPi3 first. Later when he has time, there should be a later one. Please be aware he volunteers his time here for helping us. image If you would like to try, have a fast machine and plenty of free space. Download his tar ball with the source you wish(Rasbian Jessie). Follow the Debian wiki guide that is very detail and you will have a newer kernel. BTW I checked and the difference between them is fixes at most.

    Clem

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

    So my question would be - will there be a downloadable 4.1.20 pre-patched and compiled kernel available?

     

    If not, where can I find step by step instructions on how to patch and compile the kernel myself?

    There aren't any really important changes to 4.1.20 (compared to 4.1.19) and the RPi foundation will switch to 4.4 soon. So I'll skip 4.1.20, also I don't have much time ATM, this weekend I'm at the Easterhegg image

     

    You can either use the 4.1.19 kernel or clone my 4.1 github tree (it's already up at 4.1.20 plus patches until yesterday) and compile it yourself - just like the standard RPi kerrnel. make bcm2709_defconfig enables all options needed for the Cirrus card.

     

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

     

    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

    Ah yes, I downloaded the sources for 4.1.19 and I have finished the compile which looks good.  An experienced Linux friend explained that It would likely work to put the 4.1.19 kernel in a 4.1.20 installation.  The board should be delivered today, so I will be able to test it sometime later and I'll post here about my results.

     

    Thank you for this effort and hard work, very grateful.

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

    Raspberry Pi 3 testing 4.1.19 kernel build

     

    I followed instructions at these sites:

    github.com/RoEdAl/linux-raspberrypi-wsp

    headless.audio/#raspberry-pi-2-model-b.

     

    From that, I downloaded sources for kernel 4.1.19 for Arch Linux.  I had initially installed Arch Linux with 4.1.20 kernel.  I then executed the pacman command and the compile took place without error (checked the log files for the word 'error').  I did the other modifications as well.  The system boots and doesn't appear to have any problems.

     

    When I execute aplay -l, I get:

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

     

    Note that I blacklisted the Raspberry Pi 3 default on-board audio.  Before I did that, aplay -l would list only the on-board hardware.

     

    uname -a gives:

    Linux pi3 4.1.19-4-WSP #1 SMP Sat Mar 26 00:21:28 PDT 2016 armv7l GNU/Linux

     

    Both of the audio card LEDs (red and green) remain on.  I see no mention of wsp or cirrus in dmesg output using grep -i

     

    I have an Rpi2 with the same audio card which works, so tomorrow I'll put the new audio card on the Rpi2 and see if it works.

     

    /etc/modprobe.d/cirrus.conf

    softdep arizona-spi pre: arizona-ldo1

    softdep spi-bcm2708 pre: fixed

    softdep spi-bcm2835 pre: fixed

    blacklist snd_bcm2835

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

    Dmesg showed nothing like loading driver for cirrus card? Curiously that means hardware not responding to a probe during startup. I think i2cdetect should be run to see the card respond.

    Clem

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

    Both of the audio card LEDs (red and green) remain on.  I see no mention of wsp or cirrus in dmesg output using grep -i

    add dtdebug=1 to config.txt and then run sudo vcdbg log msg 2>&1 | less to check if the rpi-cirrus-wm5102 overlay was loaded correctly.

     

    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

    Ok, I feel pretty lame...  IT WORKS WONDERFULLY WELL!!!

     

    Somewhere along the line, /boot/config.txt was overwritten and had default settings which had i2c turned OFF.  I found this by running i2cdetect.  Once I corrected the settings in /boot/config.txt, it worked and I was able to use mplayer to play an MP3 file.

     

    So - my results - 4.1.19 works on Rpi3 running Arch Linux.

     

    THANK YOU SO MUCH FOR YOUR GENEROUS WORK ON THIS ! !

    • Cancel
    • Vote Up +1 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