Cirrus Logic Audio Card on Raspberry Pi 2 with Debian Jessie
Legacy article about getting the Cirrus Logic Audio Card up and running with Debian Jessie.
[UPDATE 2017/12/21] The driver for the Cirrus Logic Audio Card left its experimental state and the card is easily usable in production.
HiassofT provides an up-to-date howto. Details can be found in the element14 forum.
[UPDATE 2015/09/01] Updated installation instructions for the devicetree drivers. Thanks to HiassofT.
- The audio card does not work out of the box on a Raspberry Pi 2 (at least until 2015/08/31).
- Official documentation is served as a PDF file but PDF is not the web.
- No social media channel from Cirrus Logic found which provides frequent update for users.
- Useful information can be found in the Element14 community forum, but IMO it is hidden through bad UX.
- Build instructions from the official Cirrus repository are outdated in a few places.
- A lot of frustration in the web.
- A summary would save other peoples time and work.
Credits go the the brave authors and contributors who shared their knowledge and code.
The Cirrus Logic Audio
The Cirrus Logic Audio Card is a high quality sound card (24-bit, 192kHz) and comes with analogue line-in/-out, SPDIF in/out and an onboard stereo microphone. It connects to the 40-pin GPIO of the Raspberry Pi 2.
More details can be found in the official manual and the specs datasheets.
But it doesn’t fit into my case…
Craig Berscheidt from Built-to-Spec has designed a custom case. He fortunately provides the design files at thingiverse and the corresponding assembly instructions at the Built-to-Spec blog. If you don’t have a laser cutter, just buy your case at the Built-to-Spec store.
Since RPi 2 has the same form factor as RPi B+, the case from Built-to-Spec fits. The PCB clips are a bit brittle, be careful when snapping them onto the Raspberry Pi.
And then it says: no soundcards found…
You plugged everything in and together, installed a raspbian image to your sd card, but…
~ $ aplay -l aplay: device_list:268: no soundcards found...
or anything but the cirrus soundcard:
~ $ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA] ... card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
As stated before, the card does not run out of the box on a Raspberry Pi 2. You have to build custom kernel modules and add the driver to the device tree.
Installing Debian Jessie
One of the benefits of Raspberry Pi 2 is, that it comes with an ARMv7 processor architecture. ARMv7 is widely supported by linux distributions and it doesn’t require prebuilt Raspbian packages. For Debian, the port of your choice is called armhf (arm hardfloat port) often refered to as “EABI hard-float ABI”.
Sjoerd Simons from Collabora provides prebuild Debian Jessie images for Raspberry Pi 2. The documentation can be found in a blog post.
However, I did not manage to boot a custom kernel with Cirrus support on that image. Therefore I suggest to install the official Raspbian image first and then upgrade to Jessie by following the upgrade instruction in the Jessie release notes.
If you feel unfamiliar with the following steps, please follow the upgrade instructions mentioned above. This section comes with no warranty:
- Go to
/etc/apt/and replace any occurences of
- Remove the configuration file
/etc/apt/sources.list.d/collabora.list. It’s a repo for a lightweight browser which was optimized for the limited resources of the Raspberry Pi 1. Collabora does not provide builds for Jessie and I guess you don’t need this browser on Raspbery Pi 2.
Execute the following commands as root or using
apt-get update apt-get upgrade apt-get dist-upgrade
This will probably take some time. For some packages you will be ask to choose a particular configuration file. If you just started with a fresh installation, you can safely answer “Yes” to any of these questions and install the configuration from the maintainers package.
- Now reboot your machine.
Building and installing the drivers for the Cirrus Logic Audio Card
Now to the nasty part. The kernel module from Cirrus has not made it into the official kernel repository. You have to build it by yourself. The fork from HiassofT is currently the most active and recent one. The following instructions are based on a forum post on element14 by HiassofT:
apt-get install screen bc screen git clone -b cirrus-4.1.y --single-branch --depth 1 https://github.com/HiassofT/rpi-linux.git cd rpi-linux/ make bcm2709_defconfig && make -j4 && make -j4 modules
[CTRL a] + d to quit your console session and let your Raspberry work hard in the background.
After half a day, get back to your session and install the build:
screen -r sudo make modules_install sudo cp /boot/kernel7.img /boot/kernel7.img.orig-bak sudo ./scripts/mkknlimg arch/arm/boot/zImage /boot/kernel7.img sudo cp -f arch/arm/boot/dts/*.dtb /boot/ sudo cp -f arch/arm/boot/dts/overlays/*.dtb arch/arm/boot/dts/overlays/README /boot/overlays/
Add the following lines to
And add the following lines to
softdep arizona-spi pre: arizona-ldo1 softdep spi-bcm2708 pre: fixed softdep spi-bcm2835 pre: fixed softdep snd-soc-wm8804-i2c pre: snd-soc-rpi-wsp-preinit softdep snd-soc-rpi-wsp pre: snd-soc-wm8804-i2c # To disable the buildin soundcard, also blacklist the `snd_bcm2835` module blacklist snd_bcm2835
Protect your kernel from being overridden by upgrades of the the bootloader packages when running
sudo apt-mark hold raspberrypi-bootloader
Reboot your Raspberry Pi.
Testing the audio card
Login, open a terminal and execute the following command:
~ $ aplay -l card 1: sndrpiwsp [snd_rpi_wsp], device 0: WM5102 AiFi wm5102-aif1-0  Subdevices: 1/1 Subdevice #0: subdevice #0
Then create a mixer setup. Cirrus provides some convenience scripts to preconfigure mixer settings. You can download the scripts from the CirrusLogic repository.
After unpacking, activate the line-out channel by executing:
Connect your stereo to the green audio jack and start your favorite music player.
Way too complicated. Anything more easy?
Go and kick Cirrus to provide bug free drivers for their audio card through the official raspberry kernel. It’s a shame they announce compatibility with Raspberry Pi 2 but don’t provide drivers for anyone except experienced kernel hackers. Their prebuild system image is not an option, because it probably breaks on upgrades.
There are some Debian packages to install a pre-build kernel + modules by autostatic. However there’s neither a build provided for Debian Jessie nor some source packages available. Not sure if you receive kernel updates through this repo at all… (I found that in the middle of an element14 forum post)
If you sell hardware for Raspberry Pi, …
- provide stable drivers through the offical raspberrypi linux kernel repository,
- provide a case if it does not fit into the usual cases,
- support your community with official updates, documentation and discussions,
- add an issue tracker to your source code repository,
- and don’t fool your customers with bad promises about compatibility.
Is there a way to get a single zip file of the sources for the driver, separate from the rest of the kernel? It seems to me that building a loadable kernel module would be the simplest path. I've done a few of those in the past, and I think they are a lot easier than trying to embed a driver in the kernel.
I have the 4.1-rpi.y kernel source on an external drive. I would be glad to try a few builds if it would help people out.
Never thought about that. Not sure if you can make it without devicetree.
Many thanks for your work.
Documentation is difficult. You have done it superbly. If only others...
So I used Ragnar's image and it worked on Friday. I had sound playing out the Cirrus board to speakers. Today I get "no soundcards found". Did the RPI update without me knowing it and cause this?
@Tom, can you post the output of the following commands:
Just above the bold tl;dr on this page is a link to an official Raspbian image. At that page an official Jessie can be found as well. I used that.
Following your instructions I now have 1.20150923-1 and 4.1.10-v7+ but still no audiodevices are to be found.
selected output from messages:
Oct 24 08:44:54 zoonyx kernel: [ 6.339437] arizona_spi: disagrees about version of symbol arizona_dev_init
Oct 24 08:44:54 zoonyx kernel: [ 6.339474] arizona_spi: Unknown symbol arizona_dev_init (err -22)
Oct 24 08:44:54 zoonyx kernel: [ 6.339533] arizona_spi: disagrees about version of symbol arizona_dev_exit
Oct 24 08:44:54 zoonyx kernel: [ 6.339548] arizona_spi: Unknown symbol arizona_dev_exit (err -22)
Oct 24 08:44:54 zoonyx kernel: [ 6.383694] wm8804: probe of 1-003a failed with error -5
what can I do more?
Will there be a day when the 'hold' on the installed kernel can be removed?
@Gert, it seems the package structure has been modified for the Jessie Raspbian image and the kernel has been ripped off from the raspberrypi-bootloader package. I'd need some time to investigate and test my setup instructions with the new Raspbian image. This could take some time since I am quite busy ATM. In the meantime I suggest to stick to the wheezy image and the "tl;dr" procedure.
Unless cirrus provides stable audio drivers to be merged into the official rpi kernel, you will have to deal with the 'hold' workaround.
Thanks, helped me a lot :) would donate some bits if would post your bitcoin pub address near GPG
Hi, at first, thank you for your work to create that tutorial. I tryed to use this tutorial for my Pi2 with Raspbian Jessie, Cirrus Logic Audio and the original 7" touch display.
After installation is no audiodevice found. When I use the original tutorial the card 0 exists two times. The first one with 8 sub devices, the second one with one sub device. But no "WM5102 AiFi wm5102-aif1-0 "-expression in it.
More confusing for me, the touch is not working any more after that. In my understanding this should add the cirrus driver to the kerne and overwrite that with the existing one. So either the driver for the touch has been overwritten or there is a problem and the driver doesn't work anymore because of an other problem.
Do you have any a hint for me, what I can do to get the Pi2 with Cirrus and Touch working together and not only separately?
Sorry, dass ich nochmal störe. Ich sehe gerade, dass Du aus Freiburg kommst. Du kannst natürlich auch gerne auf deutsch antworten, falls das einfacher ist :)
I don't wanna annoy you, but I've got a tip, which was not mentioned before. When you compile with "make" the Pi2 only uses one core, which is a maximum of 25% for the CPU load. You can get a CPU load of 100%, when you use the option "-j4". So with the command "make -j4" the Pi2 uses all of the 4 cores und goes up straight to 99-100% CPU load.
In my case, I try to compile with Wheezy instead of Jessie in the hope to get the Cirrus and the official Touch display working simultaneously. So using 4 Cores instead of only 1 is a big step. Deutsch:
Nicht, dass ich noch störe, aber ich habe einen Tipp, der bisher nicht erwähnt wird.
Möchte man kompilieren mit dem Befehl "make", so nutzt der Pi2 nur einen Kern. Das dauert natürlich ewig. Die CPU-Last wird also zu maximal 25% genutzt.
Nutzt man einen Pi2, so kann man mit der Option -j4 den Pi2 dazu bringen, alle Kerne zum Kompilieren zu nutzen. Also dann mit "make -j4" und schon steigt die CPU-Last auf 100%.
Da ich damit ja gerade teste und mal mit Wheezy ausprobiere, ob ich anschließend auch kein Touch mehr nutzen kann, kommt mir das gerade sehr gelegen. Schnell fertig ist es dann zwar nicht, aber immerhin.
Marino, thanks for your valuable comments. Sorry for the delay in publishing and answering them. All comments are moderated because of massive spam. And currently I hardly have any time for this blog.
I guess the two audio devices you see are onboard bcm2835. Could be that you can't find the cirrus device because the rpi kernel packages from the Raspbian distribution have changed significantly. I didn't have time or the need to dig into that.
The cirrus driver itself seems to be in such a bad state, that it breaks other hardware. I have read about that in some forums, e.g. http://www.diyaudio.com/forums/pc-based/270908-raspberry-pi-cirruslogic-audio-card-fail.html
I suggest to use a cheap USB soundcard if you just want to have better sound quality on audio-out. If you need more fancy HQ features, try a different device, e.g. one of the HiFiBerry who's drivers are part of the official Raspbian distribution. Though I never tested this one.
It's a shame that Cirrus sells a product which is IMHO not ready for production. I added a big fat warning on top of this blog post.
Thanks for your hint about "make -j4". I have added it to the tutorial.
there is no problem with publishing with delay. The only problem was, that I worked on the Pi during the delay and could not edit my posts :)
Last week I saw a stereo pre-amplifiert. This amplifier has the ability to convolve audio in realtime with filters. They use a Pi2 with the cirrus for that (http://www.audiovero.de/preamp-14-cleanvolver.php). Intereseting to know how they done it ;)
In my case I need a display to show the video from my door communication system. Atm my normal DECT-Phones are used to do the audio part und open the door (Asterisk and then a Fritzbox as Client with the phones, which are managed by the Fritzbox).
Later I want to test, if the Pi is also capable to be a SIP-Client. For Video and audio. Thats what I need the Cirrus for. Speaker and Mic on ohne board without big cirumstances I thought. Bad Idea, I know. Now I know better ;)
But the part of audio convolving was also a point to test that. It runs on that hardware and I need that for my system and don't want to run a PC every time. So that was the second reason to go with the Cirrus. But that needs a digital input and a digital output.
For Door Communication I need Mic, Speaker and Touchdisplay. For test with audio convolving a display is not necessary, but even without It is the change to get the cirrus running nearly impossible for me.
At least I could give you the hint with make -j4.
I think me cirrus is going back to the seller, because of the lack of function. I testet 2 days and the cirrus is still not working with wheezy or jessie. In that time I could work and buy hardware that is capable to do his job, even if it costs a hack of a lot more money.
Thanks for the information for installing the Cirrus Logic Audio board.
I first installed the “2015-11-21-raspbian-jessie.img” image and then used your installation procedure. The card is working perfect.
But for my project I want to use next to the Cirrus Logic audio card the Adafruit 2.8” TFT/Touch screen.
I have not found any information about building code for both the Logic audio card and the TFT display.
The result is always a not working raspberry pi.
Do you or anybody have any suggestions?
Ronald, I have neither experiences with the rasbian-jessie image nor with the TFT screen.
It looks like adafruit provides a compiled kernel including the TFT drivers. You would need to get the sources of these drivers from Adafruit, merge them with the ones from cirrus onto the rasbian kernel repository and then compile the kernel modules on your own.
I'm sorry that I can't provide any more details.
Any hardware without proper drivers merged into the official raspbian image heavily suck for the end users.
The image provided by Element14 works on PI 1B, until een upgrade (update works well).
Thank you very much for the build instructions. Most excellent and got me going.
Thank you so much!
The steps worked PERFECTLY.
This setup actually allows for headphone volume control (when using VLC, etc)... others don't.
Hi, this is to report sucess for using the Cirrus audio card on a raspi3:along with:
I used the info from the link: http://www.horus.com/~hias/cirrus-driver.html
I got the cirrus audio card from element14
I followed the instructions of the horus.com link, and installed the modified kernel 4.4.6 on my raspi3, with the modifications to get the cirrus card running, as explained in that link. I then got the cirrus card visible:
I then went to the installation of pd-l2ork ("Pure data Linux Laptop Orchestra") using the info of the link: http://l2ork.music.vt.edu/main/make-your-own-l2ork/software/raspberry-pi/
Work is in progress; I already get the Wolfson audio output working from within the installed application pd-l2ork, testing either sine output or white noise on a headset.
Overall, things went smoothly, without any compilation.
Clearly, the info on the hias's blog at horus.com is exquisite for making use of the Cirrus audio card on a raspberry 3 without hassle ! :-)
Hi Steffen, I follow your tutorial and I build the kernel in raspberry Pi2/Jessie and work fine. It is possible to build the same kernel on raspberry Pi3/Jassie ?
Worked with this audio card 2-3 years back for element14 roadtest and other stuff. Sad to see no improvements and the card is still surviving the market. Great documentation, btw. :)