VS1053b: DAC_VOL issue writing via SCI_WRAMADDR

Writing software for systems that use VLSI Solution's devices as slave codecs to a host microcontroller.
Post Reply
cinpezzo
User
Posts: 5
Joined: Tue 2018-05-01 19:03

VS1053b: DAC_VOL issue writing via SCI_WRAMADDR

Post by cinpezzo » Tue 2018-10-02 17:15

Hello,
I'm using VS1053b and I'm writing DAC_VOL register directly via SCI_WRAMADDR:

while(!DREQ_GetValue()){}
WriteSci(SCI_WRAMADDR, 0xc045);
while(!DREQ_GetValue()){}
WriteSci(SCI_WRAM, DAC_VOL_level);


It works fine during play but the VS1053 seems to overwrites DAC_VOL with a fixed value (very high volume level) as soon as I start to reproduce a new mp3 file...in the detail it doesn't overwrite DAC_VAL if the mp3 files has the same bit rate, and it overwrite it if the mp3 files has different bit rate.
In addition the DAC_VOL can't be set again for about 5ms (if I try to write immediatly it doesn't change its value).
I'm loading "VS1053b Patch Version: 2.6 Modified: 2018-04-23" but I have the same issue even if I don't load the patch.
Any idea?

Thanks in advance,
Nicola

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

Re: VS1053b: DAC_VOL issue writing via SCI_WRAMADDR

Post by pasi » Wed 2018-10-03 13:57

If you control DAC_VOL yourself, you should probably set SCI_VOL to a suitably low value beforehand. (Writing DAC_VOL directly is only intended to be a workaround for the encoding mode.)

In vs1053 and vs1063 a write to SCI_VOL doesn't set the volume immediately. When a number of samples is next put to the audio buffer (from decoder or due to audio buffer too empty), a change in SCI_VOL (and/or bass/treble) is detected and DAC_VOL gets updated.

An active bass or treble control will force update of also DAC_VOL when samplerate changes.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

cinpezzo
User
Posts: 5
Joined: Tue 2018-05-01 19:03

Re: VS1053b: DAC_VOL issue writing via SCI_WRAMADDR

Post by cinpezzo » Wed 2018-10-03 15:00

Hi,
thanks for your reply!
I can't write SCI_VOL directly because when the fw patch overwrite the SS_REFERENCE_SEL bit every SCI_STATUS change (to fix the fw issue) a "stac" noise is output from the speaker; please refer to this discussion (viewtopic.php?f=10&t=2245&p=11981&hilit ... SEL#p11981).
Anyway I'm not using bass or treble control. After your reply I tried to set SCI_VOL = 0xFEFE immediatly after the VS1053 intialization (I don't write SCI_VOL in other points of my code). After this test I understood that VS1053 set SCI_VOL to DAC_VOL when bit rate changes...in fact in this way I have volume = 0 as soon as I change from mp3 with different bit rate. Is possible to disable this "automatic" update of DAC_VOL from SCI_VOL?

Thanks,
Nicola

Post Reply