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 New reworked driver for Wolfson/Cirrus Logic audio card
  • 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 390 replies
  • Subscribers 767 subscribers
  • Views 50282 views
  • Users 0 members are here
  • raspberry_pi
  • raspeberry_pi_accessories
Related

New reworked driver for Wolfson/Cirrus Logic audio card

hiassoft
hiassoft over 9 years ago

I've been working on a driver rework, mainly to get rid of the requirement to carry around a bunch of patches to upstream driver code, and also to fix some outstanding issues and introduce some new features.

 

Most issues have been ironed out so here's the first public release.

 

Edit: the driver has been included in official RPi kernels. Just run sudo rpi-update to install it.

You still have to install the mixer scripts and add the /etc/modprobe.d file. See my website for details

RPi Linux driver for Wolfson / Cirrus Logic Audio Card

 

Source: https://github.com/HiassofT/rpi-linux/tree/cirrus-ng-4.9.0

Precompiled kernel: http://www.horus.com/~hias/tmp/cirrus/cirrus-ng-linux-4.9.0.tgz

New mixer scripts: http://www.horus.com/~hias/tmp/cirrus/cirrus-ng-scripts.tgz

 

Important notes:

  • The new driver bases on the rather fresh kernel 4.9.0 which means there's some risk of (yet unknown) issues. Use it at your own risk and please run "rpi-update" to get the latest firmware before installing the new driver.
  • The soundcard name has been changed from "snd_rpi_wsp" to "RPi-Cirrus", also several ALSA controls have been removed and new ones were added. This means the old usecase scripts and any custom-made scripts will no longer work. Use the new mixer scripts instead of the old usecase/listen scripts.
  • The new driver supports setting (and receiving) of the S/PDIF channel status bits (aka AES bits). If you add an ALSA card configuration file this means applications like Kodi can do proper AC3/DTS passthrough. A sample card configuration file (plus the mixer scripts) can be found here: https://github.com/HiassofT/rpi-cirrus-config
  • I haven't fully updated the documentation on my website RPi Linux driver for Wolfson / Cirrus Logic Audio Card  yet, will do that during the next weeks/months. But except for the things noted above most stuff should still work as in previous driver versions.

 

Please report back if you tested the driver (either successfully or unsuccessfully), any feedback will help me!

 

so long,

 

