1 2 3 4 382 Replies Latest reply on Apr 27, 2019 4:36 PM by richardash1981 Go to original post
      • 16. Re: New reworked driver for Wolfson/Cirrus Logic audio card
        hiassoft

        Hi Andrey!

        Can I boost DMIC sensitivity?

        Yes. You can change "IN2L Digital Volume" and "IN2R Digital Volume". By default these are set to 116 which is -6dB. Setting these to 128 would be 0dB (each step is 0.5dB). You can also set them to more than 128 - just try different values and see what works best.

         

        BTW: The purpose of the "usecase" mixer scripts is to give you a quick start, usually you'll have to tweak the settings (boost/attenuate signals, add/remove filters, use different routing etc). Remembering which input/output corresponds to which mixer can be hard, therefore I created a bunch of helper functions and definitions in rpi-cirrus-functions.sh to simplify that. Feel free to change that to your needs, modify it or use it in your own scripts.

         

        For example, the "Record_from_DMIC.sh" script calls the "record_from_dmic" function in rpi-cirrus-functions.sh. It looks like that:

        # args: [ VOLUME [ DIGITAL_VOLUME ] ]
        record_from_dmic() {
                reset_dmic_in
                reset_filter
                reset_rpi_in
        
                # default input gain 0dB and digital gain -6dB
                setup_dmic_in "${1:-0}" "${2:-116}"
        
                # route input through high pass filter to remove DC
                setup_high_pass_filter $dmic_in_signals
                set_mixer $rpi_in_signals $filter_signals
        }
        
        

         

        You can pass 2 additional arguments to that function, volume (which should be 0 when using DMIC) and the digital volume (eg 128). If these are not set, the default values 0 and 116 will be used when calling setup_dmic_in.

         

        If you want you can also remove the high-pass filter, drop the "set_high_pass_filter" line and change the set_mixer call below to "set_mixer $rpi_in_signals $dmic_in_signals" - then DMIC won't be routed through the high-pass filter but sent directly to the RPi audio input.

         

        If you want to mix multiple (analog) inputs into your output signal have a look at what "Cirrus_listen.sh" does, eg in the case of listening to DMIC on line-out:

         

        First it configures the DMIC input, like the record function:

        setup_dmic_in 0 116
        

        Then it sets the lineout volume to the default (128 means 0dB)

        mixer "${line_out} Digital Volume" 128
        

        and routes the input signal (in this case "$dmic_in_signals) to the specified input of the line-out mixer (default is 2):

        set_mixer $line_out_signals $dmic_in_signals 32 2
        

         

        Each mixer block inside the WM5102 has 4 inputs, the "Playback" scripts/functions use the first one, the listen scripts by default the second one, so if you like you can add 2 more signals (eg line-in and headset-in) to the remaining 2 mixer inputs.

         

        The "32" in the set_mixer call specifies the volume of the input. 32 is 0dB. Change it to your needs, for example to boost dmic-in or attenuate line-in.

         

        so long,

         

        Hias

        4 of 4 people found this helpful
        • 17. Re: New reworked driver for Wolfson/Cirrus Logic audio card
          kevin1313

          Has anyone reported issues with wifi connectivity/throughput with the 4.9.0 kernel? I am losing wifi ability to get to internet, remote into the RPi2 from a laptop, and lose streaming from minidlna server about every 5-30 minutes. It doesn't actually disconnect me from the router but it doesn't seem to let me access anything until I disconnect wifi and re-connect.

           

          I am running a Rasp Pi2 with the latest Jessie installed. I updated to Jessie before trying to compile the 4.9.0 kernel. The kernel update worked as the audio card was working, but shortly afterward I noticed the loss of wifi. I have read on internet about wifi connectivity issues with RPi and Jessie but with 12 hours to days between losing wifi. I am not getting that long of a span.

           

          I am still fairly new to the Rasp Pi/Linux. So this is most likely something I have messed up, but I was curious if anyone else had seen an issue with wifi?

           

          But after trying to isolate which software may be causing the issue by removing them, I finally went back to an image I had just before updating to 4.9.0 kernel. Wifi does not seem to be acting up.

           

          Thanks,

          Kevin

          • 18. Re: New reworked driver for Wolfson/Cirrus Logic audio card
            hiassoft

            Hi Kevin!

             

            I can't comment on the WIFI issues, I'm only using wired network with the RPi 3 here.

             

            But if you are having problems with kernel 4.9 it would be best to switch to the official RPi firmware (just to be sure), test with that and then report issues/regressions in the RPi kernel 4.9 thread https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=167934 - if there's some regression it'll hopefully be fixed soon and then I can pick up the fix in my Cirrus builds.

             

            If the issues are only present in my builds but not in the official RPi kernel please post about it here.

             

            To switch from the Cirrus kernel to the official one run the following 2 commands (the first one forces rpi-update to "forget" about the currently installed kernel, overwriting the kernel with the Cirrus build doesn't play nice with rpi-update and it may think the latest version is already installed - if /boot/.firmware_revision is removed it'll start from scratch and get the latest official revision)

            sudo rm /boot/.firmware_revision
            sudo BRANCH=next rpi-update
            

             

            Once you are finished with testing you can just reinstall the Cirrus kernel (re-run the sudo tar zxf ... command).

             

            so long,

             

            Hias

            1 of 1 people found this helpful
            • 19. Re: New reworked driver for Wolfson/Cirrus Logic audio card
              kevin1313

              So use the pre-compiled kernels? I have been compiling them but that takes a little over 3 hours.

               

              That was a quick response! Thanks.

               

              I will let you know how things go.

               

              Kevin

              • 20. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                kevin1313

                Well when I went back to the official kernel, the wifi issue went away as far as I can tell but of course the audio card no longer works either. It will be hard for me to explain the issues I see when using the new 4.9 kernel. I used iperf to try to get a measurement for wifi speed. But it didn't seem to change. The speed test was showing the speed to stay about the same even when it was bogging down on my screen when remote accessing the RPi2 with RealVNC. My best test is watching a movie using minidlna on RPi2 to play to Roku stick's media player. Sometimes the movie will start playing normally but then the media server loses connection after 10 minutes or so. The time it lasts varies from just a few minutes to half hour or so. Most recently the server isn't disconnecting but the movie has to buffer(which it normally never did) every couple of minutes which leads me to believe the transfer rate over wifi is low, but the iperf test seemed to show that it was still about the same(800MBs/sec, I think).

                 

                Would you recommend using one of the previous versions of your kernel? Do you think that would possibly get me a more stable wifi connection?

                 

                Thanks,

                Kevin

                1 of 1 people found this helpful
                • 21. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                  hiassoft

                  Hi Kevin!

                   

                  One thing you could try is using my kernel, but disable the Cirrus overlay in config.txt and check if this helps. It's best to completely power down the RPi and unplug power before you test (so the card is completely in cold state). With such a configuration the kernel should behave exactly the same as the official 4.9 kernel.

                   

                  You could also try a 4.4 series kernel with the cirrus drivers, but you'll have to compile it from source, the latest precompiled 4.4 kernel I've uploaded to my website is already about half a year old and there might have been wifi fixes in the meantime - the latest 4.4 cirrus source on github is a little bit newer.

                   

                  Also test with the official 4.4 kernel and see if that works.

                   

                  I have to add that I currently have no idea what could be causing wifi issues in my cirrus tree - it only adds the sound card driver, the rest of the kernel and config is completely identical.

                   

                  Intermittent WIFI issues can be a real PITA to track down and it's rather easy to follow a wrong path. So best concentrate on trying to replicate the issues with the official kernel, doing exactly the same things you did as with the cirrus kernel (eg streaming video, outputting to HDMI instead of the cirrus card).

                   

                  so long,

                   

                  Hias

                  1 of 1 people found this helpful
                  • 22. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                    kjciszewski

                    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. 

                    • 23. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                      phxang

                      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.

                      1 of 1 people found this helpful
                      • 24. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                        hiassoft

                        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.

                        This thread is about the new driver based on kernel 4.9 - please download the cirrus-ng-linux-4.9.0.tgz either from my website or from the first post of this thread.

                         

                        If you have problems please read the troubleshooting section on my website and post your logs and config files.

                        RPi Linux driver for Wolfson / Cirrus Logic Audio Card Troubleshooting

                         

                        so long,

                         

                        Hias

                        1 of 1 people found this helpful
                        • 25. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                          moorh

                          Hello Everybody,

                           

                           

                          I'm a Rpi and Linux newbee and interested in OpenOB with Rpi 3 and Cirrus.

                           

                           

                          After two days of strugling i finally managed to see the Rpi-Cirrus card in the system running:

                          4.9.0-v7+ #1 SMP Sun Dec 18 11:15:40 CET 2016 armv7l GNU/Linux

                           

                           

                          pi@raspberrypi:~ $ arecord -l

                          **** List of CAPTURE Hardware Devices ****

                          card 0: RPiCirrus [RPi-Cirrus], device 0: WM5102 AiFi wm5102-aif1-0 []

                            Subdevices: 1/1

                            Subdevice #0: subdevice #0

                           

                          pi@raspberrypi:~ $ aplay -l

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

                          card 0: RPiCirrus [RPi-Cirrus], device 0: WM5102 AiFi wm5102-aif1-0 []

                            Subdevices: 1/1

                            Subdevice #0: subdevice #0

                           

                           

                          The onboard audio output is commented out in the boot config /boot/config.txt:

                          # Enable audio (loads snd_bcm2835)

                          #dtparam=audio=on

                           

                          #This enables the Cirrus Logic driver and adds ALSA plugin support

                          dtoverlay=rpi-cirrus-wm5102

                          dtoverlay=i2s-mmap

                           

                           

                          However, when i play a mp3 i hear audio on onboard headphone output !

                           

                          pi@raspberrypi:~/Downloads $ omxplayer Kiesza.mp3

                          Audio codec mp3 channels 2 samplerate 44100 bitspersample 16

                          Subtitle count: 0, state: off, index: 1, delay: 0

                           

                          I pasteded the new usecase scripts in /home/pi/bin and run them like i can (double click,execute) but no change.

                           

                           

                          I did create the file: /etc/modprobe.d/cirrus.conf with:

                          softdep arizona-spi pre: arizona-ldo1

                          softdep spi-bcm2708 pre: fixed

                          softdep spi-bcm2835 pre: fixed

                           

                           

                           

                          What am i missing here?

                          Learned alot the last couple of day's but now i could use some help if possible...

                           

                           

                          Regards,

                           

                          Edwin

                          • 26. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                            hiassoft

                            Hi Edwin!

                            However, when i play a mp3 i hear audio on onboard headphone output !

                             

                            pi@raspberrypi:~/Downloads $ omxplayer Kiesza.mp3

                            You need to use a different player which uses ALSA for audio output like vlc, mplayer mpg321, aplay, etc.

                             

                            omxplayer uses direct output to RPi HDMI or analog out via the RPi videocore GPU so it won't work.

                             

                            so long,

                             

                            Hias

                            3 of 3 people found this helpful
                            • 27. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                              moorh

                              Thanks, i did not realise that.

                               

                              mplayer http://onair.coastlinefm.nl:80/

                               

                              Plays an audio stream to the Cirrus Line output, sounding great!

                               

                              Edwin

                              • 28. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                                lappen

                                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?

                                • 29. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                                  hiassoft

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

                                   

                                  make -j4 zImage modules dtbs

                                   

                                  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

                                  1 of 1 people found this helpful
                                  1 2 3 4