Raspberry Pi Codec Zero / IQaudio Codec Zero working well

This time something about this strange but very interesting audio card.
It has the Renesas DA7212 Codec onboard that gives a pletora of functionality and input, output, advanced DSP functions such as AGC, noise gate, wind noise filter, voice filter, 5-band-EQ, two input and output mixers with direct monitoring path (!) at a very reasonable price.
The sound is much better than one might think, and the DAC EQ turns out to be quite good and useful as well. The DA7212 Datasheet shows what is in this game.
To make that work in my next Zynthian, I’ve put into webconf->Hardware->Audio:

Soundcard: Custom device
Driver Config: dtoverlay=rpi-codeczero
Soundcard Device: Zero
Mixer Controls: «empty»
(the rest left at their defaults)

Then comes the strange thing:
To make this card work, I had to make this extra configuration via SSH:

git clone https://github.com/raspberrypi/Pi-Codec.git

Add into the file this line behind the first group of comments:

alsactl restore -f /root/Pi-Codec/Codec_Zero_AUXIN_record_and_HP_playback.state

Save (ctrl-s) exit (ctrl-x).

sync
reboot

Without the addition to rc.local, Zynthian will not get past the Audio error screen.
It will show the Audio error screen for a brief time on the reboot, but will then start normally and get to GUI.
The second strange thing now:
To make the entire thing work, I had to call up webconf->Hardware->Audio again,
check the settings and eventually redo them, but this time clicked on Mixer Controls .... and be overwhelmed with all those functions.
Clicked save and watched the Mixer Controls field being filled up.
Clicked Save and reboot.
Recording and routing signals, EQ, and so on, everything works. The only thing is, sometimes a setting has to be switched off on the Zynthian GUI to be enabled on the audio card, which complicates logic a bit
In the Audio Levels list is then a senseless chaos, because of the automatic sorting shuffels everything up and puts ADC AGC into output levels and so on.

Then, after the first time making any changes in the Alsa mixer, and rebooting Zynthian, I did remove the line from rc.local, because it would overwrite all settings made in this menu. Zynthian then has its own Alsa state initialisied and the hack at rc.local is no longer needed to enjoy the sound.

Did anyone else try this Codec Zero?

What settings did you put up?

Is it possible to disable the automatic sorting of controls in the Alsa Mixer and just list them in the order they are ut into the Mixer Controls field in webconf?
It has been so in the past, but there has been a disimprovement since then.

1 Like

I can’t say It’s sold me on getting a Codec Zero in the future.

Some more Information:
The rc.local trick is no longer necessary after the Zynthian has once booted through to the main screen and then the Alsa mixer / Levels screen has been at opened once and one of the parameters modified. Zynthian then stores its own Alsa state and the one in rc.local is then causing a mismatch of what is set in Alsa mixer and the real restored settings of Alsa. So after the first tweaking of a parameter, tis line in rc.local is better deleted. I’ve amended the prior writing to reflect this finding.

1 Like

No, no one needs to get a Codec Zero. It is just a collection of information, Justin Case one might consider getting one to build a really compact and economic Zynthian.
For me, this is the best card for the purpose, because of the direct monitoring path (!) and because it has the DSP, which is ultra useful with recording voice or guitar, to make some basic signal conditioning without using Zynthian’s own ressources.

1 Like

Thanks for sharing. I just bought one some days ago, before seeing your post, but I’m still waiting for it to arrive.

I guess all the advanced DSP functions can only be configured through alsa command line/config files. It’s the 5-band EQ parametric?

If you select them in webconf audio advanced mixer(? have the Zynthian not at hand right now, the button at the lower end of the page that opens a black page with all the parameters), then all of these parameters can be made active in the Zynthian-UI and modifiable. The only command line operation is to first make the Zynthian recognise the card and its mixer functions with the rc.local hack.

1 Like

Hi @fussl

so, is this finally a good option in terms of audio quality (in and out) and ease of use ?

I’ve got the IQaudioDac+ and it’s a great value for the price as it is now an “official RBPi HW stuff” (as your CodecZero, so no HW hassles), and is very versatile.

Audio quality is excellent. I hear no difference to the much more expensive cards.
The line input is 1Vss, which is the old DIN standard, so it would be overdriven by the new 2.56Vss pseudo-standard, so there needs to be some additional resitors or an additional amplifier stage to adjust input levels. Quality is still excellent, though. The input level matching is just a small thing to take care of.
Some input filters can be selected and configured, even a well-made AGC and a noise gate, all in this chip. This is great for guitar sampling or voice recording and does not consume Zynthian ressources.
There is a direct path from input mixable to the output, which serves for zero-latency direct monitoring. I use a USB-DI to send wet-only Audio to PA/mix and the card output for headphone, with that monitoring in the mix to hear myself.
The card output is only 1Vss DIN as well, which could be a little low for the newer standards, DC coupled and low impedance, though. Following equipment like amps or mixers usually can take care of that. Bass can be really boombastic due to DC coupling. :heart_eyes:
Audio quality of the output is excellent, with or without these EQ and filters added.

When it comes to software, then Zynthian could improve.
There has to be this hack with rc.local to give the card a defined state BEFORE a new Zynthian starts to config itself, or otherwise there will be strange effects of instruments or effects not connecting correctly to the mixer, or channels taking controls from others, etc. I think this comes from the autoconfig routine derailing due to not finding a valid Alsa state.

So this one aspect with software configuration is incomfortable, as one will need a working Linux to modify the rc.local file and put the Alsa state file. Maybe it would make sense to make adjustments to the autoconfiguration so it loads the first Alsa state if such a card is found.

I’ve also started to load the first Alsa state in zynthian_custom_config.sh and leave out the rc.local hack, after the autoconfig with the rc.local hack is passed at least once, becasue sometimes, after extended use, adding and deleting chains, making changes, etc., the Alsa state builds up quirks that render the card non-functional, until the first state is reloaded at least once before starting Zynthian software. There seems to be some minor error in the process of adding or deleting something from chains. I’m not good enough in coding to find out about this or to help with autoconfig routine.

2 Likes

Hi! My IQaudio Codec Zero just arrived, but I assume it will not peacefully coexist with the PCM5102A I2S DAC, currently soldered to my Zynthian Mini PCB. I had to abort my first attempt to desolder it using just wick to avoid a mess. I’ve ordered one of this new aluminum solder “suckers”, but while it arrives…
Is there a safe way to disable the pcm5102 just using software? Or, would just removing the vin (5V) pin be enough?

The PCM5102 is a DAC that recevies I2S signals only (plus a few configuration links). It has no software configuration and does not interact with its host. So you should be able to leave it without significant impact. It will add a small load to the I2S port but that is unilkely to be significant. If there are long cables attached, they can cause reflections, degrading the signal but I suspect you can just connect another DAC in parallel.

1 Like

As riban replied, there should be no problem at all, at least if the PCM5102 is wired to be slave. Then the PCM5102 will just output a copy of the bare unprocessed audio stream, the same that you will get from Codec Zero if you disable all output equalizers and filters (which is default state), but without any direct monitoring, of course, because that is happening inside the Codec Zero.

1 Like

Hi. Thanks for yor comments.

So I physically connected both modules simulatenously. The PCM5102 continues to work when configured in Hardware->audio and produces sound throught the AUX out jacks (two of them as implemented in the Zynthian Mini V2).

When the Zero is configured in Hardware->audio, the card is detected using the OP suggested configuration (all that configuration optiosn show up in the mixer), but I was not able to check the AUX out since it uses 2.54" headers for that.

Connecting that Zero AUX out headers to the spare AUX out header in the MINI V2 pcb with dupont short cables didn’t work, probably because as explained by @fussl, the PCM5102 is also using this output even if no overlay has been loaded.

So I’ll have to wait for new tests until I find a proper way to connect the 2.54" headers to a 3.5" female connector.

Photos help.

This bunch of ne’r-do-wells will no doubt provide way too many solutions if induced!

yeah

because this is mysterious

@fussl , sorry, for late reply. Thank you for your feedback.
I’m really glad you’re satisfied with this board.

Looking at the block diagram, this DA7212 chip reminds me the wm8731 with a complex internal mux system and some painfull alsa tweaking as a result.

Photo.

  1. IQaudio Codec Zero with headers just soldered for AUX in/out.
  2. AUX out from Codec Zero. Pins for AUX out not documented, so assuming the same as AUX in.
  3. Z.Mini.v2 header for audio out
  4. The only 3.5" female I could find. Probably not well soldered. As in picture, it doesn’t work.

Sorry, you did connect it the wrong way.
Look here for documentation.

The pinout of both AUX-pads is:

  1. Left
  2. Ground
  3. Right
  4. Ground

Pin 1 is the square one.
That is, at both AUX-pads, both pin 1 are near the 40-pin header field.
Both grounds on both AUX are real grounds, connected to shells and RPi ground-sleeves, etc.