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

    Could you send an MD5 check-sum of the Google doc file? I get all kinds of boot errors (device not ready, etc) and it does not finishes booting.

     

    For "2015-02-16-raspbian-wheezyW_CL.img" I have 43e14299121e873660883f06a6560b00

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

    Your 43e14299121e873660883f06a6560b00  md5 sum is correct.

    --

    Ragnar

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

    I did get it working, had an issue with Win32DiskImage dismounting the SD card. All is well and I am recording audio.

    Thank you so much for this.

     

    Still very disappointed with vendor for selling me a solution they knew did not work. RPi 2 + Cirrus board.

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

    Ragnar:

    Success!!! On my RPI2, I had to use this kernel=kernel7_CL.img, otherwise, it would not boot.  After installing MPC and MPD, and withing MPD, I had left the default for audio output.  By your kernel works 100%!!!!! Thank you.

     

    Ahmed

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

    Ragnar,

     

    the kernel you compile from the CL repository works perfectly with RuneAudio 0.4

    If somebody is interested, just need to blacklist the module snd_bcm2835 with something like this:

     

    echo "blacklist snd_bcm2835" >> /etc/modprobe.d/blacklist.conf


    and reboot to be sure the CL card is the default one.


    Then, manually config the wifi (wifi-menu, and manually editing the wpa-supplicant) 'cause there is a bug in RA v0.4, and enjoy ! image

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

    That really sounds great!

    does this also work with the older Rasoberry Pis and the older Wolfson card?

     

    Thanks, Thomas

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

    Yes, it works with the older cards too.

    --

    Ragnar

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

    Hi Ragnar,

    so far so good, I've tested it with an old Pi and an old card. aplay -l gives:

     

    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

     

    It seems the card is loaded correctly, but I can't get any sound out of it. Alsamixer is showing a lot of output options, umuting some of the does not help! I like to use the headphone out!

     

    Any suggestions?

     

    Thanks a lot, Thomas

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

    Sorry,

    /home/pi/use_case_scripts./Playback_to_Headset.sh

     

    Did the trick!

     

    All running, great! Thanks a lot!

     

    Thomas

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

    Sorry,

    /home/pi/use_case_scripts./Playback_to_Headset.sh

     

    Did the trick!

     

    All running, great! Thanks a lot!

     

    Thomas

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

    One additional question:

     

    If i like to activate a sound output, it is only necessary to run one of the use case scripts once, right! If I run all use case scripts once, are all output devices enabled then, or can only one output be activated at the same time?

     

    Thanks, Thomas

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

    If i like to activate a sound output, it is only necessary to run one of the use case scripts once, right?

    Yes.

    If I run all use case scripts once, are all output devices enabled then?

    Yes.

     

    Furthermore, on Raspbian, the state of the sound card(s) is saved at shutdown and restored at boot by the /etc/init.d/alsa-utils script.

    --

    Ragnar

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

    Hi Ragnar,

    perfect! Thanks a lot for your quick answer! So I have only to wait for my new Wolfson card to see if everything is working with the new card and the Pi 2. If yes, I'll support the Wolfson card in SqueezePlug soon!

     

    Thanks, Thomas

     

    P.S.: Do you have a hint for the right output level for headphone and lineout? I saw that the output level is very high, compared with other devices like HiFiBerry. And how to set the right values with a  shell command?

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

    Yes, the levels are hot. The reference level for 0 dB on Line Out is 0 dBV (1V RMS), whereas most consumer gear is -10 dBV (0.316 V RMS).

    This script is what I use most of the time to initialize the outputs. It's just the three standard "Playback_to..." scripts copy-and-pasted together.

     

    #!/bin/bash
    
    #Playback from RPi to Headset
    amixer -q -Dhw:sndrpiwsp cset name='HPOUT1 Digital Switch' on
    # Set path gain to -6dB for safety. ie max 0.5Vrms output level.
    amixer -q -Dhw:sndrpiwsp cset name='HPOUT1 Digital Volume' 116 # 96=-16dB. Volume control in 0.5 dB steps, -64dB to +32dB. Valid values 0-191. 128=0dB.
    amixer -q -Dhw:sndrpiwsp cset name='HPOUT1L Input 1' AIF1RX1
    amixer -q -Dhw:sndrpiwsp cset name='HPOUT1L Input 1 Volume' 32 # Input gain in 1 dB steps. -32dB to +12dB. Valid values 0-48. 32=0dB.
    amixer -q -Dhw:sndrpiwsp cset name='HPOUT1R Input 1' AIF1RX2
    amixer -q -Dhw:sndrpiwsp cset name='HPOUT1R Input 1 Volume' 32
    
    
    #Playback from RPi to LineOut
    amixer -q -Dhw:sndrpiwsp cset name='HPOUT2 Digital Switch' on
    amixer -q -Dhw:sndrpiwsp cset name='HPOUT2 Digital Volume' 128 # 108 = -10dB
    amixer -q -Dhw:sndrpiwsp cset name='HPOUT2L Input 1' AIF1RX1
    amixer -q -Dhw:sndrpiwsp cset name='HPOUT2L Input 1 Volume' 32
    amixer -q -Dhw:sndrpiwsp cset name='HPOUT2R Input 1' AIF1RX2
    amixer -q -Dhw:sndrpiwsp cset name='HPOUT2R Input 1 Volume' 32
    
    #SPDIF Playback: 
    
    amixer -q -Dhw:sndrpiwsp cset name='SPDIF out Switch' on
    amixer -q -Dhw:sndrpiwsp cset name='Input Source' AIF
    amixer -q -Dhw:sndrpiwsp cset name='AIF2TX1 Input 1' AIF1RX1
    amixer -q -Dhw:sndrpiwsp cset name='AIF2TX1 Input 1 Volume' 32 # 22 = -10dB
    amixer -q -Dhw:sndrpiwsp cset name='AIF2TX2 Input 1' AIF1RX2
    amixer -q -Dhw:sndrpiwsp cset name='AIF2TX2 Input 1 Volume' 32 # 22 = -10dB

    It sets Line Out and S/PDIF Out to 0 dB, i.e no amplification nor attenuation. The rationale here is that those outputs are connected to devices which have their own volume controls. Also, my analog gear is professional stuff that can take even hotter signals.

    Headset Out is set to -6 dB, to avoid ear-shattering surprises. The actual sound level I get varies a lot depending on which headphones I use. In modern ones it's still a bit too loud for my taste, but in my old 600-ohm favorites, it's just right.

     

    So, my hint would be to take the above script and edit it to decrease levels with 10 dB on lines 6 and 15. Then, I think you'll have a good starting point.

    As you can see, the magic command to set levels is amixer using its cset option.

    --

    Ragnar

    • 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