cancel
Showing results for 
Search instead for 
Did you mean: 

Noise/Feedback on STM32H735G-DK when using line-in audio

nick9871
Associate II

I'm trying to prototype an audio effects unit with the STM32H735G-DK board. I am using the line-in input jack and output (headphone/line-out) jack.

 

There was no example using the line-in jack for the 35G-DK board as far as I could find. So I just referenced something from a F7.

Right now I have horrible feedback/noise on the output even when there is nothing in the playback buffer. I have verified that I can supply a 1khz square wave on the line-in and I see the waveform on the output but not without a bunch of noise. If I turn down my input source eventually the signal degrades and is over-powered by the noise.

I have scoured the WM8994 data sheet and I simply cannot seem to get rid of this noise.

 

Does anyone have any known-working code using this on the DK board? I only have one board so it is possible the CODEC is damaged.

Playback (stuffing the buffer with a 1khz square wave) without enabling the input side works fine.

6 REPLIES 6
LCE
Principal

Start simple, DAC only, and with a sine wave from SRAM (adjust buffer size to sine length, DMA in circular mode) you might see more, concerning THD. Check with a scope / some audio hardware.

If the DAC is working, start with the ADC.

I think that codec has these extra microphone inputs, so make sure that your input selector is set correctly.

AScha.3
Chief III

the wm8994 is a pretty complex codec....

AScha3_0-1699340094194.png

there are digital and (!) analog paths to set, so you can mix (up) everything...

read the wm8994 manual, 360 pages (!!!) , and you can see all register descriptions you need.

begin with a simple path setting, as LCE said, for only input->adc and output->dac you should be able to do it  in foreseeable time.

If you feel a post has answered your question, please click "Accept as Solution".
nick9871
Associate II

I can utilize the DAC with no problem. In my original post I wrote that I can send a generated 1 KHz square wave to the input, and see the signal at the output but not without a lot of noise. 

I am wondering if this is an issue with how the 35G-DK audio-input jack is connected. The schematic has the L/R inputs of the jack going to the LN and RN pins. Which apparently go through the analogue mic (PGA?) interface. I Wonder if this is the issue.

Enabling the DRC allows the signal to pass through but again not without a huge amount of noise. 

I've tried to disable the +30dB (why would you need +30dB gain) gain on the input mixer to no avail.

 

Again I am wondering if this is a hardware issue and maybe a semantics/labeling issue. Meaning the "Line In" is actually not able to be used as a line-in and only as a passive microphone input?

just from wm8994 data: >>

When mixing line inputs, input PGA outputs and DAC outputs the total signal must not exceed 1.0Vrms (0dBV).

A 1.0Vrms differential signal equates to 0.5Vrms/-6dBV per input. <<

so..what level you put in ?  0,5v is absolute maximum. try small level ; try set pga gain low.

 

If you feel a post has answered your question, please click "Accept as Solution".
nick9871
Associate II

Input levels are good. Something I just noticed on the DAC output is it looks like I am only getting half (plus some bias/offset) of my output. Here I am generating a 1khz sine wave (in code, no input path enabled)

 

LCE
Principal

DAC: have you checked the Codec specs if the headphone output needs some minimum load?
BTW, your output is not only cut off, but the sine is also not continuous. Maybe check your sine buffer, also make sure you feed the DAC with the correct signal type, probably 2s complement with 0V as center.

ADC: I guess there is a setting to bypass the PGA, from the codec's pin naming it looks like IN1L/R can be used as standard line inputs.