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

    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 9 years ago in reply to Former Member

    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
  • Former Member
    Former Member over 9 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 9 years ago in reply to Former Member

    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
Reply
  • hiassoft
    hiassoft over 9 years ago in reply to Former Member

    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
Children
  • Former Member
    Former Member over 9 years ago in reply to hiassoft

    Hi Hias!

     

    I was able to execute that command from /home/pi/Downloads where the file is, and as you said it did return to the prompt after a couple seconds without showing anything "running" on the console.

    Before i had cd'd to root and opened it there, and saw lots of stuff run through the console window. I wonder if I should rebuild again and only open the tgz file using your method? My dmesg now shows the 4.4.6 kernel, I rebooted and still getting the no such device when I run a script.

     

    Also, could this be a power issue? I'm running off a samsung phone charger right now that provides 5 V at 2 A. I have no "rainbow corner" so I assumed everything was fine. The Cirrus shows constantly lit red and greed LEDs.

     

    Anyway, still no luck. There must be something silly going on that is right under my nose. Here is my current debug:

    root@raspberrypi:/home/pi# dmesg | pastebinit

    http://paste.debian.net/441673/

    root@raspberrypi:/home/pi# aplay -l | pastebinit

    http://paste.debian.net/441674/

    root@raspberrypi:/home/pi# lsmod | pastebinit

    http://paste.debian.net/441675/

    root@raspberrypi:/home/pi# vcdbg log msg 2>&1 | pastebinit

    http://paste.debian.net/441676/

     

    does the "fragment" stuff look off to you?

     

    The config.txt has two instance of spi and i2c now after I enabled them in raspi-config

     

     

    # 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

     

    dtparam=spi=on

    dtparam=i2c_arm=on

     

    dtdebug=1

     

    Thanks again for everything!

     

    -Eric

     

    MANY EDITS LATER:

     

    Card has been recognized! It seems at least one major issue was poor syntax (I had softdep arizona-spi pre: arizona ldo1, instead of arizona-ldo1 in my modprobe file)!

    I also carefully rebuilt the pi, making sure to tar the 4.4.6 file only once using the method you described, and not to mess around with config files more than I needed to.

    Thanks you so much for the help.

    ...Now I might have some real questions.

     

    Thanks again!

     

    -Eric

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

    Hi Eric!

     

    It looks like you might have an error in the /etc/modprobe.d file (better use cirrus.conf instead of raspi-blacklist.conf BTW) and the softdeps aren't setup properly.

     

    Double-check the filename and compare the contents of the file with the info on my website. See also this reply, card detection failed for the same reason there

    https://www.element14.com/community/message/194595/l/re-driver-fixes-and-updates-to-kernel-31816-and-405#194595

     

    As for extracting the tar file: if you previously tried this without sudo you proably got tons of error messages that the files couldn't be created - the normal "pi" user doesn't have permissions to write to /lib/modules, only "root" can do that. In this case nothing bad should have happened though.

     

    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

    Hi Hias!

     

    Thanks so much for the feedback. My current situation is this: The card is now detected, I can see input levels on pulseaudio, I can hear output on the Line Out using ./Listen_to_LineIn_on_Lineout.sh but the outputs and levels don't show up in pulseaudio.

     

    My other issue is that when listening to line in on line out, I'm getting glitches and dropouts. I've double checked my modprobe.d file, which is now cirrus.conf instead of raspi-blacklist.conf: ( i rm'd the raspi-conf after I saved it with the new name)

     

    softdep arizona-spi pre: arizona-ldo1

    softdep spi-bcm2708 pre: fixed

    softdep spi-bcm2835 pre: fixed

     

     

    the only uncommented parts of my config:

     

    # Enable audio (loads snd_bcm2835)

    #dtparam=audio=on

    dtoverlay=rpi-cirrus-wm5102

    dtoverlay=i2s-mmap

     

    I looked at my dmesg and found this, which you may have seen: (sorry the keyboard I'm on isn't configured properly to use the pastebinit command)

     

    [    7.025753] snd-rpi-wsp sound: ASoC: CPU DAI (null) not registered

    [    7.128935] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer

    [    7.129251] snd-rpi-wsp sound: ASoC: CPU DAI (null) not registered

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

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

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

    [    7.150748] bcm2708_i2c 3f804000.i2c: BSC1 Controller at 0x3f804000 (irq 83) (baudrate 100000)

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

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

    [    7.159152] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000

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

    [    7.266335] LDO1: supplied by DC_1V8

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

    [    7.295326] wm8804 1-003b: revision E

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

    [    7.305295] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)

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

    [    7.377942] brcmfmac: brcmf_sdio_drivestrengthinit: No SDIO Drive strength init done for chip 43430 rev 1 pmurev 24

    [    7.379138] usbcore: registered new interface driver brcmfmac

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

    [    7.402751] arizona spi0.1: WM5102 revision C

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

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

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

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

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

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

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

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

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

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

    [    7.493383] MICVDD: supplied by DC_1V8

    [    7.503467] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Dec 15 2015 18:10:45 version 7.45.41.23 (r606571) FWID 01-cc4eda9c

    [    7.525662] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code

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

    [    7.597968] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code

     

     

    later in the dmesg is this:

     

     

    [   14.673795] bcm2835-i2s 3f203000.i2s: I2S SYNC error!

    [   14.704024] arizona spi0.1: Mixer dropped sample

    [   14.802847] bcm2835-i2s 3f203000.i2s: I2S SYNC error!

    [   14.855312] arizona spi0.1: Mixer dropped sample

    [  680.132621] arizona spi0.1: Mixer dropped sample

    [  696.909914] bcm2835-i2s 3f203000.i2s: I2S SYNC error!

     

     

    Any idea what could be causing this?

     

    Thanks again for everything.

     

    -Eric

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

    Hi Eric!

     

    Your setup looks fine now. Don't worry about the dmesg entries, during powerup it's normal to see several "DAI xxx not registered" lines due to module initialisation ordering and deferred probing. "I2S SYNC error" and "mixer dropped sample" happen when the device is opened and/or when switching sample rates, that's normal too and so far didn't cause any issues.

     

    I'm not familiar with pulseaudio but I'd say it's normal you don't see anything on "output". That refers to the RPi outputting audio. When you use the listen script audio is passed directly from the input to the output pins within the sound chip, the RPi has nothing to do with that. You can even disable audio input (don't use "Record_from_lineIn.sh"), then you won't see any input too. Output from/input to RPi and additional "listen" routings are completely separate.

     

    When do you get the glitches/dropouts? Do these also happen when you disable pulseaudio?

     

    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