Zynthian dac adac light ready for codec development

I have pluged 3.3V and 5V power to the board and with my primitive Hantek 6022BE that I never used before. Signal produced by pcm1808 are:

  • LRCK is 48KHz
    LRCK is master clock divided by 512fs and 48KHz is correct (24.576Mhz/512)
  • BCK 3.72MHz
    BCK is always 64 times LRCK and 3.72MHZ is correct (48K*64).

So pcm1808 is doing what is supposed to do. Power is probably not that stable. I am using some primitive supply.

However signal is maybe not right. It is too jittery (could be due to primitive hantek not being able to sample it fast enough. LRCK amplitude is 1.8V while BCK is 3.6V. Last time when I used oscilloscope properly was in University lab in late 80s so I could be wrong.


yellow is BCK and blue is LRCK

I did not measure master clock frequency because my Hantek can not cope over 20MHz. However it must be correct when pcm1808 is producing proper BCK and LRCK frequencies from it.

we can easily fix that by breaking the line to pin 7 header.

1 Like

Ah, it looks like that LDO is very important. I can see it even on a cheap pcm5102 cards from aliexpress. I though that they only put it there so that only 5V need to be supplied.

That looks good. It occurs to me now that my osciloscope may have struggled with the bandwidth. It is a 100MHz scope but I didn’t pay much attention to that side so maybe the leads or config I used could have been flawed… or maybe using the RPi as the PSU may influence results.

You could now test a round-loop audio path to see if both ADC & DAC are working. With the board isolated and powered like you have done, you could connect the DIN to the DOUT and then see if audio fed into the analogue input appears at the analogue output.

Need to solder audio jacks first to be able to test it. Will do this evening after the work.

1 Like

The triggering on my hantek DS05102P is pretty lousy…

1 Like

some other observations.

if you plug card to zynthian do not enable non USB audio when testing signals. If you enable non USB audio card they will probably set rpi to be i2s master and they will produce LRCK and BCK that will clash with what PCM1808 is producing and you will hear clicking.

Here is LRCK when used with hifiberry-dac audio card setting where raspberry codec is set as is2 master and producing LRCK that is clashing with PCM1808 LRCK clock.

When you set audio to dummy there is no clash and you have clear LRCK produced from PCM51808 and no clicking on audio out (PCM5102 is not erroring).

Hence so far I think hardware is OK.

Also if you ground master clock on PIN 7 PCM1808 will not produce anything because there is no master clock and you can use hifiberry-dac driver because there will be no clash and it will play without clicking on cards PCM5102. So I think what we need is still just a proper codec to be developed and hardware is OK.

[EDIT] I don’t have any audio source at the moment to plug in to test what happens if you short data in and out pins which should link digital data form PCM1808 into PCM5102. I have tested it simple by plugin cable into audio in jack and touching the right or left channel on another end of cable. I hear promising common buzz either on left or right speaker when you do that without again any clicking. Which means all this clicking is only related to codec that must be slave and listen without producing any clocks and not to hardware.

1 Like

Yay! That sounds really good news. We need to enable the I2S in clock consumer (slave) mode. The simple audio thingy that you previously mentioned seems like a good starting point. I hope we can do this with overlays and not need to develop a driver. Indeed, the kernel I2S driver seems to support 8 channels already. I look forward to playing with it further when I am back in the wrokshop.

2 Likes

@stojos , I just want to let you know that the boards didn’t arrived yet.
I’m so impatient.

Shame, hopefully it will arrive soon.

@riban and @le51, think about installing stacking header so that we can test two cards once we get one working.

To test additional cards we would just stack them on top of each other and:

  • cut data in and out pins so that they are not propagated to a stacked cards
  • on every additional card patch data in and data out pin to appropriate i2s channel
  • Desolder osylator
  • Set pcm1808 to slave mode using md0 solder jumber at the back of the card.

How would the master clock be fed to the slave cards? We don’t really want to feed it via the RPi pin 7.

add that Digital in and out will be for both stacked boards routed to the same pins 39 and 40.
But some dirty hacking with wires or Dupont (and/or Dupond) cables should do the trick.

(who is Dupond and who is Dupont ?)

Anyway, right now, just having a simple and cheap codec (single stereo IN and OUT) is the main objective IMO.

1 Like

If you cut data in and out pins (39 and 40) it would not be propagated (connected) to other stacked card(s) that will reroute their 39 and 40 pins to appropriate pins.

Pin 7 will be used for propagating master clock required by pcm1808 but this is just for testing.

Final design will be different once we get this working. Probably we will add LDOs, missing oscillator caps and multiple pairs of this on a single card.

We need ti get overlay and codec working first.

1 Like

If we get this working a figure out how to add bias for instrument input and fantom power for microphone we can get zynthian to be very rich 8 channel mixer with effects and recording.

We agree

this is another story, but it’s in my long term objectives too :wink:

For multichannel audio, this base makes sense IMO for intermidiate setup (like 2 stereo IN + 2 stereo out), for a full 8 ins+outs, pcm3168 should be a better option (one pcm3168 + one pcm1808 chip vs 8 chips),.
We’re not quiet there …

Yes, there are many nice add-ons that could be implemented but first we must make some sound. Baby steps…

I have built a device tree overlay that provides audio output on a single PCM5102 using clocks from the soundcard, not RPi. This is a step forward.

test4.dts (1.9 KB)

To build and install:
dtc -@ -H epapr -O dtb -o zyndacadclite.dtbo -Wno-unit_address_vs_reg test4.dts && cp zyndacadclite.dtbo /boot/firmware/overlays/

I started to work on making 8 outputs work but got stuck. The GPIO are enabled in this dts but I haven’t yet figured out how to make multiple outputs.

We should actually get the input working next. There isn’t an overlay for the PCM1808 and I do not have time now to investigate further but I have clean tone coming our of my zyndacadc-lite card so can stop for a few hours and do some real work.

1 Like

This is amazing. I am going to test out now.

I guess spdif-dir (receiver) should do the trick or at least be Ă  good starting point.

Btw; the kernel module drivers for pcm5102a and spdif-dit (transmitter) are quiet the same.

1 Like