Page 1 of 1

VS1053 not playing some files

Posted: Fri 2019-04-12 11:26
by rudnik
I am trying to set up a MP3 player with an Arduino and a VS1053 board. The setup works nicly for some files. But when I start playing some files the DREQ stays active and there is no sound being played. I recoded all the MP3 files to the same bitrate etc., removed the ID3 tags, normalized them and even converted them to OGG and WMA format. I even ran a MP3-checker over then to see if they had errors. Some files simply dont play. I am not sure at this time if it is always the same ones and will check this specifically later.
Between file playback I reset the VS for a few minutes via the reset line. My guess is that when reactivating there may be an error in my setup that only lets some files to be played OR is only successfull some times. Here is my initialization of the VS:

Code: Select all

  digitalWrite(VS_RESET, HIGH);
  vs_com(VS_REG_WRAMADDR, 0xC017);
  vs_com(VS_REG_WRAM, 3);
  vs_com(VS_REG_WRAMADDR, 0xC019);
  vs_com(VS_REG_WRAM, 0);
  vs_com(VS_REG_CLOCKF, 0x9800);
I take care of the SPI frequency when sending commands not beeing to fast. What could cause the VS to not play a file and have DREQ active all the time?
Am thankfull for any tips.

Re: VS1053 not playing some files

Posted: Fri 2019-04-12 11:52
by pasi
It looks like your startup drives GPIO0 and GPIO1 to 0. This is probably intended as a workaround for boards that have GPIO1 floating. If GPIO0 is low and GPIO1 is high, the vs1053b will enter real-time MIDI mode.

However, you don't wait for DREQ high, so it is uncertain if the writes are detected, and in any case it is too late at that point - the RTMIDI mode is already activated if GPIO0 is low and GPIO1 is high.

If RTMIDI is active, you will see 0xac45 in SCI_AUDATA, and can reset and try again, hoping the GPIOs stay low for long enough.

The "easy" hardware workaround would be to tie GPIO0 and GPIO1 together.

If a file never plays, can you send us an example?

Re: VS1053 not playing some files

Posted: Fri 2019-04-12 12:35
by rudnik
thanks for the info!
I will try to modifiy my board and tie the pins together and see if that solves the problem. Otherwise I will test with certainty if it are the same files.

Thanks and I will post the result soon.

Re: VS1053 not playing some files

Posted: Sun 2019-04-14 18:05
by rudnik
@Pasi: thank you so much, that was exactly the problem. I would have never found that. I simply connected pin 33 and 34 and now it work flawlessly. Guess the cheap modules from china are not the best design.

Re: VS1053 not playing some files

Posted: Mon 2019-04-15 16:27
by pasi

Yes, some boards seem to be originally designed for vs1033, and do not take all migration considerations into account. Most of the them at least have remembered to change the CVDD regulator from 2.5V to 1.8V! (but not all...)

(vs1063a doesn't have MIDI, so it would work on that board just fine.)