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
    About the element14 Community
  • 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 715 subscribers
  • Views 27038 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

e14 Contributor
e14 Contributor over 11 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
  • e14 Contributor
    e14 Contributor over 10 years ago in reply to e14 Contributor

    OK, so I was able to record from both the onboard MEMS mics and from this: http://www.amazon.com/Lavalier-Omnidirectional-Condenser-Microphone-Smartphones/dp/B011EXBCMQ

     

    That lapel mic is a TRRS (Tip, Ring, Ring, Sleeve) which is meant for smartphones.

     

    I wasn't sure how it would behave with the Headphone jack (black) or the Line-In Jack (Pink) of the CLAC.

     

    Below are the batch files I created.

     

    For the MEMS mic record I used:

     

    File: testDMIC.sh

    #!/bin/bash

    ./Record_from_DMIC.sh

    arecord -f S16_LE  -c 2 -d 5 -D hw:sndrpiwsp -r 44100 s_testDMIC.wav

     

    pi@raspberrypi: ~$ sudo chmod +x testDMIC.sh

    pi@raspberrypi: ~$ sudo bash testDMIC.sh

    pi@raspberrypi: ~$ aplay s_testDMIC.wav

     

    It worked very well.  Playback was crystal clear.

     

    For the Lapel Mick I tried two ways.  First, recording from the Headset jack (black)

     

    File: testMicHeadset.sh

    #!/bin/bash

    ./Record_from_Headset.sh

    arecord -f S16_LE  -c 2 -d 5 -D hw:sndrpiwsp -r 44100 s_testMicHeadset.wav


    (plug in the Mic to the Heaset Jack)

    pi@raspberrypi: ~$ sudo chmod +x testMicHeadset.sh

    pi@raspberrypi: ~$ sudo bash testMicHeadset.sh

    (unplug the mic from the headset jack, plug in the speakers/headphones to the headset jack)

    pi@raspberrypi: ~$ aplay s_testMicHeadset.wav


    Again, it worked very well.  Was a bit hotter than the MEMS mics, or maybe I should say the MEMS mics were a tad bit attenuated in comparison.  Playback was crystal clear.


    The second way was to record using the Lapel Mic using the Line In (Pink)


    #!/bin/bash

    ./Record_from_lineIn.sh

    arecord -f S16_LE  -c 2 -d 5 -D hw:sndrpiwsp -r 44100 s_lineIn.wav


    Got nothing out of the wav file.  Was completely silent.  This makes sense, since microphone levels are such low power and would require a pre-amp to go into a Line Level.  So I was intrigued by the script titled "Record_from_lineIn_Micbias.sh" which, according to the user manual, says:

    "Record from line in socket at microphone sensitivity level, and with mic bias voltage switched ON "

     

     


    So I tried:

    #!/bin/bash

    ./Record_from_lineIn_Micbias.sh

    arecord -f S16_LE  -c 2 -d 5 -D hw:sndrpiwsp -r 44100 s_LineInMIC.wav


    Heard a soft pop at the beginning and then silence.  I don't know enough about the LineIn circuitry vs the Headphone circuitry to provide clarification as to what is happening.



    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 10 years ago in reply to e14 Contributor

    I cant put lines into /etc/modprobe.d/raspi-blacklist.conf 

    When I try to put lines into this directory I open a (only read) and I cant save it. Or it adds a textfile extesion

    Who can give me a guideline to add lines to this directory?

    And can you add to the  /boot/ config.text in the same way?l


    Hugo50


    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 10 years ago in reply to e14 Contributor

    Hugo

    It sounds as if you do not have write permission of these files.

    Are you new to working with Linux?  If so, let me help.  If not, then ignore me.

     

    If I run the long version of the file list command on the /etc/modprobe.d directory I get ...

     

    pi@raspberrypi ~ $ ls -l /etc/modprobe.d

    total 24

    -rw-r--r-- 1 root root  229 May  8  2013 alsa-base-blacklist.conf

    -rw-r--r-- 1 root root 1186 May  8  2013 alsa-base.conf

    -rw-r--r-- 1 root root  456 Apr 29  2013 fbdev-blacklist.conf

    -rw-r--r-- 1 root root   65 Feb 15  2015 ipv6.conf

    -rw-r--r-- 1 root root  357 Mar 27  2015 oss-compat.conf

    -rw-r--r-- 1 root root   70 Mar 27  2015 raspi-blacklist.conf

    pi@raspberrypi ~ $

     

    This shows that these files are owned by the user 'root'  (The second 'root' tells you that they are also in group root.)

    The -rw-r--r-- tells you the permissions on these files.  Ignore the first dash for now.  The remaining nine characters form three groups of three.  Each group is Read, Write  , eXecute.

    The groups are Owner, group, others in that order.

     

    So the pattern on all these files tells us that the owner, that is root, has read and write permission on the files, but not execute permission.  (rw-)

    Both the group and others only have read permission (r--).

     

    In order to change these files you therefore need to be user root.  You can use the 'su' command to change which user you are - providing that you know root's password, or you can use the sudo command to temporally change who you are while running the command.

     

    So to edit the raspi-blacklist.conf file you could run the command :-

    sudo nano /etc/modprobe.d/raspi-blacklist.conf

     

    OK?

     

    David

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 10 years ago in reply to e14 Contributor

    Just after I asked my question a few days ago I tried again.  I am sure that I used the same image that I used earlier , but ...

     

    The thing worked for me.  I now have exactly what I wanted - except that I would ideally have the Pi running headless.  At present I am running it using ssh -Y to communicate.  If I do not use the X forwarding then the jack stuff wont start.

     

    Does anyone else have pointers for me?

     

    David

    p.s.   The kernel I am running successfully is

    3.18.9-v7cludlmmap #2 SMP PREEMPT Fri Mar 27 12:07:39 CET 2015 armv7l GNU/Linux

     

    I think that the image I started with was 2015-02-16-raspbian-wheezyW_CL.img

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 10 years ago

    Dear i have raspberry pi2 model B and cirrus logic audio card .I have installed raspberry image which is provided by element 14 .

    My kernal version is Linux raspberrypi 3.18.9-v7+ #2 SMP PREEMPT Mon Mar 23 20:25:20 GMT 2015 armv7l GNU/Linux.

     

    I am able to listen music through Mplayer. But when i am SIP soft phone configuration doing that time my microphone is not able to hold by softphone .

    please can you tell me the reason i can resolve this issue.

     

    pi@raspberrypi ~ $ aplay -l

    **** List of PLAYBACK Hardware Devices ****

    card 0: sndrpiwsp [snd_rpi_wsp], device 0: WM5102 AiFi wm5102-aif1-0 []

      Subdevices: 1/1

      Subdevice #0: subdevice #0

    card 1: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]

      Subdevices: 8/8

      Subdevice #0: subdevice #0

      Subdevice #1: subdevice #1

      Subdevice #2: subdevice #2

      Subdevice #3: subdevice #3

      Subdevice #4: subdevice #4

      Subdevice #5: subdevice #5

      Subdevice #6: subdevice #6

      Subdevice #7: subdevice #7

    card 1: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]

      Subdevices: 1/1

      Subdevice #0: subdevice #0

     

    Thanks in advance.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 10 years ago in reply to e14 Contributor

    Hi Sebastian

     

    I'm having issues trying to blacklist the default sound card.

     

    I tried following your instructions above but was told "permission denied".

     

    I created my own file called blacklist.conf and put the line

     

    blacklist snd_bcm2835

     

    in it.  Saved and rebooted. No change.

     

    I took that same line and appended it to raspi-blacklist.conf but, again, no change.

     

    If I run alsamixer and press F6 to Select Sound Card I can choose:

     

    - (default)

    0 snd_rpi_wsp

    1 bcm2835 ALSA

     

    If I choose default, it sets my card to:

     

    bcm2835 ALSA

     

    I can run aplay -D hw:sndrpiwsp test.wav and hear sound, but if I run aplay test.wav I hear nothing.  And I hear nothing out the RPi's audio out, interestingly.  Is this aduio going out the HDMI??

     

    Anyway, it seems like some people have this issue.  I did NOT have this issue when i used Ragnar's image, but when I tried the "manual" way I cannot seem to set the CLAC as the default sound card.  Can someone explain in detail what I need to do to set it as default?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 10 years ago in reply to e14 Contributor

    Thanks a lot for your help,

     

    now , i want to make a script with cirrus audio logic card , I mean  i want to start recording audio after 5 minutes when the raspberry system start.

     

    i mean,

    1) the raspberry start and boot the OS

    2)after 5 minutes automatically start recording audio or execute this instruccion (arecord -f S16_LE  -c 2 -d 300 -D hw:sndrpiwsp -r 192000 /tmp/s.wav)

    3)finish the process

    please help me!!

     

    Please help!!! , i dont have time

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 10 years ago in reply to e14 Contributor

    Diego

     

    You need a shell script like this:

     

    #!/bin/bash

    # Enable the Cirrus for recording

    /home/pi/Record_from_lineIn.sh

    # Wait 5 minutes

    sleep 5m

    [ record command ]

    [ whatever comes next ]

     

    Save it as an executable script ( say /home/pi/delayrecord )

    Add a line to /etc/rc.local to invoke it asynchronously on startup

     

    . . .

    /home/pi/delayrecord &

    . . .

     

    Cheers -- Ross

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 10 years ago in reply to e14 Contributor

    So I am able to set the Cirrus to default by editing the hidden file ~/.asoundrc with

     

    The file exists as follows:

     

    pcm.!default {

         type hw

         card 1

    }

     

    ctl.!default {

         type hw

         card 1

    }

     

    If I change the 1s to 0s it sets my card as the default.

     

    However, on reboot, the file reverts back to this state.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 10 years ago

    Hello Ragner,

    I have lit up my LED using raspberry pi 2 but when I use the GPIO located at the expansion header of the cirrus logic audio card I am unable to do so. If anyone can help I'll be really grateful.

    • 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.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube