element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Forum Driver fixes and updates to kernel 3.18.16 and 4.0.5
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Raspberry Pi requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 180 replies
  • Subscribers 148 subscribers
  • Views 3484 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 6 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

  • Reply
  • Cancel
  • Cancel

Top Replies

  • hiassoft
    hiassoft over 5 years ago in reply to Former Member +3

    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…

  • hiassoft
    hiassoft over 6 years ago +2

    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…

  • markzed
    markzed over 6 years ago +1

    Thanks a bunch for doing this. For those of us who are really noobs (like me) here are detailed instructions.

     

    For 3.18.16

     

    • Get the 3.18.16 raspbian image. I used the Raspbian image provided by Raspberry Pi…
Parents
  • Former Member
    Former Member over 6 years ago

    Hias,

     

    Thanks for your hard work producing these kernel patches. Any chance of a precompiled 4.1.7 kernel?


    Paul

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • hiassoft
    hiassoft over 6 years ago in reply to Former Member

    Thanks for your hard work producing these kernel patches. Any chance of a precompiled 4.1.7 kernel?

    Here's a precompiled tarball of the current 4.1.12 kernel:

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

     

    @Ed: thanks a lot for the Arch pkgbuild, that's really cool!

     

    so long,

     

    Hias

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • Former Member
    Former Member over 6 years ago in reply to hiassoft

    Many thanks, that's awesome, that will fix lots of things for me and no doubt others too - Paul

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • Former Member
    Former Member over 6 years ago in reply to Former Member

    Does anyone habe a compiled Version for Kernel 4.0.13?

     

    I've tryed it on Jessie and Wheezy with my Pi2, the Cirrus Logic Audio card and the official 7" Touch Screen. The Cirrus won't work und the worst thing, even the Touchscreen won't recognize touch anymore after the procedure.

     

    Or do I have a missunderstanding. Compile a new kernel means that the drivers for the cirrus are add to the existing/installed kernel?

     

    After installing Jessie I was on Kernel 4.0.7 for what no compiled kernel for the Cirrus was uploaded. Because of that I made an update und voila 4.0.13

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • hiassoft
    hiassoft over 6 years ago in reply to Former Member

    Does anyone habe a compiled Version for Kernel 4.0.13?

    Do you mean 4.1.13? I'll upload one shortly.

    I've tryed it on Jessie and Wheezy with my Pi2, the Cirrus Logic Audio card and the official 7" Touch Screen. The Cirrus won't work und the worst thing, even the Touchscreen won't recognize touch anymore after the procedure.

     

    Or do I have a missunderstanding. Compile a new kernel means that the drivers for the cirrus are add to the existing/installed kernel?

     

    After installing Jessie I was on Kernel 4.0.7 for what no compiled kernel for the Cirrus was uploaded. Because of that I made an update und voila 4.0.13

    What exactly did you do? Did you compile a kernel yourself, if yes which kernel sources did you use?

     

    I'm not familiar with the touchscreen, but I'd suggest you first try to get the touchscreen working with the official RPi kernel and once you are there try getting the the Cirrus card working, too.

     

    BTW: If you download the kernel with the Cirrus driver from my github repository and compile it yourself, or if you just install the precompiled cirrus kernel, you are replacing the whole kernel and all drivers with the new version.

     

    In my precompiled kernels I use the exact same kernel config options as the official kernel plus the Cirrus specific options added to that. So basically it should behave like an official kernel with the Cirrus drivers added, but still there's some risk that one of the Cirrus specific options causes issues with other drivers.

     

    so long,

     

    Hias

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • hiassoft
    hiassoft over 6 years ago in reply to hiassoft

    Here's a new precompiled kernel, based on 4.1.13 plus all commits up to today:

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

     

    I've made some significant changes to the Cirrus, I2S and DMA drivers, so if you notice any regressions from the previous 4.1.12 version please report back here.

    • Removed the rather ugly custom wm8804 one-time-init code and use the in-kernel wm8804 driver's hardware reset feature instead
    • Fixed a bug in the bcm2708-dmaengine driver that caused the physical period/buffer layout to be different than the one requested from ALSA.
    • Bumped the maximum DMA transfer limit from 32k to 64k-4 as in the 4.3 kernel bcm2835-dma driver
    • Set the maximum period size of the I2S driver to the limit of the DMA driver (64k-4 bytes) to ensure the physical period/buffer allocation will always be as requested by ALSA

     

    so long,

     

    Hias

    • Cancel
    • Up +1 Down
    • Reply
    • Cancel
