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
  • 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 689 subscribers
  • Views 23082 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 10 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
Parents
  • Former Member
    Former Member over 9 years ago

    I found this topic through Matthias his driver page at RPi Linux driver for Wolfson / Cirrus Logic Audio Card and I have successfully used the precompiled kernels before. I really appreciate the work as it would otherwise not be possible to use my DAC anymore image

     

    But today I installed Volumio 2 music player version RC2 (https://github.com/volumio/Volumio2 ) which runs fine. But I also want my Wolfson DAC to work with it... After following the steps on RPi Linux driver for Wolfson / Cirrus Logic Audio Card I am unable to properly boot my Pi. I am not sure what is wrong but I can't  SSH into it...

     

    So I did another clean installation of Volumio 2 to check the kernel being used after reading Volumio upgraded to a newer kernel.

    Running `volumio@volumio:~$ uname -r` results in `4.4.9-v7+`

     

    Could my booting issues be the result of this newer kernel?

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

    But today I installed Volumio 2 music player version RC2 (https://github.com/volumio/Volumio2 ) which runs fine. But I also want my Wolfson DAC to work with it... After following the steps on RPi Linux driver for Wolfson / Cirrus Logic Audio Card I am unable to properly boot my Pi. I am not sure what is wrong but I can't SSH into it...

     

    So I did another clean installation of Volumio 2 to check the kernel being used after reading Volumio upgraded to a newer kernel.

    Running `volumio@volumio:~$ uname -r` results in `4.4.9-v7+`

     

    Could my booting issues be the result of this newer kernel?

    I'm not really familiar with Volumio / Volumio 2 (never used it myself) and also don't remember any significant changes in the kernel between 4.4.6 and 4.4.9 that would cause problems on downgrade - so it's quite puzzling to me as well.

     

    Could you post the output of "uname -a" on Volumio? It would be interesting to know if they use a Raspbian kernel or a modified one.

     

    After that: could you check if the new precompiled 4.4.14 kernel  works?

     

    so long,

     

    Hias

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

    Thanks for the quick reply!

     

    Running "uname -a" results in the following ouput:

    Linux volumio 4.4.9-v7+ #884 SMP Fri May 6 17:28:59 BST 2016 armv7l GNU/Linux

     

    Tonight I will have time to check if the 4.4.14 version works.

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

    Matthias Reichl wrote:

    After that: could you check if the new precompiled 4.4.14 kernel works?

    I just tried the 4.4.14 version and unfortunately the result is the same as before.

         ssh volumio@192.168.178.47

         ssh: connect to host 192.168.178.47 port 22: Host is down

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • clem57
    clem57 over 9 years ago in reply to Former Member

    Does this work?

    ping 192.168.178.47

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 9 years ago in reply to clem57

    No response...

         Request timeout for icmp_seq 4

         ping: sendto: Host is down

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • clem57
    clem57 over 9 years ago in reply to Former Member

    Could this be the wrong ip? How did you determine what ip to use? Otherwise the image is not using dynamic ip...

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • clem57
    clem57 over 9 years ago in reply to Former Member

    Could this be the wrong ip? How did you determine what ip to use? Otherwise the image is not using dynamic ip...

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • Former Member
    Former Member over 9 years ago in reply to clem57

    The RPi is connected to my router with a cable. The routers webinterface shows all connected devices so I can determine the Pi's IP.

    But now it doesn't show up there anymore so I guess it doesn't even get an IP which makes it hard to ping.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • clem57
    clem57 over 9 years ago in reply to Former Member

    Check the cable for kinks or if you have another cable, try it. Also ports get loose and ned to be reseated. Clicks indicate good connection.

    C

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 9 years ago in reply to clem57

    The cable is fine. I reinstalled Volumio 2 and made sure everything worked as it should. The RPi boots up and I can reach it with a web browser or ssh.

    While logged in over ssh I download the tarball and ran `sudo tar zxf cirrus-linux-4.4.14.tgz -C /`

    Then I added `dtoverlay=rpi-cirrus-wm5102` and `dtoverlay=i2s-mmap` to `/boot/config.txt`

    After a `reboot` I can no longer connect through browser or ssh and the RPi no longer shows up in the overview of connected devices in my router. In the meantime the cable was never disconnected so that connection should be fine.

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

    I just had a look at volumio 2 (RC2 hotfix):

     

    It's setup is a quite different to Raspbian, it uses an initrd which sets up squashfs+overlayfs for the root partition. If you update the kernel, the modules in the initrd no longer match the kernel version, so it can't load them and setup the root filesystem which results in a nice kernel crash (visible if you connect a monitor or a serial console cable).

     

    I'm not sure if there's an official way to update the initrd from within a running volumio installation (there's a "volumio-init-updater" in /root, but it doesn't have the executable bits set and I'm not sure how to use it), but by looking at the buildscripts of the volumio system I figured out a way how to do it.

     

    After a fresh installation you first have to extract the existing initrd, there's one file we need from it, "init", which must be placed in the /root folder. Best do everything as root (use "sudo -s")

    root@volumio:~# mkdir initrd
    root@volumio:~# cd initrd/
    root@volumio:~/initrd# gzip -c -d /boot/volumio.initrd | cpio -i
    root@volumio:~/initrd# cp -a init /root/

    Then extract the cirrus kernel, setup the modprobe.d and config.txt files etc as usual (I also commented out "dtparam=audio=on" and "force_turbo=1" in config.txt - we don't want the onboard audio and I'm not sure force_turbo is a good idea on a RPi3 without a heatsink).

     

    Next better remove the old modules, (check version with "uname -r") - 4.4.9 in case of current Volumio 2. The script to create the initramfs might pick up the wrong modules (it just uses the first 2 directories). ATM this works fine, because alphabetical sorting puts 4.4.14 before 4.4.9, but it might fail in the future when volumio ships a different kernel version. Also we don't really need the old modules.

    root@volumio:~# rm -rf /lib/modules/4.4.9*

     

    Now you can create an updated initrd:

    root@volumio:~# /usr/local/sbin/mkinitramfs-custom.sh -o /boot/volumio.initrd

     

    Then reboot (which should now work), ssh into the RPi and check with "aplay -l" that the soundcard is there.

     

    Now the only thing left to do is run the appropriate usecase scripts like "Playback_to_Lineout.sh" etc. You only need to do that once, the settings are preserved via the alsa mixer settings accross reboots.

     

    so long,

     

    Hias

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 9 years ago in reply to hiassoft

    Many many thanks for your investigation and solution!

     

    While typing this message I am enjoying music playing through the Cirrus DAC on my RPi running Volumio image.

    The only other option would have been to buy a new (better supported) DAC and I'm really glad that is not necessary.

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

    @Matthias,

    you are right about volumio's initrd but you found a nice workaround. The volumio-init-updater does something else, it replaces the squash file on the second partition (as an alternative to doing this online).

    We have not finished the kernel & initrd update part, yet. Getting the first version of Volumio 2 had our priority.

    Gé

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

    Hi Gé!

    you are right about volumio's initrd but you found a nice workaround. The volumio-init-updater does something else, it replaces the squash file on the second partition (as an alternative to doing this online).

    We have not finished the kernel & initrd update part, yet. Getting the first version of Volumio 2 had our priority.

    Thanks a lot for the info! A already thought this part might still be WIP (also maybe I missed some bits and pieces). No need to hurry, take your time, and good luck finishing the release!

     

    so long,

     

    Hias

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • ray1112
    ray1112 over 9 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
  • 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.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube