1 6 7 8 9 10 162 Replies Latest reply on Sep 12, 2016 8:16 AM by xxsaschkoxx Go to original post
      • 105. Re: Cirrus Logic Audio Card working on the Raspberry Pi 2
        ragnar.jensen

        Hi J C!

         

        Yes, the .deb package works on the 2015-05-05 Raspbian image.

        You also need the overlay file and the use case scripts. It might be easiest to extract them from the tar file I mention in the second post of this thread.

         

        --

        Ragnar

        • 106. Re: Cirrus Logic Audio Card working on the Raspberry Pi 2
          jcjc

          Ragnar,

           

          > OK, I'm curious  What is it you're doing?

           

          It's a field audio recorder for long-term outdoor deployments,

          recording audio around the clock.  My motivation is

          environment/wildlife monitoring.  With a standard USB battery pack, a

          Raspberry Pi A+, and a Cirrus card, I can get over 5 days of constant

          16kHz recordings.  Bigger battery (car?) and bigger SD card, and you

          can grow the deployment time, of course.  Data is stored on the MMC SD

          card, on a bespoke partition (p3).

           

          I want to be able to provide users with an .img that requires no

          configuration at all - except perhaps some tailoring via a

          /boot/user.conf file, for things like volume and input source

          (DMIC/headset/line-in). Such a file is accessible (even on windows)

          once the card is flashed, so reasonably easy for non-technical users

          to handle.  ... And it all works with your .debs.  Fantastic.

           

          Encouragingly, it appears that even on systems _without_ a Cirrus card

          attached, your kernels boot and appear to work (I support USB

          microphones/dongles too for those who don't have a Cirrus card).  Is

          there any reason why this might be dangerous?  It looks like the code

          tries to initialize the non-existent Cirrus card a few times,

          "requests probe deferral" - then we hear no more from it.  From dmesg:

           


          [    6.094094] bcm2708_i2c 20804000.i2c: BSC1 Controller at 0x20804000 (irq 79) (baudrate 100000)
          [    6.427599] DC_1V8: 1800 mV 
          [    6.472201] DC_5V: 5000 mV 
          [    6.718453] bcm2708_spi 20204000.spi: master is unqueued, this is deprecated
          [    6.994185] LDO1: 1200  1800 mV at 1200 mV 
          [    7.105399] LDO1: supplied by DC_1V8
          [    7.210706] arizona spi0.1: Unknown device ID: 0
          [    7.327676] bcm2708_spi 20204000.spi: SPI Controller at 0x20204000 (irq 80)
          [    7.359934] usbcore: registered new interface driver snd-usb-audio
          [    7.442388] random: nonblocking pool is initialized
          [    9.135806] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered
          [    9.144719] snd-rpi-wsp sound: Failed to register card: -517
          [    9.152440] platform sound: Driver snd-rpi-wsp requests probe deferral
          [   11.134298] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered
          [   11.146184] snd-rpi-wsp sound: Failed to register card: -517
          [   11.154436] platform sound: Driver snd-rpi-wsp requests probe deferral
          [   11.701777] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
          [   12.358128] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
          [   15.247859] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered
          [   15.273573] snd-rpi-wsp sound: Failed to register card: -517
          [   15.289914] platform sound: Driver snd-rpi-wsp requests probe deferral
          [   17.375872] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered
          [   17.399127] snd-rpi-wsp sound: Failed to register card: -517
          [   17.411977] platform sound: Driver snd-rpi-wsp requests probe deferral
          
          

           

          Feels like it would be better, however, if one could probe for some

          indication of the presence of the Cirrus board - via i2c-tools? - and

          (if present) load kernel modules to support it.  But perhaps I

          shouldn't care...

           

          I aim to distribute only one O/S ".img", supporting both generations

          of Pi (arm7 and original), each capable of supporting the Cirrus Card

          (and not).  It seems that raspbian has the intelligence to work out -

          pre-booting - which stock kernel to boot (v7 or traditional) depending

          on the underlying Raspberry Pi hardware, and I hope to tweak those

          kernel pointers to point at the Cirrus-enabled kernels.  But I don't

          know if I'll succeed in working out how to do this.  I fear it's

          hiding in the non-open bits of the boot process (GPU firmware blob, or

          some such thing...).  Advice or pointers appreciated.

           

          FYI, I use the PiFace shim RTC clock (to time-stamp the audio

          recordings) in conjunction with the Cirrus Card, and it works fine,

          appearing as an i2c device as usual.  No conflicts as far as I can

          see.  It fits snugly under the Cirrus board.

           

          And that's that.  You did ask!

           

          Cheers,

           

          James.

          • 107. Re: Cirrus Logic Audio Card working on the Raspberry Pi 2
            ragnar.jensen

            Interesting project!

            Encouragingly, it appears that even on systems _without_ a Cirrus card

            attached, your kernels boot and appear to work (I support USB

            microphones/dongles too for those who don't have a Cirrus card).  Is

            there any reason why this might be dangerous?

            No.

            It looks like the code tries to initialize the non-existent Cirrus card a few times,

            "requests probe deferral" - then we hear no more from it.

             

            Feels like it would be better, however, if one could probe for some

            indication of the presence of the Cirrus board - via i2c-tools? - and

            (if present) load kernel modules to support it.  But perhaps I

            shouldn't care...

            I wouldn't care, because that's what the kernel already does.

            The device tree overlay file tells the kernel to load the driver for the Cirrus card. If the driver determines that there is no card, it just exits.

             

            It seems that raspbian has the intelligence to work out -

            pre-booting - which stock kernel to boot (v7 or traditional) depending

            on the underlying Raspberry Pi hardware, and I hope to tweak those

            kernel pointers to point at the Cirrus-enabled kernels.  But I don't

            know if I'll succeed in working out how to do this.

            Yes, the boot loader (the non-open blob) works out what hardware it is running on.

            If there is a "kernel=..." line in /boot/config.txt it will load that kernel.

            If no specific kernel is pointed out in /boot/config.txt, it will select kernel.img on older hardware and on the RPi2B it will select kernel7.img

            So, the easiest way is to install both deb packages, rename the kernel files to kernel.img and kernel7.img and make sure that no kernel is pointed out in config.txt.

            That's the approach I took on the Raspbian image in the very first post of this thread.

            --

            Ragnar

            • 108. Re: Cirrus Logic Audio Card working on the Raspberry Pi 2
              autostatic

              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

              • 109. Re: Cirrus Logic Audio Card working on the Raspberry Pi 2
                mkyle

                I tried, jeremy. it rendered my pi (temporarily) unusable after reboot. something must have gone wrong, I figure. this was a (quite fresh) 2015-05-05 image on a pi2.

                fortunately I have a spare sd card where I will put the clean image onto and see where I can find a difference.

                • 110. Re: Cirrus Logic Audio Card working on the Raspberry Pi 2
                  autostatic

                  Hi Markus, sorry about that. I already know what the cause is, working on it.

                  • 111. Re: Cirrus Logic Audio Card working on the Raspberry Pi 2
                    mkyle

                    jeremy, no problem. any quick hint for me to fix that manually while you prepare new debs? don't have access to the file system right now, though (I could, of course, boot the spare card and access the other via usb card reader).

                    • 112. Re: Cirrus Logic Audio Card working on the Raspberry Pi 2
                      autostatic

                      You will need to comment the

                      kernel=vmlinuz-3.18.9-cirrus

                      line in /boot/config.txt so that your RPi loads kernel7.img again. So you will need to access the file system.

                      • 113. Re: Cirrus Logic Audio Card working on the Raspberry Pi 2
                        mkyle

                        well, that part was easy. you can access it via the fat32 partition even in windows and modify that file. I was afraid I had to fiddle with the ext3 (or 4).

                        it's up again (could have figure myself, of course ), but thanks anyway! awaiting the updated packages now...

                         

                        -greetings, markus-

                        • 114. Re: Cirrus Logic Audio Card working on the Raspberry Pi 2
                          autostatic

                          Hi Markus, I've updated the packages. Thanks a lot for testing and providing feedback!

                          • 115. Re: Cirrus Logic Audio Card working on the Raspberry Pi 2
                            mkyle

                            the update went fine until it reached the point where the hardlink to the initrd bak file is supposed to be created. then it bails out.it booted fine after that, but I realized that this is the standard 3.18.11 kernel.

                            the package update does not comment the alternate kernel and overlay back in, so I did. but after that it doesn't boot again. any helping information I should provide?

                            • 116. Re: Cirrus Logic Audio Card working on the Raspberry Pi 2
                              autostatic

                              That shouldn't happen, I probably made a mistake somewhere. The problem

                              is that /boot lives on a FAT32 partition and apt/dpkg doesn't really

                              like that. I have to work a bit around that limitation and the solution

                              I'm using now is a bit hacky and apparently it doesn't work flawlessly

                              yet. If you could provide me with the warnings/error messages that'd be

                              great.

                               

                              Jeremy

                              • 117. Re: Cirrus Logic Audio Card working on the Raspberry Pi 2
                                mkyle

                                the hardlink creation fails with "permission denied" - it happens in /boot where the fat32 is mapped into, then. while the alternate kernel is commented in, you'll see colour gradient screen only. it doesn't even try to boot that kernel.

                                either there is some additional magic used to tell the pi to boot that specific kernel, or it just doesn't find it (as it recognises the vanilla kernel that obviously doesn't even have to be referenced in the config.txt).

                                • 118. Re: Cirrus Logic Audio Card working on the Raspberry Pi 2
                                  autostatic

                                  Found the problem and I'll fix it. The linux-cirrus-image package merrily does a rm -f *3.18.9*cirrus on install but should only do that on upgrade. Thanks again for the feedback.

                                  • 119. Re: Cirrus Logic Audio Card working on the Raspberry Pi 2
                                    hmaerki

                                    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

                                    1 6 7 8 9 10