Zynthian dac adac light ready for codec development

A comment from the peanut gallery, which is eagerly (trying)-following this discussion:
Could it be a matter of setting FMT (pin 12) high, so that the PCM1808 will treat the audio data as left justified? Although I am concerned that that is somehow regarded as an alternative to I2S and I understand that we want I2S.

From page 16 of the PCM1808 data sheet:


From page 17 of the PCM1808 data sheet:

I don’t think that will help. The problem is that the driver is taking 32 bit words from the ADC but the ADC is only providing 24 bits so it wraps into the next sample and causes the noise. We need to change the driver to accept 24-bit words. The parameters already exists but the driver is not honouring this. I have cloned the driver and am debugging but it uses various helpers so it’s more challenging to debug than I had hoped.

3 Likes

I second that.

I’ve catched the boards today and will have some free time tomorrow :sunglasses:


I wondered whether the I2S signal was bad but, I just checked and it looks fine. The left and right audio data populates the first 24 bits of each TDM slot. This is true of both input and output.

I have spent a lot of time trying to get the driver to work… but so far have failed.

[Edit] Ah! I removed my audio source and grounded the audio inputs and the I2S waveform shows noise!!! So - maybe my effort to fix the driver is in vain. Maybe there is an issue with the board. The noise (with no input signal) is not audible so possibly sub/super-sonic but it is there and could be contributing with the input signal to create the audible noise on input. I tested the output and it is perfectly clean, with zero signal in each TDM slot as each channel is muted.

So we should turn our attention to the circuit design.

I’ve looked at the driver and at the overlay. It all looks correct IMO (and at least no more confusing to me).

So, what is the actual status (what is working, what is not working) ? I will try to investigate this afternoon.

Hey! I got clean audio (tone) input… There is something odd with the ground. If I plug in my 1/4" jack then i get the noise but if I connect RPi gnd to sleeve and tip to jack input, I get clean tone. So - let’s try to forget the hours I spent trying to get the driver to work… we need to look at the circuit board!

My dev machine has lots of more code than I have published but I think we don’t need any of that. I will revert to the version on my github and start looking at the circuit design.

@stojos you said that my codec driver would not compile and that you had to do more steps. I don’t understand this. I don’t have the kernel source installed on the RPi5 and it compiles for me. Will you please detail the exact steps you took to make it work for you?

[Edit] I also get white noise if I ground an input.

1 Like

@riban, installing kernel headers is not enough to compile module. make complained that there is no build folder inside /lib/modules/6.6.47-v8-16k+/

So Google told me that rpi-source is best script to get environment prepared to get raspberry kernel modules development.

This script download the whole kernel and link them to appropriate build dirs.

It seems to be putting a ground on the ring causes the noise (using a mono jack in the stereo socket). If I put a ground on the tip, I don’t get the same issue.

It looks like that input jack is wrongly wired. When I was testing direct i2s link form input to output (no rpi in between) I had the same problem when I plug stereo jack to Mac’s headphone output - I heard noise. I thought this was because of the microphone 3rd sleeve.

The first villain is always one’s self!

Hm, looking into wiring in KiCad I can’t see it is wrong but I am not an expert.

It appears consistent across all the geographically diverse constructed versions…?

Buzz the tracks. I fixed a Marshall Amp for someone. in complete track. Could see nothing that didn’t look great, but no circuit. It’s amazing how reconnecting the +12V supply to three quarters of the amps input circuitry helps a design. This turned it from a fascinating device for spontaneous music concrete performances with the compressor controls into a very decent bass amp.

if you don’t connect ground there is no noise. That is very strange.

Anything on the board getting warm?

no, I left it switched on over night and it is fine.

This looks like the problem. You have got the tracks too close and shorted C109 so it is not acting as a d.c. block.

It is a rather awkward hack because the track is below the surface mount capacitor but I managed to gouge away the track and it has fixed the problem!

1 Like

I see, why bloody design rule checker did not see this :frowning:

I have to remove the whole capacitor because solder crossed due to wire to another side

It works !!!

1 Like

I must touched that wire by accident during final preparation and did not run rule checker after it.

[EDIT] design rule checker is still not picking it up. Something is wrong with my design rule config.