element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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 and Raspberry Pi 3
  • 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 37 replies
  • Subscribers 669 subscribers
  • Views 4442 views
  • Users 0 members are here
  • rpi3
  • raspberry_pi
  • raspeberry_pi_accessories
  • raspberry pi 3
  • local build
Related

Cirrus Logic Audio Card and Raspberry Pi 3

boga
boga over 9 years ago

Hi!

 

Main idea of starting this discussion is that if anyone has a working setup with Raspberry Pi 3 then it would be nice if you could share the image. Or the instructions to get the Cirrus Logic Audio card working with Raspberry Pi 3.

 

I tried 2 different methods and no luck so far. I must say that I am a hardware guy and do not know too much about programming and linux. Trying to educate myself though.

 

Here is what I have tried.

 

1. I downloaded the ready made all-in-one package from element14 Cirrus Logic Audio Card page and installed the image using Win32DiskImager. When I tried to boot the Raspberry Pi 3 was just showing the Rainbow Screen and nothing was happening. Therefore the system was stuck and not booting at all. I did not investigate it further thinking that probably the ready made image doesn't work for RPi3.

 

2.  The second time I installed the latest Raspbian image. Tested that it was working on RPi 3. Then followed the official instruction on CirrusLogic wiki page https://github.com/CirrusLogic/rpi-linux/wiki/Building-the-code .  I used local build as I don't have Linux installed on my PC (yet!). Thought that maybe these will work for RPi3 also if I compile the kernel in the machine itself.

Unfortunately no luck. The RPi3 starts to boot but then hangs at a line which says: random: nonblocking pool is initialized. Which can basically mean anything according to my research. Of course I didn't give up so fast. I tried all kinds of different things according to the hints that I found by Googling. But I do not think they are worth mentioning here.

 

So. I would be really happy if someone who knows more about linux and programming could look into it and share the information if he / she gets Cirrus Logic Audio Card working with RPi3.

Of course all kind of suggestions about the described situation are also welcome.

 

All the best

  • Sign in to reply
  • Cancel
