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 Cirrus Logic Audio Card working on the Raspberry Pi 2
  • 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 165 replies
  • Subscribers 684 subscribers
  • Views 22698 views
  • Users 0 members are here
  • wolfson
  • raspberry
  • audio
  • pi
  • cirrus
  • raspberry_pi
  • rpi2
  • raspeberry_pi_accessories
  • pi2
Related

Cirrus Logic Audio Card working on the Raspberry Pi 2

Former Member
Former Member over 10 years ago

Hi all!

 

As you might know, Cirrus Logic's main kernel source branch recently switched to 3.18.

My first thought was "Hmm, that means the Cirrus Logic card could finally work on the RPi2..."

I have built a couple of 3.18 kernels for my B+ and RPi2 and I have managed to get both models to produce sound image

 

It's still early days, i.e. there are possibly bugs and glitches to fix, but for those of you who would like to try it out I've made an image file that you can download here:

https://drive.google.com/file/d/0BzIaxMH3N5O1cmJ1bFhMcG1hc0E/view?usp=sharing

The file is a 1.3 GB zip. Uncompressed size is 3.1 GB, so it fits comfortably on a 4 GB card.


The image is based on the standard 2015-02-16-raspbian-wheezy image from the Foundation that you flash to a SD card for a fresh install.

I have only added my kernels and set up the configuration files to get the card going.

It should work on the older B model  with a Wolfson Audio Card too, but I haven't tested that yet.

 

Have fun!

--

