cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H747I-DISCO, codec outputs noise in BSP example.

Nida
Associate II

Hello,

I built and uploaded the BSP example from the H7 MCU package, version 1.12.1, on my STM32H747I-DISCO board. I tried the various demos included in the example and they work but it seems there is an issue with the codec configuration.

(I didn't change anything)

While testing the analog_audio_record demo (which should record from the input jack and pass the recorded data to the output jack) i plugged in my headphones in the output jack and noticed that there is a lot of noise, regardless of if an input jack is connected or not.

Playing a song on max volume from the input jack I could hear it above the noise.

While testing the audio_record demo, the microphone was less affected by noise but has a large gain.

I stumbled upon this video on youtube: https://youtu.be/O2XaCFsWxSw?si=J-KL4CMG7EA3le86
"STM32F7 Discovery : Audio Line-in to Line-out Pass-through" from "PizzaBear Engineering".
He points out how some register writes may be inappropriate, like 0x0035 to registers 0x29 and 0x2A, seting up a 30dB gain (in min 11:16). I tried to change this value to 0x0020 like in the video to see if it was the cause of the noise, but all it did was making the noise and the signal quieter and I can't hear anything but an hiss now.

I tried studying the datasheet of the wm8994 but coudn't understand how to make it work, I just understood what it could do. I am not an experienced user so I would like to use some sort of BSP function instead of spending a lot of time trying to learn to configure it.

 

Is there another example that I can try?

Is there something in the configuration that needs to be changed?

6 REPLIES 6
AScha.3
Chief III

Hi,

first some things to think about:

- did you read the WM8994 ds ? or at least, look at it ? It has 359 pages, about 300 or 500 registers (!!OMG!).

- to understand it in a basic way, needs many hours - to more or fully understand it, maybe some 2 or 3 weeks.

- What you want to do with it - really ? 

see start of ds :

AScha3_0-1739388699862.png

A lot of programming and understanding of most or all internal modules is needed...

or you want just play a demo, to see: ok, its doing something ?

->  instead of spending a lot of time trying to learn to configure it.

So decision is : you have got it "doing something" , ok, and now play with something else, 

OR read and learn , until its doing exactly, what you want - even you might need 2 weeks or more to do this demanding job.

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

Hello,

Thanks for replying. Yes I've read the datasheet but I have no clue what the sequence of instructions to correctly program it might be, I allready spent 3 days trying to make it work, with no success.

I was hoping the BSP would take care of everything when I bought the board, otherwise I would have designed a board with a simpler codec.

 

Sorry for not being clear with my intentions with this, I want to test some audio DSP algorithms.

I was looking for some examples with a simple codec configuration to copy for my projects. I want the codec ADC to sample the data and the DAC to output the data sent to it, no special functions or extras.

 

My idea was to copy the configuration from the AnalogAudioRecord BSP example, but the example itself does not behave as it should due to all the noise.

 

At this point I'm not sure if my board is broken or if there is an issue with the example code.

 

I would like to make the example work as a first step, and then get a configuration for my projects.

 

Please let me know if you can run the example or if you can give me some feedback on what I might be doing wrong. Thanks.

Hi,

no, i have no example for this. Because (i also want to do some audio things...) i see the codec, look at its data sheet and think: oh no, not for me. And board is not cheap. So i decided to connect to a simple board ("black pill", F411, about 4 $ ) and a "simple" DAC, that has only few registers (to learn: just few hours) and has average good data : PCM5102A .

Then to play a little with DSP , can use a faster cpu (H743 now) and do some calculations (biquad filters, even in double float no problem) and a more complex DAC with little DSP , PCM5122 :

AScha3_0-1739472595042.png

But then want still more quality, hi-end audio, so looking for "best" DAC : (tried some, then use) ES9038 .

AScha3_1-1739472795313.png

Now its my "audio-player" , plays wav/flac/mp3 (double float precision) from SDcard and USB , with my old (Sony) IR remote control (i just like it), with hi-end quality sound.

Made a board for my toy:

AScha3_2-1739473093788.png

...and 2x TDA1387 DACs , NOS, to make active speaker system - if  i have motivation to do so. 6ch are here.

 

And "DSP" is just the 400MHz H743. (And ADCs - it has 16 bit fast ADCs .)

 

So i would recommend: think first, what you want to do, then puzzle together some parts, that have a useful time-to-learn -> do-what-you-want   relation. Not to waste much time to learn about complex chips - that functions you anyway dont plan to use.

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

Cool project you got there! :D

Thanks for the advice, I'll keep the post open, hoping somebody figured the codec thing out.

If I see no response I will just use another codec like you suggested.

 

In the meantime I am trying to get by with the on board ADC and DAC, they don't seem too bad just to test things.

btw

Did you look for other libs for wm8994 ?

->

https://os.mbed.com/teams/ST/code/BSP_DISCO_F769NI/docs/tip/wm8994_8c.html

 

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

Sorry for replying just now,

Not really just the one I found in the video, but didn't work. I'll give the one you linked a try when I have the time.

Thank you :D