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

    Hello,

     

    I  bought Pi3 and cirrus audio card and currently I am trying to record audio files of the specific length, let's say 3sec. I followed instructions and installed kernel that you provided. Everything seems to be working. However, when I try to record sudo arecord -Dhw:sndrpiwsp -r 44100 -c 3 -d 2 -f S32_LE /tmp/del.wav command doesn't terminate and I am getting multiple files .. The first del-01.wav normally is bigger of few kB and the rest are 44bytes size. Do you have any idea what can be wrong?

     

    debian Pastezone

     

    The main task here is to record audio and at the same time process it. Do you know if this is possible to do, that arecord would save data and at the same time, maybe in different thread process it and get spectrum? Other way probably is to record let's say 1sec, process it and maybe at the same time record the other 1sec file for next process.

     

    Best regards,

    Algis

     

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

    Hi Algis!

    However, when I try to record sudo arecord -Dhw:sndrpiwsp -r 44100 -c 3 -d 2 -f S32_LE /tmp/del.wav command doesn't terminate and I am getting multiple files ..

    This is a known bug "arecord -d" is broken in Debian/Raspbian Jessie

    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=821048

     

    You could try using arecord from Raspbian Wheezy or compile a newer version of arecord by yourself.

     

    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 Algis!

    However, when I try to record sudo arecord -Dhw:sndrpiwsp -r 44100 -c 3 -d 2 -f S32_LE /tmp/del.wav command doesn't terminate and I am getting multiple files ..

    This is a known bug "arecord -d" is broken in Debian/Raspbian Jessie

    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=821048

     

    You could try using arecord from Raspbian Wheezy or compile a newer version of arecord by yourself.

     

    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

    Hello,

     

    thank you for the information.

    I am quite new in the RPI field. Can you write more about how to use Raspbian Wheezy arecord opn Jessie and how to compile arecord? I can see that the current version of arecord is 1.0.25.

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

    thank you for the information.

    I am quite new in the RPI field. Can you write more about how to use Raspbian Wheezy arecord opn Jessie and how to compile arecord? I can see that the current version of arecord is 1.0.25.

    Using the wheezy version is the easier solution. Just download the wheezy alsa-utils package, extract it and then copy the extracted arecord for example to ~/bin/arecord-wheezy:

    pi@rpi3:~ $ cd /tmp
    pi@rpi3:/tmp $ wget http://mirrordirector.raspbian.org/raspbian/pool/main/a/alsa-utils/alsa-utils_1.0.25-4_armhf.deb
    pi@rpi3:/tmp $ mkdir unpack
    pi@rpi3:/tmp $ dpkg -x alsa-utils_1.0.25-4_armhf.deb unpack
    pi@rpi3:/tmp $ cp unpack/usr/bin/arecord ~/bin/arecord-wheezy

     

    Compiling from source is a little bit trickier. First you have to uncomment the deb-src lines in /etc/apt/sources.list and /etc/apt/sources.list.d/raspi.list. Then run the following 2 commands to download all packages required for building alsa-utils:

    pi@rpi3:~ $ sudo apt-get update
    pi@rpi3:~ $ sudo apt-get build-dep alsa-utils

    That'll download the build dependencies of alsa-utils 1.0.28 in jessie, but ATM that's fine for compiling the latest version (1.1.1).

     

    Then do the usual download - extract - configure - make steps to compile the source code:

    pi@rpi3:~ $ mkdir install
    pi@rpi3:~ $ cd install
    pi@rpi3:~/install $ wget ftp://ftp.alsa-project.org/pub/utils/alsa-utils-1.1.1.tar.bz2
    pi@rpi3:~/install $ tar jxf alsa-utils-1.1.1.tar.bz2
    pi@rpi3:~/install $ cd alsa-utils-1.1.1
    pi@rpi3:~/install/alsa-utils-1.1.1 $ ./configure
    pi@rpi3:~/install/alsa-utils-1.1.1 $ make

     

    A minute or 2 later the build is finished, but you might notice that there's no arecord. Nothing to worry about, aplay is a "combined" executable and contains both aplay and arecord - depending on the filename you'll either get aplay or arecord functionality (on standard installation arecord is a symlink to aplay).

     

    To make things easier, just copy the freshly compiled aplay for example to ~/bin/arecord-1.1.1

    pi@rpi3:~/install/alsa-utils-1.1.1 $ cp aplay/aplay ~/bin/arecord-1.1.1

     

    By naming the older/newer versions differently you can easily choose between the official Raspbian version (use "arecord") or your user-installed versions ("arecord-wheezy" / "arecord-1.1.1"). Of course you could name the older/newer versions "arecord" and install them in ~/bin or /usr/local/bin but that might bite you some time later when there are updates in Raspbian and entering "arecord" will use your manually installed version. OTOH entering "which arecord" will show which version is used, so you can still go that route if you prefer that.

     

    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