1 6 7 8 9 10 180 Replies Latest reply on Dec 12, 2016 1:24 PM by hiassoft Go to original post
      • 105. Re: Driver fixes and updates to kernel 3.18.16 and 4.0.5
        robhammonduk

        Hi Mattias, It's taken me a while to come back about this sorry. I've been trying every conceivable way to try to get this working but it's still not working for some reason. I have been trying to build from your repository, first using buildroot and then when it didn't work I tried to do it manually using the commands below :-

         

        I took your 4.1.y cirrus rpi-linux :-

        git status

        On branch cirrus-4.1.y

        Your branch is up-to-date with 'origin/cirrus-4.1.y'.

         

        I've used the following commands and built the kernel from your config , modules & dtb

         

        /opt/projects/rpi-linux$ /usr/bin/make -j5 -C /opt/projects/rpi-linux HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" ARCH=arm INSTALL_MOD_PATH=/opt/projects/rpi-linux/modules CROSS_COMPILE="/opt/projects/buildroot-gr/buildroot/output/host/usr/bin/arm-buildroot-linux-gnueabihf-" bcm2709_defconfig

         

         

        /usr/bin/make -j5 HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" ARCH=arm INSTALL_MOD_PATH=/opt/projects/rpi-linux/modules/ CROSS_COMPILE="/opt/projects/buildroot-gr/buildroot/output/host/usr/bin/arm-buildroot-linux-gnueabihf-" -C /opt/projects/rpi-linux zImage

         

         

        /usr/bin/make -j5 HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" ARCH=arm INSTALL_MOD_PATH=/opt/projects/rpi-linux/modules/ CROSS_COMPILE="/opt/projects/buildroot-gr/buildroot/output/host/usr/bin/arm-buildroot-linux-gnueabihf-" modules

         

         

        /usr/bin/make -j5 HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" ARCH=arm INSTALL_MOD_PATH=/opt/projects/rpi-linux/modules/ CROSS_COMPILE="/opt/projects/buildroot-gr/buildroot/output/host/usr/bin/arm-buildroot-linux-gnueabihf-" dtbs

         

        I have at the moment manually put the Zimage ( as kernel.img ) in the boot directory

        moved the arch/arm/boot/dts/*.dtb to boot partition and arch/arm/boot/dts/overlays*.dtb to boot partition ./overlays

        I've moved the modules to /lib where they are at /lib/modules/v.1.20-v7/ also firmware was moved to /lib/firmware

         

        My config is the same as it was which is the same as yours. The /etc/modprobe.d/cirrus.conf is the same

         

        My board boots but there are no messages at all in dmesg about any of the card interfaces , i2c etc..

         

        I can't run vcdbg as although I have installed it there is no msg file, I do have dtdebug=on

         

        The rootfs is not raspbian though , it's custom from buildroot using packages I've told it to include. rpi-firmware is one of these which is where I get my startup.elf etc.. files

         

        The issue is that it doesn't even try to load the devices. In fact it doesn't even seem to see the i2c bus.

         

        I've compared my SDcard with one made with one of your pre-built images. My config.txt is the same. I noted that you originally loaded kernel7.img but don't see that in config.txt . Is that a change you did in startup? or is this to do with the older 3.18 version I have as an SDcard image?

         

        On my buildroot image my partitions do not seem to be named. I.E. if I put the SDcard I made in the PI2 I don't see boot named as the partition , how important is the name?

         

        Next I notice when I make dtbs from your config I get only rpi-2-b and rpi-3 device overlays, that is correct?

         

        I've run out of things to check

         

        Best Regards

         

        Rob

        • 106. Re: Driver fixes and updates to kernel 3.18.16 and 4.0.5
          clem57

          I2C must be enabled if you build your own rootfs. By default in many distros it is not enabled!

          Clem

          • 107. Re: Driver fixes and updates to kernel 3.18.16 and 4.0.5
            robhammonduk

            Hi Clem, Not sure what you mean by that?  Surely if I'm using the bcm2709_defconfig for building the kernel provided by https://github.com/CirrusLogic/rpi-linux 

            in the 4.1.y branch the i2c will be part of the kernel configuration provided there and as long as my kernel, dtb and associated kernel modules built from here are on the rootfs partition ( in /lib ) then it should boot the card?  Or are there userspace libraries needed aswell?

             

            Best Regards

             

            Rob

            • 108. Re: Driver fixes and updates to kernel 3.18.16 and 4.0.5
              hiassoft

              Hi Rob!

              I have at the moment manually put the Zimage ( as kernel.img ) in the boot directory

              You need to run "scripts/mkknlimg" from the kernel tree to generate kernel.img/kernel7.img, otherwise the devicetree stuff won't work at all. eg

              ./scripts/mkknlimg arch/arm/boot/zImage /boot/kernel7.img
              

               

              The kernel for RPi2+3 should usually be named kernel7.img, the kernel for RPi1 kernel.img - the GPU firmware uses these names by default (so you can have a system bootable both on RPi1 and on RPi2/3) but will automatically fallback to kernel.img when it can't find a kernel7.img.

               

              If you want to build kernel/modules/dtbs for RPi1 you have to do it in a separate directory (or completely clean the RPi2 binaries before) and use "make bcmrpi_defconfig". Then you'll get the dtb files for RPi1, but not for RPi2/3 - and of course kernel and modules runnable on the RPi1.

               

              As for debugging: try to get vcdbg log working, that's really helpful. It'll only work as root and outputs to stderr instead of stdout so eg on raspbian you have to use "sudo vcdbg log msg 2>&1 | less" to get output. Maybe you are missing some library on the target system, vcdbg links to /opt/vc/lib/libdebug_sym.so and /opt/vc/lib/libvcos.so on Raspbian - check with ldd.

               

              so long,

               

              Hias

              • 109. Re: Driver fixes and updates to kernel 3.18.16 and 4.0.5
                hiassoft

                I've uploaded a new precompiled kernel, based on kernel 4.4.6:

                http://www.horus.com/~hias/tmp/cirrus/cirrus-linux-4.4.6.tgz

                The source code can be found here: https://github.com/HiassofT/rpi-linux/tree/cirrus-4.4.6

                 

                Changes since the last version:

                • Switch to kernel 4.4 series, version 4.4.6
                • Remove now obsolete non-devicetree code from driver

                 

                Important notes if you update from kernel 4.1.y:

                1. Update the GPU firmware using sudo SKIP_KERNEL=1 rpi-update before installing the 4.4 kernel. Failing to do this may result in various errors or a non-booting system!
                2. Check that you have dtoverlay=rpi-cirrus-wm5102 in your config.txt, the old variant dtoverlay=rpi-cirrus-wm5102-overlay is no longer supported.

                 

                Installation and configuration instructions and troubleshooting hints can be found on my website:

                http://www.horus.com/~hias/cirrus-driver.html

                 

                so long,

                 

                Hias

                1 of 1 people found this helpful
                • 110. Re: Driver fixes and updates to kernel 3.18.16 and 4.0.5
                  robhammonduk

                  Hi Hias, The issues I am having were due to the way devices were registered. The build system was using /tmpfs only . When I changed this to devtmpfs with eudev option the modules now try to load. However all is not well. Even if I use my rootfs with your prebuilt kernel and modules I get the same problem as myself :-

                   

                  [    3.977633] udevd[75]: starting version 3.1.5

                  [    4.014171] random: udevd urandom read with 78 bits of entropy available

                  [    4.062315] udevd[75]: specified group 'xenomai' unknown

                  [    4.385334] snd-rpi-wsp sound: ASoC: CPU DAI (null) not registered

                  [    5.144403] bcm2835-rng 3f104000.rng: hwrng registered

                  [    5.155435] snd-rpi-wsp sound: ASoC: CPU DAI (null) not registered

                  [    5.157030] bcm2708_i2c 3f804000.i2c: BSC1 Controller at 0x3f804000 (irq 79) (baudrate 100000)

                  [    5.159863] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000

                  [    5.160797] spi spi0.1: setting up native-CS1 as GPIO 7

                  [    5.206708] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered

                  [    5.321515] wm8804 1-003b: revision E

                  [    5.322951] spi0.1 supply DCVDD not found, using dummy regulator

                  [    5.343449] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered

                  [    5.365942] arizona spi0.1: Unknown device ID: 0

                  [    5.377774] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered

                   

                  edit : this is with kernel 4.1.19-v7 from your tgz together with the installed /lib copied into my rootfs. uname -a shows I'm using the correct kernel. Config.txt hasn't changed. The dtb files are definately the ones I copied over from the cirrus-4.1.19 /boot and so are the overlays

                  I get the same issue if I build my own 4.1.20 kernel from scratch , install my modules and dtb from matching kernel and load this way. Exactly same messages

                   

                  The question is what am I missing. There is a difference between how Raspbian and my buildroot file system registers devices. Do you have any ideas of what to try? I need to add my own WIFI drivers to the image and make it really minimal wso using the raspbian really wasn't what I wanted.

                   

                   

                  Best Regards

                   

                  Rob

                  • 111. Re: Driver fixes and updates to kernel 3.18.16 and 4.0.5
                    hiassoft

                    Hi Rob!

                    [    5.322951] spi0.1 supply DCVDD not found, using dummy regulator

                    [    5.365942] arizona spi0.1: Unknown device ID: 0

                    That's the culprit, you seem to be missing the softdeps. arizona-ldo1 needs to be loaded before arizona-spi, otherwise the chip won't be powered up correctly. Disabling regulator support in the kernel will have the same effect BTW.

                     

                    If everything's setup correctly it should look like this (note the "LDO1" and various "supply" messages and that the arizona driver found a WM5102):

                     

                    [4.228265] wm8804 1-003b: revision E
                    [4.228602] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered
                    [4.241035] LDO1: supplied by DC_1V8
                    [4.241090] snd-rpi-wsp sound: ASoC: CODEC DAI wm5102-aif1 not registered
                    [4.294048] arizona spi0.1: WM5102 revision C
                    [4.313641] Adding alias for supply MICVDD,(null) -> MICVDD,spi0.1
                    [4.314060] Adding alias for supply MICVDD,(null) -> MICVDD,spi0.1
                    [4.314072] Adding alias for supply DBVDD2,(null) -> DBVDD2,spi0.1
                    [4.314082] Adding alias for supply DBVDD3,(null) -> DBVDD3,spi0.1
                    [4.314093] Adding alias for supply CPVDD,(null) -> CPVDD,spi0.1
                    [4.314103] Adding alias for supply SPKVDDL,(null) -> SPKVDDL,spi0.1
                    [4.314114] Adding alias for supply SPKVDDR,(null) -> SPKVDDR,spi0.1

                     

                    so long,

                     

                    Hias

                    1 of 1 people found this helpful
                    • 112. Re: Driver fixes and updates to kernel 3.18.16 and 4.0.5
                      robhammonduk

                      Hi Hias, I finally have it working. On my SD card my boot up files are in a partition but it is not mounted on the rootfs. The config.txt in my parition was being ignored. When created /boot directory on the rootfs partition and copied filesthere and rebooted, it now picks up the config correctly, uses the preinit from the modprobe.d and all works fine.. 

                       

                      I want to thank you so much for your help as I would have been very lost without it..

                       

                       

                      Best Regards

                       

                      Rob

                      • 113. Re: Driver fixes and updates to kernel 3.18.16 and 4.0.5
                        jovianpyx

                        Many thanks again to hias.

                         

                        I have just finished upgrading my Raspberry Pi 3 to Arch Linux kernel 4.4.6 (the precompiled kernel supplied by hias) and I've just today gotten the sound card working.  Had some trouble with i2c which seems to be OK now, though I don't understand why there is no /dev/i2c*.  The problem appears to be that I had not copied the lib and overlay files from the tarball to my installation.  Nevertheless, aplay -l shows the card and mplayer plays music from mp3 files or streamed audio.  I post this here in case others are trying to do the same thing, it does work.

                         

                        Thank you hias for your dedication and fine work on this.

                        • 114. Re: Driver fixes and updates to kernel 3.18.16 and 4.0.5
                          artymorty

                          Hi,

                           

                          I have question regarding audio routing.

                           

                          Is there a way to route any inputs i.e. the "line" input directly to the outputs i.e. the "SPDIF" output and have it enabled all of the time regardless of loading any apps?

                           

                          An example of this would be using an external USB audio interface in "Stand Alone" mode - in which any audio being received by the interface automatically passes through to the outputs.

                           

                          Thanks.  

                          • 115. Re: Driver fixes and updates to kernel 3.18.16 and 4.0.5
                            hiassoft

                            Yes, the Cirrus card can for example route LineIn to SPDIF out. Read more about it in this thread:

                            http://www.element14.com/community/message/114756/l/re-read-in-from-the-headset-jack-and-read-out-to-the-amplifier#11475…

                             

                            The "listen scripts" by Ragnar Jensen are what you are looking for, but you'll have to change the "SPDIF out Switch" mixer setting to "SPDIF Out Switch" (note the capital "O" in "Out", the name has changed in recent kernels).

                             

                            You can find out more about the internal routing of the card in this thread:

                            Yes, the Cirrus card can for example route LineIn to SPDIF out. Read more about it in this thread:

                            http://www.element14.com/community/message/114756/l/re-read-in-from-the-headset-jack-and-read-out-to-the-amplifier#11475…

                             

                            The "listen scripts" by Ragnar Jensen are what you are looking for, but you'll have to change the "SPDIF out Switch" mixer setting to "SPDIF Out Switch" (note the capital "O" in "Out", the name has changed in recent kernels).

                             

                            You can find out more about the internal routing of the card in this thread:

                            http://www.element14.com/community/message/114760/l/re-a-lot-of-playback-items#114760

                            and in the digital core section of the wm5102 datasheet

                            https://www.cirrus.com/en/pubs/proDatasheet/WM5102_v4.2.pdf

                             

                            so long,

                             

                            Hias

                            1 of 1 people found this helpful
                            • 116. Re: Driver fixes and updates to kernel 3.18.16 and 4.0.5
                              artymorty

                              Amazing!

                               

                              Thank you so much Hias. Your help is greatly appreciated.

                               

                              All the Best,

                               

                              Alex

                              • 117. Re: Driver fixes and updates to kernel 3.18.16 and 4.0.5
                                ericthegraves

                                Dear Hias,

                                 

                                I may have missed something critical in this thread, but my situation is that I am trying to get the cirrus card running on a pi 3.

                                I installed a fresh jessie, unpacked the 4.4.6 tar precompiled kernal file in root, downloaded the user scripts, adjusted the config.txt file, created the /etc/modprobe.d/raspi-blacklist.conf file, enabled device tree from the raspi-config.

                                 

                                I still don't see any recognition of the card from the pi, and when I run any of the scripts I get:

                                 

                                amixer: Control hw:sndrpiwsp open error: No such device

                                 

                                Apologies if I missed a fix that was already in the thread. Thanks in advance for any advice!

                                 

                                -Eric

                                 

                                Here is my debug stuff:

                                pi@raspberrypi:~ $ vcgencmd version | pastebinit

                                http://paste.debian.net/441312/

                                pi@raspberrypi:~ $ lsmod | pastebinit

                                http://paste.debian.net/441313/

                                pi@raspberrypi:~ $ aplay -l | pastebinit

                                http://paste.debian.net/441314/

                                 

                                 

                                pi@raspberrypi:~ $ vcdbg log msg 2>&1 | pastebinit

                                 

                                http://paste.debian.net/441308/

                                pi@raspberrypi:~ $ dmesg | pastebinit

                                http://paste.debian.net/441309/

                                pi@raspberrypi:~ $ /boot/config.txt | pastebinit

                                You are trying to send an empty document, exiting.

                                 

                                 

                                pi@raspberrypi:~ $ paste /boot/config.txt

                                 

                                # 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

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

                                # Enable audio (loads snd_bcm2835)

                                dtparam=audio=on

                                dtoverlay=rpi-cirrus-wm5102-overlay

                                dtoverlay=i2s-mmap

                                # Enable devicetree debugging

                                dtdebug=1

                                • 118. Re: Driver fixes and updates to kernel 3.18.16 and 4.0.5
                                  hiassoft

                                  Hi Eric!

                                   

                                  You need to change the dtoverlay line in your config.txt to

                                  dtoverlay=rpi-cirrus-wm5102
                                  

                                   

                                  Note the removed "-overlay" at the end.

                                   

                                  It'd also be a good idea to update the GPU firmware to the latest version by running

                                  sudo SKIP_KERNEL=1 rpi-update
                                  

                                   

                                  Then I think you everything should be fine. Also check out the info in my webpage

                                  http://www.horus.com/~hias/cirrus-driver.html

                                   

                                  so long,

                                   

                                  Hias

                                  • 119. Re: Driver fixes and updates to kernel 3.18.16 and 4.0.5
                                    ericthegraves

                                    Thanks so much for responding so quickly!

                                     

                                    Unfortunately I'm still not getting the card to show up...

                                     

                                    Here is my current debug stuff:

                                     

                                     

                                    pi@raspberrypi:~ $ vcgencmd version | pastebinit

                                     

                                    http://paste.debian.net/441487/

                                    pi@raspberrypi:~ $ lsmod | pastebinit

                                    http://paste.debian.net/441488/

                                    pi@raspberrypi:~ $ aplay -l | pastebinit

                                    http://paste.debian.net/441489/

                                    pi@raspberrypi:~ $ vcdbg log msg 2>&1 | pastebinit

                                    http://paste.debian.net/441490/

                                    pi@raspberrypi:~ $ dmesg | pastebinit

                                    http://paste.debian.net/441491/

                                    pi@raspberrypi:~ $ paste /boot/config.txt

                                    # 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

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

                                    # Enable audio (loads snd_bcm2835)

                                    dtparam=audio=on

                                    dtoverlay=rpi-cirrus-wm5102

                                    dtoverlay=i2s-mmap

                                    1 6 7 8 9 10