Page 1 of 1

VS1053 Volume

Posted: Wed 2019-10-09 8:56
by Pekub
Hello,

I tried play mp3 from SD card on my own board with VS1053. I use procesor STM32F407.

The audio is playing but the volume changes - increases during playback. I used this code after HW reset:

setting SPI on lower speed

VS1053_WriteSci(SCI_MODE, 0x800); // SM_SDINEW = 1
VS1053_WriteSci(SCI_CLOCKF, 0x8800); // SC_MULT=3.5x, SC_AD=1.0x

setting SPI on higher speed

Where could be the problem ?

Thank you

Peter

Re: VS1053 Volume

Posted: Wed 2019-10-09 15:54
by pasi
Does the volume always increase at the same point of the file? Does it happen with other files? (If not, can you send a file which produces the issue?)

What are you writing to SCI_VOL initially?

Can you read it back during the playback and see if it has accidentally changed? Are you reading SCI registers during playback? If so, check chip select handling - do not change chip select signals until your SPI is idle.

Check that CVDD (core voltage) is around 1.8V.

Re: VS1053 Volume

Posted: Mon 2019-10-14 10:10
by Pekub
Hello,

the error was in another part of my hardware.

But now I have another problem. My test file F1kHzN.mp3 cannot be played. On PC it plays fine.

The file is in attachment.

Peter

Re: VS1053 Volume

Posted: Mon 2019-10-14 10:51
by pasi
Seems to play fine with my vs1053b as long as the clock is 2.0x or higher (both with or without vs1053b patches).

What are your symptoms?

Re: VS1053 Volume

Posted: Tue 2019-10-15 8:42
by Pekub
Hello,

On the outputs Rigts, Left is very very low signal.

In my playbackk routine I check some register:

SCI_HDAT1 = 0xfffb
SCI_VOL = 0x1414
SCI_AUDATA = 44101

This problem happened as follows:

- I downloaded 1kHz.wav file from internet it plays
- I converted it to mp3 in Audacity it plays
- I normalize it in Audacity doesnt play (very very low signal)

Peter

Re: VS1053 Volume

Posted: Tue 2019-10-15 15:28
by pasi
If the file you attached is the normalized version, then I can't reproduce your issue.

Are you using headphones? Have you checked your board for short-circuits?

Re: VS1053 Volume

Posted: Wed 2019-10-16 15:48
by Pekub
Hello,

I am not using headphones. Another files play correctly.

When this file plays correctly on yours VS1053, the error must be somewhere in the circuit software initialization or in the hardware connection.

Is my initialization correctly ? Is there anything missing?

setting SPI on lower speed

VS1053_WriteSci(SCI_MODE, 0x800); // SM_SDINEW = 1
VS1053_WriteSci(SCI_CLOCKF, 0x8800); // SC_MULT=3.5x, SC_AD=1.0x

setting SPI on higher speed

Peter

Re: VS1053 Volume

Posted: Thu 2019-10-17 10:32
by pasi
I write 0xc00 to SCI_MODE (our setup requires shared mode), then 0xe000 to SCI_CLOCKF, then send the data according to DREQ.

My SPI speed is around 500kbit/s.

If you're not using headphones, do you have a proper line out connection? ( viewtopic.php?f=9&t=69 )
Remember to NOT connect GBUF to external ground.

Re: VS1053 Volume

Posted: Mon 2019-10-21 10:58
by Pekub
Hello,

thank you for your help. The problem is solved.

I was incorrectly handling XSC and XDCS signals. Now I can play all audio files.

Peter