Reply
  • hiassoft
    hiassoft over 6 years ago in reply to hiassoft

    Here's a new precompiled kernel, based on 4.1.13 plus all commits up to today:

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

     

    I've made some significant changes to the Cirrus, I2S and DMA drivers, so if you notice any regressions from the previous 4.1.12 version please report back here.

    • Removed the rather ugly custom wm8804 one-time-init code and use the in-kernel wm8804 driver's hardware reset feature instead
    • Fixed a bug in the bcm2708-dmaengine driver that caused the physical period/buffer layout to be different than the one requested from ALSA.
    • Bumped the maximum DMA transfer limit from 32k to 64k-4 as in the 4.3 kernel bcm2835-dma driver
    • Set the maximum period size of the I2S driver to the limit of the DMA driver (64k-4 bytes) to ensure the physical period/buffer allocation will always be as requested by ALSA

     

    so long,

     

    Hias

    • Cancel
    • Up +1 Down
    • Reply
    • Cancel
Children
  • Former Member
    Former Member over 6 years ago in reply to hiassoft

    Hi Matthias,

     

    thank you for uploading, I'll test this one.

    I compiled the kernel myself on the raspberry Pi 2. The touch is working out of the box with Jessie and with "pri-update" on wheezy. No calibration or configuration needed. Kernel 4.1 or newer is needed as far as I know.

     

    I used the original Tutorial on "https://github.com/CirrusLogic/rpi-linux/wiki/Building-the-code" with the following 2 Sources:

    https://github.com/raspberrypi/tools

    https://github.com/CirrusLogic/rpi-linux.git

     

    Adding instead of replacing is the only right choice to do this in my opinion. When the original tutorial replaces I don't wonder why the touch stopped working.

     

    Is there any tutorial how to do this on the cirrus? I may have to do this after every kernel-update and wanna do it the right way.

     

    Greetings from germany

    Jonas

     

    PS: You know the option -j4 for the make-command? This uses 4 cores instead of only one...

     

     

     

    EDIT:

    I tested the kernel. For that I connected via ssh@root an replaced all files in your uploaded file for Kernel 4.1.13. Before that I made a backup from that and yesterday I made a backup from the SD-Card.

    The touch is working after restarting the Pi2, but the audio card is not recognized.

     

    Here is what I get:

    root@Raspi2:~# aplay -l

    **** Liste der Hardware-Geräte (PLAYBACK) ****

    Karte 0: ALSA [bcm2835 ALSA], Gerät 0: bcm2835 ALSA [bcm2835 ALSA]

      Sub-Geräte: 8/8

      Sub-Gerät #0: subdevice #0

      Sub-Gerät #1: subdevice #1

      Sub-Gerät #2: subdevice #2

      Sub-Gerät #3: subdevice #3

      Sub-Gerät #4: subdevice #4

      Sub-Gerät #5: subdevice #5

      Sub-Gerät #6: subdevice #6

      Sub-Gerät #7: subdevice #7

    Karte 0: ALSA [bcm2835 ALSA], Gerät 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]

      Sub-Geräte: 1/1

      Sub-Gerät #0: subdevice #0

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • Former Member
    Former Member over 6 years ago in reply to Former Member

    Hi HiassofT,

     

    thanks for your great work.

     

    I unpacked your newest Kernel-package in the root directory. Modified the two files but can't find the soundcard via aplay -l

    Do you have any idear what I could have done wrong?

     

    my edited files:

     

    /etc/modprobe.d/cirrus.conf

     

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

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

    blacklist snd_bcm2835

     

    /boot/config.txt

     

    dtoverlay=rpi-cirrus-wm5102-overlay
    dtoverlay=i2s-mmap

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • hiassoft
    hiassoft over 6 years ago in reply to Former Member

    Hi Jonas & Esmi!

     

    Could you please do the following:

    • add dtdebug=1 to config.txt
    • reboot the pi
    • then post the outputs of vcdbg log msg and dmesg

     

    BTW: The easiest way to post the log outputs is by installing the pastebinit package in Raspbian (apt-get install pastebinit). Then enter the following commands and just post the URLs you got from pastebinit

    vcdbg log msg 2>&1 | pastebinit
    dmesg | pastebinit

     

    Also: have you tried the previous 4.1.12 version, did that work for you?

     

    so long,

     

    Hias

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • Former Member
    Former Member over 6 years ago in reply to hiassoft

    Hi Matthias,

     

    thanks for your response. I will do that today evening. I'm know following a lead, that my noobs-installer could be the cause of the problem....could that be?

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • Former Member
    Former Member over 6 years ago in reply to Former Member

    Ok, here are the logs

     

    vcdbg log msg:

     

    paste.debian.net/336029

     

    001453.656: Failed to load overlay 'rpi-cirrus-wm5102-overlay'

     

    dmesg:

     

    paste.debian.net/336030

     

     

     

    regarding NOOBS: I mounted mmcblk0p5 to copy the new kernel bootfiles in it (as I read in a nother board) - but they seem to be the same content as root/boot

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • hiassoft
    hiassoft over 6 years ago in reply to Former Member

    Esmi Schildburg wrote:

     

    thanks for your response. I will do that today evening. I'm know following a lead, that my noobs-installer could be the cause of the problem....could that be?

    I'm not familiar with noobs, but it could be - for example if you edited config.txt on the wrong partition. So I wouldn't rule that out as a possibility.

     

    A simple way to check if the dtoverlay was loaded is to look at the files in /proc/device-tree/sound/ .

     

    If the overlay is loaded you should have a file named "compatible" there with the contents "wlf,rpi-wm5102". You also should have a file "status" with contents "okay" and a file "i2s-controller".

     

    If these files are missing, something went wrong with the dtoverlay or the overlay files. The "vcdbg log msg" output should reveal the details. Ah, BTW, since you are using noobs you might have to add the "dtdebug=1" to the noobs config.txt file on the primary partition - but I'm not sure about that.

     

    so long,

     

    Hias

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • hiassoft
    hiassoft over 6 years ago in reply to Former Member
    Ok, here are the logs

    Thanks! It looks like not only it didn't find the overlay but also booted an old kernel (4.1.7 instead of 4.1.13).

     

    So quite certainly the files the boot/* files in the tarball (kernel and overlay) ended up on the wrong partition.

    regarding NOOBS: I mounted mmcblk0p5 to copy the new kernel bootfiles in it (as I read in a nother board) - but they seem to be the same content as root/boot

    Hmmm... Sorry, can't help with that. I'm a total noob regarding NOOBS

     

    so long,

     

    Hias

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • Former Member
    Former Member over 6 years ago in reply to hiassoft

    okay, thank you - so the /boot - / NOOBS - thing seems to be the problem

     

    At the moment I am short on SD-Cards - I will try it with an raspbian image without noobs next week

     

    But thanks for your insight!

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • Former Member
    Former Member over 6 years ago in reply to Former Member

    okay - solved^^

     

    I doublechecked - and well.... it seems I didn't really extract the tgz file - I just unpacked in in a tar file - so there was indeed no new kernel

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • hiassoft
    hiassoft over 6 years ago in reply to Former Member

    Esmi Schildburg wrote:

     

    okay - solved^^

     

    I doublechecked - and well.... it seems I didn't really extract the tgz file - I just unpacked in in a tar file - so there was indeed no new kernel

    Cool, glad you got it working!

     

    Did you have to do anything special regarding NOOBS?

     

    so long,

     

    Hias

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
Element14

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 © 2022 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

  • Facebook
  • Twitter
  • linkedin
  • YouTube