VS1053 Volume

Writing software for systems that use VLSI Solution's devices as slave codecs to a host microcontroller.
Post Reply
Pekub
User
Posts: 6
Joined: Wed 2019-10-09 8:41

VS1053 Volume

Post by Pekub » Wed 2019-10-09 8:56

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

User avatar
pasi
VLSI Staff
Posts: 1612
Joined: Thu 2010-07-15 16:04

Re: VS1053 Volume

Post by pasi » Wed 2019-10-09 15:54

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.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Pekub
User
Posts: 6
Joined: Wed 2019-10-09 8:41

Re: VS1053 Volume

Post by Pekub » Mon 2019-10-14 10:10

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
Attachments
F1kHzN.mp3
(63.37 KiB) Downloaded 7 times

User avatar
pasi
VLSI Staff
Posts: 1612
Joined: Thu 2010-07-15 16:04

Re: VS1053 Volume

Post by pasi » Mon 2019-10-14 10:51

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?
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Pekub
User
Posts: 6
Joined: Wed 2019-10-09 8:41

Re: VS1053 Volume

Post by Pekub » Tue 2019-10-15 8:42

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

User avatar
pasi
VLSI Staff
Posts: 1612
Joined: Thu 2010-07-15 16:04

Re: VS1053 Volume

Post by pasi » Tue 2019-10-15 15:28

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?
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Pekub
User
Posts: 6
Joined: Wed 2019-10-09 8:41

Re: VS1053 Volume

Post by Pekub » Wed 2019-10-16 15:48

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

User avatar
pasi
VLSI Staff
Posts: 1612
Joined: Thu 2010-07-15 16:04

Re: VS1053 Volume

Post by pasi » Thu 2019-10-17 10:32

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.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Pekub
User
Posts: 6
Joined: Wed 2019-10-09 8:41

Re: VS1053 Volume

Post by Pekub » Mon 2019-10-21 10:58

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

Post Reply