# Zynthian dac adac light ready for codec development

**URL:** <https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527>\
**Category:** Hardware\
**Created:** [November 18, 2024, 5:48pm UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527 "2024-11-18T17:48:19Z")\
**Posts on this page:** 20\
**Page:** 5

<div class="post-metadata">

**Author:** ![tunagenes](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/tunagenes/32/7279_2.png) [@tunagenes](https://discourse.zynthian.org/u/tunagenes)\
**Post date:** [November 26, 2024, 12:22pm UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/81 "2024-11-26T12:22:48Z")

</div>

> [@riban](#):
>
> I believe the noise on the input is due to PCM1808 only supporting 24-bit audio.

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:

 ![image](https://discourse.zynthian.org/uploads/default/original/2X/8/85c1a12a1080d932f2cd4f9dce855c944a49a4aa.png)  
From page 17 of the PCM1808 data sheet:  
 ![image](https://discourse.zynthian.org/uploads/default/original/2X/1/164fa63cd243c5411f9f308a5db080909352e179.png)

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [November 26, 2024, 5:50pm UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/82 "2024-11-26T17:50:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![le51](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/le51/32/1706_2.png) [@le51](https://discourse.zynthian.org/u/le51)\
**Post date:** [November 26, 2024, 11:58pm UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/83 "2024-11-26T23:58:01Z")

</div>

> [@stojos](#):
>
> @riban, I can’t thank you enough for your persistence in creating a driver for this. I learned a lot through this process.

I second that.

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

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [November 27, 2024, 7:58am UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/84 "2024-11-27T07:58:57Z")

</div>

![i2s](https://discourse.zynthian.org/uploads/default/original/2X/c/c9ecce23774c87f24a29edd4a6091f0f5d2938ef.png)  
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.

---

<div class="post-metadata">

**Author:** ![le51](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/le51/32/1706_2.png) [@le51](https://discourse.zynthian.org/u/le51)\
**Post date:** [November 27, 2024, 8:52am UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/85 "2024-11-27T08:52:59Z")

</div>

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

> [@riban](#):
>
> but so far have failed

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

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [November 27, 2024, 9:10am UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/86 "2024-11-27T09:10:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![stojos](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/stojos/32/10833_2.png) [@stojos](https://discourse.zynthian.org/u/stojos)\
**Post date:** [November 27, 2024, 9:18am UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/87 "2024-11-27T09:18:19Z")

</div>

@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](https://github.com/RPi-Distro/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.

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [November 27, 2024, 9:25am UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/88 "2024-11-27T09:25:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![stojos](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/stojos/32/10833_2.png) [@stojos](https://discourse.zynthian.org/u/stojos)\
**Post date:** [November 27, 2024, 9:37am UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/89 "2024-11-27T09:37:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wyleu](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/wyleu/32/514_2.png) [@wyleu](https://discourse.zynthian.org/u/wyleu)\
**Post date:** [November 27, 2024, 9:40am UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/90 "2024-11-27T09:40:22Z")

</div>

> [@stojos](#):
>
> I thought this was because of the microphone 3rd sleeve.

The first villain is always one’s self!

---

<div class="post-metadata">

**Author:** ![stojos](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/stojos/32/10833_2.png) [@stojos](https://discourse.zynthian.org/u/stojos)\
**Post date:** [November 27, 2024, 9:44am UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/91 "2024-11-27T09:44:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wyleu](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/wyleu/32/514_2.png) [@wyleu](https://discourse.zynthian.org/u/wyleu)\
**Post date:** [November 27, 2024, 9:53am UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/92 "2024-11-27T09:53:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![stojos](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/stojos/32/10833_2.png) [@stojos](https://discourse.zynthian.org/u/stojos)\
**Post date:** [November 27, 2024, 10:24am UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/93 "2024-11-27T10:24:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wyleu](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/wyleu/32/514_2.png) [@wyleu](https://discourse.zynthian.org/u/wyleu)\
**Post date:** [November 27, 2024, 10:30am UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/94 "2024-11-27T10:30:42Z")

</div>

Anything on the board getting warm?

---

<div class="post-metadata">

**Author:** ![stojos](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/stojos/32/10833_2.png) [@stojos](https://discourse.zynthian.org/u/stojos)\
**Post date:** [November 27, 2024, 10:37am UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/95 "2024-11-27T10:37:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [November 27, 2024, 10:41am UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/96 "2024-11-27T10:41:12Z")

</div>

![image](https://discourse.zynthian.org/uploads/default/original/2X/7/78f088f97c325f7180dcbe2ab45d58f7361bce8d.png)

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!

---

<div class="post-metadata">

**Author:** ![stojos](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/stojos/32/10833_2.png) [@stojos](https://discourse.zynthian.org/u/stojos)\
**Post date:** [November 27, 2024, 10:42am UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/97 "2024-11-27T10:42:46Z")

</div>

I see, why bloody design rule checker did not see this ☹

---

<div class="post-metadata">

**Author:** ![stojos](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/stojos/32/10833_2.png) [@stojos](https://discourse.zynthian.org/u/stojos)\
**Post date:** [November 27, 2024, 10:51am UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/98 "2024-11-27T10:51:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![stojos](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/stojos/32/10833_2.png) [@stojos](https://discourse.zynthian.org/u/stojos)\
**Post date:** [November 27, 2024, 11:03am UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/99 "2024-11-27T11:03:17Z")

</div>

It works !!!

---

<div class="post-metadata">

**Author:** ![stojos](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/stojos/32/10833_2.png) [@stojos](https://discourse.zynthian.org/u/stojos)\
**Post date:** [November 27, 2024, 11:06am UTC](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527/100 "2024-11-27T11:06:42Z")

</div>

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.

 ![Screenshot 2024-11-27 at 11.09.22](https://discourse.zynthian.org/uploads/default/original/2X/7/70adba5f54b04b939c5c44324e9e111c1ce548ea.jpeg)

[Previous page](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527.md?page=4)

[Next page](https://discourse.zynthian.org/t/zynthian-dac-adac-light-ready-for-codec-development/10527.md?page=6)
