ΣSigmaStudio Ask AI Русский Log in

ADAU1761 strange I2S behavior

SigmaDSP & SigmaStudio eric_engineer Jan 27, 2015 00:00 9 replies Original on forum ↗
Subscribe
eric_engineer Question
Jan 27, 2015 00:00

So I have an ADAU1761 that's been working pretty well, I have my filters and blocks all outputting to the headphone dac fine and everything sounds good. I started with a sample rate of 48Khz and have since dropped it to 8khz. I'm interfacing it with a pic micro over I2S and I want a low sample rate to store the audio in flash.

To prove the I2S connection I did a loop back application in my pic32 using DMA, so I suck in 256 samples, swap buffers then record the next 256 samples while playing back the first. I had trouble here it worked but the sound was tinny and I could hear a tone over the top of everything. So I simplified by just using a 1Khz tone generator inside the DSP. I should point out that when I output this to the DAC everything is clear, but loopback not so much same odd issue of the tone being not quite right.

Anyway to dig deeper I hooked it up to a LA and confirmed that the samples on the line are indeed the samples I'm getting in the sample buffer. It's a repeating pattern that looks like this:

Sample
Hex
Decimal

0
0
0

0.000125
002D413B
2965819

0.00025
00C00001
-4194303

0.000375
002D413B
2965819

0.0005
0
0

0.000625
00D2BEC4
-2965820

0.00075
003FFFFE
4194302

0.000875
00D2BEC4
-2965820

0.001
0
0

Which is odd because that's more like a 3Khz tone there. I also looked at the DAC output on a PC and it looks periodic, but it's no clean sin wave.

I started looking some more and have a 12.288Mhz input clock and I'm trying to get to a 8Khz sample rate on I2S. But I see now that sample rate is limited to input clock divided by 1024? Should I be using a lower input clock? Or is there a way to set the sample rate of the I2S to 8Khz and run the dsp faster? I'm just a little confused here, like I said it seems to be working except for these issues, and it works great coming out of the DAC.

Hopefully you guys aren't too snowed in up there.

Thank you,

-Eric

Audio Signal Processors

SigmaDSP Audio Processors

adau1761

eric_engineer Reply
Jan 28, 2015 00:00

Mucking around a bit, and raising my I2S clock rate from the PIC to 48Khz and everything sounds fine. This is too fast for me to store in my flash though. How do I get this to play nicely at 8Khz? Maybe I'm missing something fundamental.

JohnTo Reply
Jan 28, 2015 00:00

Hi Eric,

A few things to check...

1. Did you change the sample rate for your project to 8 kHz (to properly generate your filter coefficient for 8 kHz operation)?

2. Verify the on-board converters to run at 8 kHz under the "Hardware Configuration > Digital Setup" registers tab?

3. Also verify that the DSP core audio frame rate is 8 kHz under the "Hardware Configuration > DSP Registers" registers tab?

-JT

1dc703035b71bd237bdd83ef1794ab33.png
1dc703035b71bd237bdd83ef1794ab33.png
1dc703035b71bd237bdd83ef1794ab33.png-220x222.png
1dc703035b71bd237bdd83ef1794ab33.png-220x222.png
f96d9fb9644e64d65dc20a3160f5c945.png
f96d9fb9644e64d65dc20a3160f5c945.png
f96d9fb9644e64d65dc20a3160f5c945.png-257x212.png
f96d9fb9644e64d65dc20a3160f5c945.png-257x212.png
2affd657ca20e04cf307652ad78cf5b7.png
2affd657ca20e04cf307652ad78cf5b7.png
2affd657ca20e04cf307652ad78cf5b7.png-288x333.png
2affd657ca20e04cf307652ad78cf5b7.png-288x333.png
eric_engineer Reply
Jan 30, 2015 00:00

Sorry for the lag, I made the mistake of trying to reply to forum by email and just got the rejection notice today.

Anyway I tried those settings again after you mentioned them. I can still hear the tinny tone over the top of my audio, and my noise level goes up. It works but doesn't sound great.

I guess the increased noise could be just aliasing now but I do have a low pass anti alias filter on the front of my ADC too.

I was sad to see decimation isn't supported

Thank you

JohnTo Reply
Jan 30, 2015 00:00

Hi Eric,

If you are still having issues, I wonder if the problem could be with the 256-word block processing that you have set up on on the PIC32 microcontroller side and the timing of interrupt to pass the block of data from input to the output side?

What happens if you reduce the block size from 256 down to just single left/right sample lookback?

Even better, can you temporarily remove the PIC from the picture and just set up the ADAU1761 serial port output as I2S master and loop back the ADC I2S audio back to the input side of the serial port, back out to the DACs... all set up with 8 kHz sample rate and processing rate for the core? Does the audio pass through clean in that case?

-JT

eric_engineer Reply
Jan 30, 2015 00:00

I will try it but keep in mind the audio is clear using this same 256 byte loopback path and 48Khz sampling. That's what made me wonder about my clock speed and the fs divider.

JohnTo Reply
Jan 30, 2015 00:00

Hi Eric,

You certainly bring up a good point. I was hoping more or less to isolate the issue just to the ADAU1761. I will try an 8 KHz I2S loopback on the EVAL-ADAU1761Z eval board and send you the SigmaStudio project.

-JT

JohnTo Reply
Jan 30, 2015 00:00

Hi Eric,

I just realized there is a 4th sample rate setting associated with the serial port rate. You need to set that to 8 kHz.

Attached is an 8 kHz sample rate StereoIn-ADC-I2S-DAC talkthru-HP Out audio passthru example. Signal flow is as follows.

You simply need to just connect a wire or a jumper between the ADC_DATA and DAC_DATA on the JP6 header, and we run the ADAU1761 serial port in master 2-channel I2S mode.

-JT

fc66bd65e50272e3c88f9d0a423b754b.png
fc66bd65e50272e3c88f9d0a423b754b.png
fc66bd65e50272e3c88f9d0a423b754b.png-242x355.png
fc66bd65e50272e3c88f9d0a423b754b.png-242x355.png
d8731fd71424f97bf74f85b59871dc4d.png
d8731fd71424f97bf74f85b59871dc4d.png
d8731fd71424f97bf74f85b59871dc4d.png-319x188.png
d8731fd71424f97bf74f85b59871dc4d.png-319x188.png
eric_engineer Reply
Jan 31, 2015 00:00

Well I tried with that extra setting, I think I'd tried it before but no luck it still sounded the same. But then I went and changed the Input Master Clock frequency setting to 256 * MCLK. That makes FS = 48Khz, but all my other settings, and the sample rates for my sources were left at 8Khz. Setting my pic code to 8Khz mode and everything sounds clean. Before it was set to 1024 which would have been around 12Khz. I'm not clear on why setting this setting to 48Khz works while everything else is still 8Khz. I understand this also means I now have less cycles to do work in?

I'm just a bit wary of moving forward in case this comes back to bite me in production. Thanks for all the help so far!

EZAdministrator Reply
Aug 2, 2018 00:00

This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

Thank you,
EZ Admin