Parents
  • bulcan10
    bulcan10 over 9 years ago

    Hello Juri,

     

    I experienced the same problem with Pi 3, step 1. I did not try step 2. Even though, I noticed that the Download file on this website has been recently updated, the UI looks different. The Cirrus Logic Audio card and this software works on Pi 1 Model A+ board. I also tested the previous ver of the OS on Pi 2 Model B and also worked great.

     

    Hopefully, the manufacturer will release a new embedded OS that works with Pi 3.

     

    Best

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • ghg001
    ghg001 over 8 years ago in reply to bulcan10

    I bought a Raspberry Pi 3, I bought a Cirrus Logic audio card, I downloaded the suggested image, I installed the image on my SD card (Win32DiskImager), installed my SD card and booted the Raspberry Pi and...  and...   freezes before it even boots up.  I've tried various combinations of SD cards, two different Raspberry Pi 3s, different "suggested" images, still freezes - every time - but ONLY with the Cirrus Logic sound card installed while trying to use a Cirrus Logic image..

     

    I see ALL the threads above and I would just like to get this running without all the programming hassles.  I'm not a Linux guru or even well versed.  Is there a new Raspian image that really works with the Cirrus Logic card and the Raspberry Pi 3 or did I just buy a decorative sound card (for the moment)?   Sorry, I'm getting grumpy having to always fix "new" things lately that do not work.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • royleith
    royleith over 8 years ago in reply to ghg001

    Hi Greg,

     

    All you need is pointed to in the above thread.

     

    However, here is the unscary version.

     

    Download and install the latest version of Raspbian (there is no point using NOOBS if you are going to end up with Raspbian, anyway). Get it the way you want it (perhaps the 'Task Bar' (aka, Panel) along the bottom and larger text on the desktop). I suggest you add Terminal to the Application Launcher in Panel.

     

    Go to RPi Linux driver for Wolfson / Cirrus Logic Audio Card

    On that site, go to the Precompiled Versions section.

    Download the latest precompiled kernel into your Pi somewhere.

     

    Use the File Manager and browse to the place where you saved it. In File Manager, go to the Tools menu and 'Open Current Folder in Terminal'.

    Copy the installation line from the website and paste it into Terminal. Push enter.

     

    (The line you want is something like; sudo tar zxf cirrus-linux-4.4.14.tgz -C /)

     

    Once the script has done its thing, you need to add a text file and edit another. They are 'system' files and are protected from the likes of users. Type,

    sudo leafpad

    into Terminal and that will launch a version of leafpad that wll let you change system text files and create new ones.

     

    Open /boot/config.txt with the sudo version of leafpad, go to Configuration on the web page and copy and paste the additional line.

    Copy and paste the lines from the web-site into a new file created with the sudo version of leafpad and save it as /etc/modprobe.d/cirrus.conf.

     

    It should all be working after a reboot.

     

    I admit I have yet to do it with my Raspi 3 B because I have been waiting for a new case, but it worked fine for two Raspi 1 Bs.

     

    Look at the website for the scripts. They can get you started.

     

    The card now appears correctly in Preferences/'Audio Device Settings'. However, I wrote a proper mixer and switcher for earlier Raspbians that makes using the card more intuitive.

    Unfortunately, some of the driver cammands have changed. Give me some time and I will update the program and re-publish it. I would like to add the cool hardware

    features like equalisers, gates and filters, but that will take a lot more programming.

     

    In the interim, once you have got to grips with the input and output ports and the labels that the driver gives them, you can use alsamixer (just type alsamixer into Terminal) .

    You can set all the volumes, mutes and connections within this program. You can patch in equalisers, filters and gates as well. Use the downloaded scripts to

    give you a clue on what needs to be set. Use F6 to switch from the Broadcom sound to the card (snd_rpi_wsp).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • royleith
    royleith over 8 years ago in reply to royleith

    As promised, I have updated my mixer program. I can also report that installing the pre-compiled kernel from

    RPi Linux driver for Wolfson / Cirrus Logic Audio Card

    works just fine on my Raspberry Pi 3 B.

     

    This is what the mixer looks like.

    image

     

    You can get all the files by pointing File Manager to the folder in which you want the files downloaded, going to 'Tools/Open Current Folder ' in Terminal and pasting the following line into Terminal.

     

    git clone https://github.com/royleith/wolfmixer.git

     

    The files will be downloaded into a 'Wolfmixer' sub-folder.

     

    README.txt has all the instructions on where to copy the (Python) programs to, what to do with the desktop files and how to get the programs into the Application Menu and on to the Panel.

     

    When using the Pi 3 with its internal WiFi, the WiFi should be turned off when using BlueTooth to send your Cirrus card output to a BlueTooth player. Included in the files is a GUI program to turn WiFi off and on.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • cwbeacon
    cwbeacon over 8 years ago in reply to royleith

    I want to thank you for all your work getting this to run.  I got it all running on my Raspberry Pi 3 including your mixer.  But then I screwed something up with the mixer.  After a reboot when I try to run the mixer I get the following keyerror:

     

    File "wolfmixer.py", line 419, in <module>

       lineoutvar.set(statusquopatch(patchname))

    File "wolfmixer.py", line 367, in statusquopatch

       Rvalue = InputPortsID[para]

    Keyerror: '16'

     

    Thinking I had somehow messed up the python file I pulled down you files again.  Same error.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • royleith
    royleith over 8 years ago in reply to cwbeacon

    @Mike,

     

    The mixer program uses the Python os module to issue command line entries to the program 'amixer'.

     

    The first thing the mixer does before setting up the GUI controls is to ask the amixer program for the current settings stored in Raspbian for each control. Python goes through a list of all the control and switch parameters asking for the 'status quo' setting.

     

    In your case, the program is asking amixer for the first existing setting in the Python list (lineout) and getting a rude reply.

     

    Since you have reloaded the mixer program, the problem is almost certainly due to amixer not giving a sensible reply to the command:

     

    amixer -Dhw:sndrpiwsp cget name='HPOUT2L Input 1'

     

    If you look at the 'usecase' scripts from Cirrus Logic, you will see that they also use amixer to set up patches and set levels and switches.

     

    The mixer command is asking amixer to check the sound device sndrpiwsp (the Cirrus Logic card) and ask for the current setting of the control HPOUT2L Input 1. (Each of the outputs has four input ports. Wolfmixer only uses the first port called Input 1).

     

    I suggest the following. Boot the Raspi and type alsamixer into Terminal. This will give you a character-mode control panel for all available audio controls. Use Function key F6 and this will give you a pull-down list of all available audio devices. If you do not see sndrpiwsp listed, then the audio driver is failing to load. I think that this is the actual problem. Check all the lines in config.txt et al to make sure the important lines have not been overwritten and make sure that the driver overlay file is still in the sub-folder.

     

    If it does appear in alsamixer, select it and use the cursor keys to move along the hundreds of controls until you find HPOUT2L Input 1 and make a note of what value you see. Please note that Wolfmixer does not display the same control values that you see in alsamixer.

     

    Then copy and paste the line,

     

    amixer -Dhw:sndrpiwsp cget name='HPOUT2L Input 1'

     

    into Terminal and see what is returned. If it does not seem to make sense, then that is what is upsetting wolfmixer.

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • cwbeacon
    cwbeacon over 8 years ago in reply to royleith

    Thank you for your response.  The Cirrus card is still working and I can use alsamixer to set the audio.   F6 returns the Cirrus card (0  snd_rpi_wso).  I disabled the built in audio on the Pi so I only show the Cirrus card.

    Looking in alsamixer  for HPOUT2L I find it connected to IN3L which is Line-In.  I hear Line-In audio out the Line-out jack.  I have MPD running so if I start that player and change HPOUT2L to AIF1RX1 I hear the mp3 files playing.  So the card and alsamixer is working.

     

    Running the command;  amixer -Dhw:sndrpiwsp cget name='HPOUT2L Input 1'  returns 104 items. The last line reads " : values=16".  That list looks the same as the items I get if I arrow up and down in Alsamixer.

     

    I think what I will do is go back to my original clean image and run through the setup again.  I am using the 4.4.14 kernel that I got from the horus.com site for the cirrus card.  Run through the setup again and see if it fails after a fresh install.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • cwbeacon
    cwbeacon over 8 years ago in reply to royleith

    Thank you for your response.  The Cirrus card is still working and I can use alsamixer to set the audio.   F6 returns the Cirrus card (0  snd_rpi_wso).  I disabled the built in audio on the Pi so I only show the Cirrus card.

    Looking in alsamixer  for HPOUT2L I find it connected to IN3L which is Line-In.  I hear Line-In audio out the Line-out jack.  I have MPD running so if I start that player and change HPOUT2L to AIF1RX1 I hear the mp3 files playing.  So the card and alsamixer is working.

     

    Running the command;  amixer -Dhw:sndrpiwsp cget name='HPOUT2L Input 1'  returns 104 items. The last line reads " : values=16".  That list looks the same as the items I get if I arrow up and down in Alsamixer.

     

    I think what I will do is go back to my original clean image and run through the setup again.  I am using the 4.4.14 kernel that I got from the horus.com site for the cirrus card.  Run through the setup again and see if it fails after a fresh install.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • royleith
    royleith over 8 years ago in reply to cwbeacon

    @Mike,

     

    Hold on before doing anything drastic. amixer is working just fine and so is the driver.  The output you mention starts with,

     

    pi@raspberrypi:~ $ amixer -Dhw:sndrpiwsp cget name='HPOUT2L Input 1'

    numid=421,iface=MIXER,name='HPOUT2L Input 1'

      ; type=ENUMERATED,access=rw------,values=1,items=104

      ; Item #0 'None'

      ; Item #1 'Tone Generator 1'

      ; Item #2 'Tone Generator 2'

      ; Item #3 'Haptics'

     

     

    and ends with,

     

    ; Item #101 'ISRC3DEC2'

      ; Item #102 'ISRC3DEC3'

      ; Item #103 'ISRC3DEC4'

      : values=16

     

    amixer has enumerated (listed) all the possible patches and ends by telling you that patch No. 16 is currently selected. If you look down the list, No. 16 is AIF1RX1; the output from the Raspberry Pi to the sound card. It tells you that the Raspberry Pi is playing via Line Out and that is exactly what you selected in alsamixer (or the usecase script).

     

    If you look at the error report from wolfmixer, you will see that it is returning,

    Keyerror: '16'

     

    In other words, it is receiving the InputPortsID, correctly, as 16, but it is not setting the mixer to reflect that value.

     

    I ran wolfmixer on my Pi 3 and selected 'Play' as the input to Line Out (aka, AIF1RX1 connected to HPOUT2L Input 1) and got the same amixer result that you did.

     

    I see that you disabled the Pi audio. This is the only difference that I can see between your Pi 3 and my Pi 3 and two Pi 1s. Did you do that with  /etc/asound.conf containing,

     

    pcm.!default {
    type hw card 0
    }
    ctl.!default {
    type hw card 0
    }

     

    Let me know what you did to disable on-board sound and I will see what effect it has on the wolfmixer code.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • royleith
    royleith over 8 years ago in reply to cwbeacon

    Mike,

     

    Something else you might like to do:

     

    Choose Preferences/Audio Device Settings in the Main Menu and select the snd_rpi_wsp device if it is not already selected. Click on 'Select Controls' and you will be able to add faders, input selectors and switches to the panel. You might need to do a bit of head-scratching to work out which controls you actually need, but it should result in a workable mixer. Output volume from the Pi has to be set in the audio application.

     

    I have not done it, myself, but you should be able to set up Record controls in addition to Playback controls. However, programs like the excellent Audacity are able to do most of what you want within the program itself.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • cwbeacon
    cwbeacon over 8 years ago in reply to royleith

    No, I disabled the on-board audio in /boot/config.txt

    Commented out the last two lines:

    # Enable audio (loads snd_bcm2835)
    #dtparam=audio=on
    #enable_uart=1

     

    I put the lines back the way they were so both cards show up in alsamixer again.  Rebooted, but no change.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • royleith
    royleith over 8 years ago in reply to cwbeacon

    Hi Mike,

     

    I don't think the enable_uart has much bearing.

     

    Here is my config.txt. Try booting with it (it forces HDMI 1080p).

     

    # For more options and information see

    # http://www.raspberrypi.org/documentation/configuration/config-txt.md

    # Some settings may impact device functionality. See link above for details

     

     

    # uncomment if you get no picture on HDMI for a default "safe" mode

    #hdmi_safe=1

     

     

    # uncomment this if your display has a black border of unused pixels visible

    # and your display can output without overscan

    disable_overscan=1

     

     

    # uncomment the following to adjust overscan. Use positive numbers if console

    # goes off screen, and negative if there is too much border

    #overscan_left=16

    #overscan_right=16

    #overscan_top=16

    #overscan_bottom=16

     

     

    # uncomment to force a console size. By default it will be display's size minus

    # overscan.

    #framebuffer_width=1280

    #framebuffer_height=720

     

     

    # uncomment if hdmi display is not detected and composite is being output

    #hdmi_force_hotplug=1

     

     

    # uncomment to force a specific HDMI mode (this will force VGA)

    #hdmi_group=1

    #hdmi_mode=1

     

     

    # uncomment to force a HDMI mode rather than DVI. This can make audio work in

    # DMT (computer monitor) modes

    #hdmi_drive=2

     

     

    # uncomment to increase signal to HDMI, if you have interference, blanking, or

    # no display

    config_hdmi_boost=4

     

     

    # uncomment for composite PAL

    #sdtv_mode=2

     

     

    #uncomment to overclock the arm. 700 MHz is the default.

    #arm_freq=800

     

     

    # Uncomment some or all of these to enable the optional hardware interfaces

    #dtparam=i2c_arm=on

    #dtparam=i2s=on

    #dtparam=spi=on

     

     

    # Uncomment this to enable the lirc-rpi module

    #dtoverlay=lirc-rpi

    dtoverlay=rpi-cirrus-wm5102

    dtoverlay=i2s-mmap

     

     

     

     

    # Additional overlays and parameters are documented /boot/overlays/README

     

     

    # Enable audio (loads snd_bcm2835)

    dtparam=audio=on

    If that does not work, download wolfmixer from github again and navigate to the download folder, open a Terminal in the folder and see if,

     

    python wolfmixer.py

     

    works. Please remember, if you are clicking on the launch icon for wolfmixer it always runs  python /home/pi/Programs/Wolfmixer/wolfmixer.py and not the replacement you download.

     

    I'm sure that this is something simple. It does seem to be wolfmixer that is failing and not the rest of the system.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • cwbeacon
    cwbeacon over 8 years ago in reply to royleith

    I got the same results.  In the process of working on this I must have deleted or installed something that is causing the conflict.  I should go back to the clean o/s image and repeat the steps and see if, or where, it fails.

     

    I noticed today in the Element 14 store that they list the Cirrus Logic Audio Card as discontinued.  That is unfortunate if it is true.  That was a nice card that fit on the Raspberry Pi.  I have heard there are USB audio cards that work with the Pi.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • royleith
    royleith over 8 years ago in reply to cwbeacon

    Hi Mike,

     

    Sorry for the delay in replying. My phone line is down and now I know the disadvantages of internet controlled central heating!

     

    It looks like you will have to go back and start from scratch. I suggest that you do not disable any audio features in case that causes the problem. Right-clicking on the loudspeaker allows you to use HDMI, on-board analogue, the Cirrus card, BlueTooth or USB audio.

     

    Any Raspi will work with a mains-powered USB audio device. I have used an Alesis Multimixer which is an 8-Channel mixer with a stereo USB connection to a computer and supports phantom powered condenser microphones, line inputs and instrument inputs.

     

    Only my Raspi 3 B works with the USB-powered Focusrite Scarlet 2i4 interface which supports MIDI, phantom powered microphones, line inputs and instrument inputs. It is strictly a two-channel device.

     

    The problem with 'non-professional' USB audio interfaces is the failure to support Line In. The ones I have tried only support the recording of a mono, electret microphone or, at best, two of them.

     

    I managed to take my Wolfson card (the Cirrus Logic predecessor) in a Raspi B V1 to a pub and connect it to a mobile phone charger battery. I used it to record speech with Audacity via one of the two on-board microphones, edit it with Audacity and burn it as multiple mp3 files on an audio CD. The 15.6" HDMI HD monitor, DVD burner, Raspi and everything else were all run off of the charger.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • cwbeacon
    cwbeacon over 8 years ago in reply to royleith

    Hi Roy,

     

    I plugged in an M-audio Fast Track Pro I had on a PC to the Pi.  It did recognize it (F6 in the mixer).  No controls were available so at most it might play a file from the Pi.  I did not make any attempt to go further with that unit.  I got tied up with other projects so I have not had a chance to re-build the Pi.  Hope to get back to it in a week or so. 

     

    Mike

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • royleith
    royleith over 8 years ago in reply to cwbeacon

    Hi Mike,

     

    I knew I should have mentioned that only standards compliant interfaces work with Linux.

     

    That was one of the main reasons for choosing the Multimix mixer and the Focusrite audio interface.

     

    M-Audio have a bit of a reputation for needing special drivers for their kit.

    • 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