The output you got from speaker-test are the symptoms of a missing clock. My guess is the software side is fine and you probably have some kind of hardware issue.
Check carefully that you don't have a short or missing connection (eg ripped out via when removing the pogo pins) somewhere. According to the schematic PCM_CLK runs through R70 (probably one of the resistors next to the pogo connector pads). If you have a short a continuity checker should tell you, if you ripped out the via you should see the PCM clock signal on R70 and can pick it up from there.
Hi Hias, Some progress! Sure enough when I checked there was no connection between R70 and the pogo pad. Incidentally R70 took a bit of finding, but it is right beside the pogo pads. I bypassed the pad and connected R70 directly to the header pin and got PCM clock and data! Running the speaker test I could see the data being routed to left and right outputs sequentially, and the screen report confirmed that. However, frustratingly there is still no audio! I'm plugged into the green connector and have run Reset_paths and Playback_to_Lineout. One thing I have noticed is that the 4th connection, the one to pin 38 on the header remains at zero, but I'm guessing that is probably the data line from the Wolfson to the Pi and so will not have data unless I am reading from the line input. Can you confirm that?
So I now appear to be sending data OK to the card but still no audio.
PCM_DIN (pin 38) will only be driven when you record audio, so this is normal.
PCM_DOUT runs through R67, check if you have a connection from the pogo pad to it, if not feed in PCM_DOUT on R67.
Hi Hais, Obvious really! If one pad was broken others probably were as well. Sure enough no connection between the data pad and the resistor, and I checked the data in to Pi and that was broken too! I've now bypassed all the pads to the resistors and the audio out is now working fine. I haven't yet checked the audio in but I'm pretty sure that will also now be OK. Clearly I have been a bit ham fisted with removing the pogo pins (which is disappointing as electronics has been my profession and hobby for over 50 years!)
Thanks very much for all your help.
I'm struggling to get a Cirrus Audio card to work with a Raspberry Pi 3B (not plus). Both are a year or two old, but had not been used at all before today.
I have installed Raspbian, and then used raspi-update to get the latest kernel and firmware (4.19.32+).
The dtoverlay and
/etc/modprobe.d/cirrus.conf files have been set up as perhttps://www.horus.com/~hias/cirrus-driver.html#configuration
The board gets power (green and red LEDs light up) on boot, and stays that way - the red LED never goes out.
Dmesg says (picking relevant entries):
[ 5.517171] snd-rpi-cirrus soc:sound: ASoC: CPU DAI (null) not registered - will retry [ 5.543355] snd-rpi-cirrus soc:sound: ASoC: CODEC DAI wm5102-aif1 not registered - will retry [ 5.823218] wm8804 1-003b: Linked as a consumer to regulator.3 [ 5.825136] snd-rpi-cirrus soc:sound: ASoC: CODEC DAI wm5102-aif1 not registered - will retry [ 5.826727] wm8804 1-003b: revision E [ 5.827655] snd-rpi-cirrus soc:sound: ASoC: CODEC DAI wm5102-aif1 not registered - will retry [ 5.837083] arizona spi0.1: Failed to get mclk1: -2 [ 5.837107] arizona spi0.1: Failed to get mclk2: -2 [ 5.837783] LDO1: supplied by RPi-Cirrus 1v8 [ 5.838493] snd-rpi-cirrus soc:sound: ASoC: CODEC DAI wm5102-aif1 not registered - will retry [ 5.838721] arizona spi0.1: Linked as a consumer to regulator.1 [ 5.839190] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1 [ 5.840129] snd-rpi-cirrus soc:sound: ASoC: CODEC DAI wm5102-aif1 not registered - will retry [ 5.842155] arizona spi0.1: Unknown device ID: 0 [ 6.140670] snd-rpi-cirrus soc:sound: ASoC: CODEC DAI wm5102-aif1 not registered - will retry
The commands listed on the web page for troubleshooting don't work right, because "paste" on this image is from coreutils, and just outputs the input data to the terminal again ... I assume you wanted content onto some sort of pastebin like service.
sudo vcdbg log msg 2>&1 | python paste.py add debian Pastezone
dmesg | python paste.py add debian Pastezone
lsmod | python paste.py add debian Pastezone
aplay: device_list:270: no soundcards found...
I have tried removing and re-installing the card on the 40 pin header (nothing changes). If it could be dead hardware (either board), is there anywhere I can check with a scope?
This line in dmesg is the problematic one:
[ 5.842155] arizona spi0.1: Unknown device ID: 0
It means the kernel couldn't detect the WM5102 chip (or the WM5102 didn't respond). I've very rarely seen such messages after a reboot, after another reboot the WM5102 was detected fine (as "WM5102 revision C").
If you always get this line it could well be that the board is broken. If you have access to a RPi1 or RPi2 it may be worth testing with the old, official Raspbian image from the "Software download" link (IIRC the image won't work on RPi3). If this image can't detect the chip either then the hardware is very certainly broken.
PS: thanks for mentioning the "paste" command, I've corrected the instructions on my website to use "pastebinit" instead.
I should be able to borrow a Pi2 board from another project (the original Model A I have to hand is 26 pin so won't fit!). I'll try that with the download image and see what happens.
Finally got the Pi 2B hardware out and connected to the Cirrus Logic card. Using the same image as before on the Pi 3, dmesg is the same:
[ 6.416080] snd-rpi-cirrus soc:sound: ASoC: CPU DAI (null) not registered -
[ 6.418304] snd-rpi-cirrus soc:sound: ASoC: CODEC DAI wm5102-aif1 not
registered - will retry
[ 6.628765] random: crng init done [ 6.628788] random: 7 urandom warning(s) missed due to ratelimiting [ 6.809709] wm8804 1-003b: revision E [ 6.810566] snd-rpi-cirrus soc:sound: ASoC: CODEC DAI wm5102-aif1 not
registered - will retry
[ 6.833968] arizona spi0.1: Failed to get mclk1: -2 [ 6.834018] arizona spi0.1: Failed to get mclk2: -2 [ 6.834760] LDO1: supplied by RPi-Cirrus 1v8 [ 6.835722] snd-rpi-cirrus soc:sound: ASoC: CODEC DAI wm5102-aif1 not
registered - will retry
[ 6.842573] arizona spi0.1: Unknown device ID: 0
Green and red LEDs on the board remain lit after booting up, so swapping the Pi board has not changed anything.
Next step, back up the card and rewrite it with the image from Farnell Element14.
However when I tried to boot the image in the Pi 2 I just got the rainbow screen, nothing else. I suspect that this means the firmware is too old to boot Pi 2 hardware. The config.txt on the card indicates that it is a pre-device tree kernel. Not sure if that matters to firmware or not.
After much messing, I proved the card was valid by booting it on an original Pi 1 Model A (but with a 26-pin header the Cirrus Logic card will not fit). Booted there I upgraded the raspberrypi-bootloader package only (hoping this would give me newer firmware). It did give me 2016 firmware in place of 2014 (allowing a Pi 2 to boot in principal), but it also overwrote the custom patch kernel from Farnell. So although after that the kernel would boot on the Pi 2B, there were no drivers loaded and no hardware detection. I tried copying the kernel.img file (only) back onto the card from the original, but that combination did not even give me the rainbow screen, just no HDMI output!
I think this is reaching the "give up" point, because I was only trying to rescue the Farnell image in order to decide if the fault was in the Pi or the Audio Card. Given that the Audio Card does not work on two Pis (3B and 2B) which are otherwise thought to be working, it very much points to the Cirrus card. This is also supported by the fact that I have used the Pi 3 with an AudioInjector Octo successfully (that card has given me other grief, but that is a different story, the communications with the Pi work fine), so it seems unlikely that the Pi's SPI port is broken.
A long time since I have visited this thread ..... my sound card is still working wonderfully, though the latest encarnartion uses a male/female ribbon cable to connect a pi4 to the Wolfson card ..... just teased out the relevant wires to get compatibility. Oh and a relay switched attenuator.
Going to pi4 has forced me to "Buster" and all works out of the box. I note that the total number of ALSA parameters for the card has increased by 2, but I have not done a side by side comparison to find what two have been added .... there are, after all well over 400 of them.
I have finally settled on how I want to use the equalisation blocks, and here I hit a problem. The Alsa control seeks 20 words of parameters. However the hardware for the filter co-efficients requires 19 words ..... If I recall correctly, you took the first two words of gain parameters out from the 21 word block that runs (using EQ1 as an example) from register 3600 to 3620. I have looked at Wolfson.C and registers.h for clues, but without luck. looking in ARIZONA_EQ_CONTROL and its stability check suggests that the parameters are in order as the check would seem to verify A and B, but....
amixer -c 1 cget name="EQ1 Coefficients"
gives me an ordered list of default settings as per the datasheet, preceeded by a word =0x0000
So my question is
What is the 20th word?
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
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
- 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!