Hias

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

    So I'm confused.  I looked at your website RPi Linux driver for Wolfson / Cirrus Logic Audio Card   which said to use one of the precompiled kernals, I downloaded cirrus-linux-4.4.14.tgz, ran sudo tar zxf cirrus-linux-4.4.14.tgz -C / and got an error saying the file could not be opened.  The file was downloaded into "Downloads".  I tried it from Downloads, and got no errors.  I made the other reconfiguration changes you mentioned, and restarted, but Alsamixer doesn't recognize the Cirrus Card. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • phxang
    phxang over 9 years ago in reply to kjciszewski

    1. Download https://github.com/HiassofT/rpi-linux

    2. unpack

    3. open terminal and cd into folder

    4. enter next commands to configure kernel

        a) if you have RPi1:

              KERNEL=kernel

              make bcmrpi_defconfig

        b) if you have RPi2/3

              KERNEL=kernel7

              make bcm2709_defconfig

    5. compile by entering commands:

    make -j4 zImage modules dtbs

    sudo make modules_install

    sudo cp arch/arm/boot/dts/*.dtb /boot/

    sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/

    sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/

    sudo scripts/mkknlimg arch/arm/boot/zImage /boot/$KERNEL.img

    Note: On a Raspberry Pi 2/3, the -j4 flag splits the work between all four cores, speeding up compilation significantly. If you have 1 core do not input -j4. After commands make -j4 zImage modules dtbs it takes long time to compile.

    6. Reboot.

    7. Download https://www.element14.com/community/external-link.jspa?url=http%3A%2F%2Fwww.horus.com%2F%7Ehias%2Ftmp%2Fcirrus%2Fcirrus-…

    8. Extract mixer scripts and from terminal:

    ./Reset_paths.sh -q

    ./Playback_to_Lineout.sh -q

    ./Record_from_DMIC.sh -q

    In that case audio output from GREEN jack. Audio input from two microphones from card.

    9. Disable RPi on-board audio device snd-bcm2835

    disable it by removing (or commenting out) the dtparam=audio=on line from /boot/config.txt.

    #dtparam=audio=on

    10. Future updates without loss of sound:

    sudo apt-mark hold raspberrypi-bootloader raspberrypi-kernel

    11. And when you need update GPU firmare: sudo SKIP_KERNEL=1 rpi-update

    12. Start Chromium with --no-sandbox option, like: chromium-browser --no-sandbox.

    13. Set up PulseAudio to prevent difficult questions.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • lappen
    lappen over 9 years ago in reply to phxang

    Hey,

    thanks for the short set of commands but my rasp 3 fail at

     

    make -j4 zImage modules dtbs

     

    DTCO    arch/arm/boot/dts/overlays/midi-uart0.dtbo
    arch/arm/boot/dts/overlays/midi-uart0-overlay.dts:4:39: fatal error: dt-bindings/clock/bcm2835.h: Datei oder Verzeichnis nicht gefunden
    #include <dt-bindings/clock/bcm2835.h>

     

    Have someone a hint?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • hiassoft
    hiassoft over 9 years ago in reply to lappen

    thanks for the short set of commands but my rasp 3 fail at

     

    make -j4 zImage modules dtbs

     

    + expand sourceview plain
    1. DTCOarch/arm/boot/dts/overlays/midi-uart0.dtbo
    2. arch/arm/boot/dts/overlays/midi-uart0-overlay.dts:4:39:fatalerror:dt-bindings/clock/bcm2835.h:DateioderVerzeichnisnichtgefunden
    3. #include<dt-bindings/clock/bcm2835.h>

     

    Have someone a hint?

    Better don't use the ZIP download from github, this is known to cause problems. If you want to compile from source use git clone

    git clone --depth 1 https://github.com/HiassofT/rpi-linux

     

    Just tested this on RPi3 and "make bcm2709_defconfig", "make dtbs" worked fine.

     

    so long,

     

    Hias

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • lappen
    lappen over 9 years ago in reply to hiassoft

    Thanks for the fast reply.

    Now it compile, but the Reboot fail. Is there a chance to find the Problem or I have to set OSMC new?

     

    Edit:

    So I try to install the driver several times with OSMC 12.2016 and cirrus driver 4.9.0 and 4.4.14.

    Everytime the same. After a reboot OSMC surface can't start. Over SSH I have connection the Kernel is refresht to 4.9.0 and aplay -l say the driver is installed. I think the file system is corrupted because I can't do sudo apt-get update or install something after install cirrus driver. I found the system is in read only mode and boot is corrupted.

    So I try:

    fsck -y /boot

    but no improvement. Have Some a Idea what I do wrong at installation?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • hiassoft
    hiassoft over 9 years ago in reply to lappen

    I'm not familiar with OSMC but you could try looking in /var/log/syslog and/or the outputs of "dmesg", "journalctl -a" and "systemctl status" to get some more info what failed.

     

    BTW: have you tried using a different SD card? If you see some filesystem corruption it could be caused by a defective card - this is happens quite often, unfortunately.

     

    so long,

     

    Hias

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • lappen
    lappen over 9 years ago in reply to hiassoft

    Thanks Hias for the commands to check.

    - $ cat /var/log/syslog is empty

    - $ dmesg is a to long for output but a Interessting Line is :

    2.126616] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.

    and

    2.920504] systemd[1]: Cannot add dependency job for unit display-manager.service, ignoring: Unit display-manager.service failed to load: No such file or directory.

    - $ systemctl status say: osmc    State: degraded ...

    - $ journalctl -a say: no jounal files found

     

    After that I found the command: $ systemctl list-units --failed

    Output:

    ● systemd-hostnamed.service   loaded failed failed Hostname Service

    ● systemd-random-seed.service loaded failed failed Load/Save Random Seed

    ● systemd-update-utmp.service loaded failed failed Update UTMP about System Boot/Shutdown

     

    Than I try to restart the Hostname with: $ sudo service systemd-hostnamed.service restart

    Output:

    Failed to restart systemd-hostnamed.service.service: Unit systemd-hostnamed.service.service failed to load: No such file or directory.

     

    and the status of the service ( $ sudo systemctl status  systemd-hostnamed.service ) say the Problem which we isolate at start:

     

    systemd-hostnamed.service - Hostname Service

       Loaded: loaded (/lib/systemd/system/systemd-hostnamed.service; static)

       Active: failed (Result: resources)

         Docs: man:systemd-hostnamed.service(8)

               man:hostname(5)

               man:machine-info(5)

               http://www.freedesktop.org/wiki/Software/systemd/hostnamed

     

    Jan 11 00:03:17 osmc systemd[1]: Starting Hostname Service...

    Jan 11 00:03:17 osmc systemd[1]: systemd-hostnamed.service failed to run 'start' task: Read-only file system

    Jan 11 00:03:17 osmc systemd[1]: Failed to start Hostname Service.

    Jan 11 00:03:17 osmc systemd[1]: Unit systemd-hostnamed.service entered failed state.

     

    The Filesystem is read only mounted. So I try allready a second sd card but with the same result.

    How can I prevent that the card mounted with read only?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • hiassoft
    hiassoft over 9 years ago in reply to lappen

    Jan 11 00:03:17 osmc systemd[1]: Starting Hostname Service...

    Jan 11 00:03:17 osmc systemd[1]: systemd-hostnamed.service failed to run 'start' task: Read-only file system

    Jan 11 00:03:17 osmc systemd[1]: Failed to start Hostname Service.

    Jan 11 00:03:17 osmc systemd[1]: Unit systemd-hostnamed.service entered failed state.

     

    The Filesystem is read only mounted. So I try allready a second sd card but with the same result.

    How can I prevent that the card mounted with read only?

    I had a quick look at the OSMC sources and it looks like it uses a custom kernel build with an initramfs to setup stuff immediately after boot.

    https://github.com/osmc/osmc/tree/master/package/kernel-osmc

     

    So simply swapping out the kernel won't work, you'd have to build your own kernel with the same setup like OSMC needs (initramfs etc), eg by adapting the OSMC kernel build to use the sources from my github repo.

     

    so long,

     

    Hias

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • lappen
    lappen over 9 years ago in reply to hiassoft

    Thanks for look in.

    How I have to do this. Must I bring the source code of osmc and yours together and compile it or can I Install osmc and modify yours with favorite osmc settings to recompile it. Sorry for the questions but rpi and kernel compilition is new for me.

    Thanks for the support.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • lappen
    lappen over 9 years ago in reply to hiassoft

    Thanks for look in.

    How I have to do this. Must I bring the source code of osmc and yours together and compile it or can I Install osmc and modify yours with favorite osmc settings to recompile it. Sorry for the questions but rpi and kernel compilition is new for me.

    Thanks for the support.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • hiassoft
    hiassoft over 9 years ago in reply to lappen

    How I have to do this. Must I bring the source code of osmc and yours together and compile it or can I Install osmc and modify yours with favorite osmc settings to recompile it. Sorry for the questions but rpi and kernel compilition is new for me.

    Thanks for the support.

    It depends. If the initrd is stored as a separate file and the kernel matches the configuration of OSMC's kernel it may be as simple as unpacking the initrd, replacing the kernel modules inside that with the updated ones from the precompiled kernel, repacking the initrd and copying it to /boot - similar to what I tested with volumio:

    Re: Driver fixes and updates to kernel 3.18.16 and 4.0.5

     

    If the initrd/initramfs is included in the kernel image or if OSMC needs some special kernel configs/patches it'll be a lot more complicated. Then you need to have a closer look at the OSMC build system, probably change a bunch of files/settings and recompile the kernel. If you never did this before this can be quite challenging and you'd better ask on the OSMC forums about the build system details.

     

    Or you can just use LibreELEC instead of OSMC, my LibreELEC builds work out of the box with the cirrus card

    https://forum.libreelec.tv/thread-3387.html

     

    so long,

     

    Hias

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • lappen
    lappen over 9 years ago in reply to hiassoft

    Hey, thanks for the reply.

    I have OpenElec already run without Problems but I want a little more functionality so I try OSMC. I think reconfigure the Kernel exceed my time quota at the moment. Thanks for the support.

     

    Regards

    • 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