Ragnar

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    Former Member over 10 years ago

    For those interested I've uploaded the following packages to my Raspbian repository (http://rpi.autostatic.com/):

    • linux-image-cirrus: meta package that installs a kernel with Wolfson/Cirrus Logic audio interface support
    • cirrus-config-overlay: package that installs the device tree overlay file for the Wolfson/Cirrus Logic audio interface
    • cirrus-config-modprobe: package that installs the modprobe config file for the Wolfson/Cirrus Logic audio interface
    • cirrus-config-scripts: package that installs the playback, record and reset scripts for use with the Wolfson/Cirrus Logic audio interface
    • cirrus-config: meta package that installs all the above packages

    If anyone is interested in testing these packages, go ahead, feedback is greatly appreciated. On a clean Raspbian install adding my repo, installing the cirrus-config package and rebooting your RPi should enable the Wolfson/Cirrus Logic audio interface. No need to edit any config files.

     

    Jeremy

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • hmaerki
    hmaerki over 10 years ago in reply to Former Member

    Hi Jeremy

     

    I installed your cirrus-packages and could start Jack:

     

    jackd -dalsa -r44100 -p882 -n2 -C hw:sndrpiwsp -P hw:sndrpiwsp
    jackdmp 1.9.9
    ...
    JACK server starting in realtime mode with priority 10
    audio_reservation_init
    Acquire audio card Audio0
    creating alsa driver ... hw:sndrpiwsp|hw:sndrpiwsp|882|2|44100|0|0|nomon|swmeter|-|32bit
    configuring for 44100Hz, period = 882 frames (20.0 ms), buffer = 2 periods
    ALSA: final selected sample format for capture: 32bit integer little-endian
    ALSA: use 2 periods for capture
    ALSA: final selected sample format for playback: 32bit integer little-endian
    ALSA: use 2 periods for playback

     

    This looks fine. Great work! Thanks a lot!

     

    Could you assist me in finding a solution for this requirement:

    I need to listen and playback a the same time to: Cirrus-Headset AND Cirrus-Lineout at the same time.

    However in Jack I only see the Headset as system:xxx.

     

    Thanks a lot in advance

       Hans

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

    Hi Jeremy

     

    I installed your cirrus-packages and could start Jack:

     

    jackd -dalsa -r44100 -p882 -n2 -C hw:sndrpiwsp -P hw:sndrpiwsp
    jackdmp 1.9.9
    ...
    JACK server starting in realtime mode with priority 10
    audio_reservation_init
    Acquire audio card Audio0
    creating alsa driver ... hw:sndrpiwsp|hw:sndrpiwsp|882|2|44100|0|0|nomon|swmeter|-|32bit
    configuring for 44100Hz, period = 882 frames (20.0 ms), buffer = 2 periods
    ALSA: final selected sample format for capture: 32bit integer little-endian
    ALSA: use 2 periods for capture
    ALSA: final selected sample format for playback: 32bit integer little-endian
    ALSA: use 2 periods for playback

     

    This looks fine. Great work! Thanks a lot!

     

    Could you assist me in finding a solution for this requirement:

    I need to listen and playback a the same time to: Cirrus-Headset AND Cirrus-Lineout at the same time.

    However in Jack I only see the Headset as system:xxx.

     

    Thanks a lot in advance

       Hans

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

    Hello Hans,

     

    Thanks for the feedback! Regarding JACK, apologies for sounding patronizing but why the 882 period size? Default is 1024 and normally you would use only powers of 2. And -dhw:sndrpiwsp equals -C hw:sndrpiwsp -P hw:sndrpiwsp image

    You can use the headset and line out outputs simultaneously by running their respective ALSA scripts (Playback_to_Headset.sh and Playback_to_Lineout.sh), starting JACK and then connecting your JACK ports to the system:playback_* ports. There should be sound on both outputs, at least, I'm testing it now with jack_metro and the beeps are coming out of both the line out and the headset outputs.

     

    Jeremy

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • hmaerki
    hmaerki over 10 years ago in reply to Former Member

    Hello Jeremy

     

    Thanks a lot for your quick reply.

     

    However, I need DIFFERENT Sound on Headset and Lineout. And therefore I need 4 Output-Plugs in Jack.

     

    Do you have any clue how to do that?

     

    Any help is greatly appreciated

       Hans

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to hmaerki

    As far as I know that is not possible with the current drivers, it is not possible to define different outputs in ALSA/JACK (hence the clunky scripts). Maybe something can be done with an .asoundrc script but that's a bit over my head and  probably it can't be done because I don't see any PCM devices exposed. You might also want to ask on IRC in the #alsa channel on Freenode.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to hmaerki

    No, it is not possible with the current drivers. The I2S interface can only carry one or two channels. There could be ways around that, but that means some driver hacking.

    Florian Meier  ( koalo ) has done some experiments with four channel input on the Wolfson card, but I don't know of any real implementation to get more than two channels.

    --

    Ragnar

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to Former Member

    Jeremy ,

     

    I am making a project about audio recorder with RPi2 and cirrus audio logic card, i wonder if you answer me some questions:

     

    1) What are the steps to connect RPi2 with Cirrus audio logic card?

    2) how to recorder audio in the micro sd card of the RPi2

     

    please i hope yours answers asap

     

    thanks

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

    Diego Caballero wrote:

     

    I am making a project about audio recorder with RPi2 and cirrus audio logic card, i wonder if you answer me some questions:

     

    1) What are the steps to connect RPi2 with Cirrus audio logic card?

     

     

    <shameless plug> I just published a blog post which summarizes my research on this particular question https://stmllr.net/blog/cirrus-logic-audio-card-on-raspberry-pi2-with-debian-jessie/index.html
    [edit] Disclaimer: the post requires some experience with linux and patching here and there.

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

    Steffen Müller wrote:


    <shameless plug> I just published a blog post which summarizes my research on this particular question https://stmllr.net/blog/cirrus-logic-audio-card-on-raspberry-pi2-with-debian-jessie/index.html

    Nice post!

     

    Just a few additions, first the important one: when you compile the kernel by yourself, be sure to copy over all the devicetree files. Most importantly the bcm2709-rpi-2-b.dtb, but also all the other overlay files. These files get important changes from time to time and if you happen to use devicetree files not matching your kernel version you might run into very strange errors - I got caught by this once during testing.

     

    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/

     

    And I prefer to use mkknlimg from the RPi kernel tree instead of some external one:

     

    sudo ./scripts/mkknlimg arch/arm/boot/zImage /boot/kernel7.img

     

    The rest of your instructions look fine, good job!

     

    Edit: And, yes, this forum software is a real PITA. Almost every time I have to switch to html mode and edit the html code directly because the "advanced" or "full" editors messed something up...

     

    so long,

     

    Hias

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

    @HiassofT Thanks for your feedback on the blog post, I added your suggestions.

    • 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 © 2025 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