VS1053 EndFillBytes + Power Off "Plopp"

Designing hardware that use VLSI Solution's devices as the system controller for the entire design.
DrDoom
User
Posts: 7
Joined: Tue 2018-12-11 16:21

VS1053 EndFillBytes + Power Off "Plopp"

Post by DrDoom » Thu 2020-06-04 17:33

Hello VSDSP forum.

I used the VS1053 (lineout + amp) with an ESP32 in a project and now all software/hardware problems have been solved.

However, there are two things that are annoying.
1. if I have sent MP3 data and then send (according to data sheet) 2052 + max 2048 zero bytes, audio data still seems to be in the buffer. when the next file is played, a short "wrong" audio piece of maybe 2 ms is played.
what i do to send the endfillbytes (schematically):
- wait_for_ready_to_receive
- SPI.beginTransaction
- data_mode_on
- SPI.writeBytes......the endfillbytes
- data_mode_off
- SPI.endTransaction

2. When I switch off the device including motherboard, ESP32, amplifier, VS1053, etc., I hear a disturbing PLOPP. I hear the same PLOPP when I set the volume to 0%.
I have already read a lot in the data sheet. however, I dont find a possibility to e.g. internally slowly lower the voltage for the audio output befor shutdown and power off.

Can I influence this behavior in any way?

Thanks a lot,
Greetings Daniel.

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

Re: VS1053 EndFillBytes + Power Off "Plopp"

Post by pasi » Fri 2020-06-05 10:15

1. Might be due to the mp3 transform overlap windowing. A workaround would be to send one frame of quiet mp3 audio with different parameters (samplerate and/or number of channels) to force reinitialization of the mp3 decoder.

2. At reset or power-off the LEFT, RIGHT, and GBUF (and RCAP) drop to 0, which will be heard in your output. The severity depends on your analog circuitry. Does your amplifier have a mute input? Are you using GBUF or GND as reference for the amplifier?
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

DrDoom
User
Posts: 7
Joined: Tue 2018-12-11 16:21

Re: VS1053 EndFillBytes + Power Off "Plopp"

Post by DrDoom » Fri 2020-06-05 19:06

Hello Pasi,

thanks for the fast response.

1. Made a stupid mistake. I only wrote the endfillbytes when I unload the file...."but not when I pause the playback".
playlists are loaded for my project and "only paused" when the respective nfc tag is no longer available. when it is available again, playback continues.
if there is another nfc tag, a new playlist is loaded, the file is closed, endfillbytes are written and the next file is loaded and played. this means that the endfillbytes (unload prev. file) play the rest in the buffer and only then play the new file. now i clear the buffer with every pause and stop and everything is fine. Thank u.

2.
a) "Does your amplifier have a mute input?" No, only power in, 3.5mm audio in and potentiometer for volume. I had already considered installing a digital potentiometer to regulate the gain via the esp32. however, this is no longer possible (no more gpio's available).
b) "Are you using GBUF or GND as reference for the amplifier?" I'm sorry, I don't have such knowledge. I use the regular audio connection via 3.5 mm line in. So this should not be the normal gnd connection?!

Is it possible to regulate the voltage drop?

Since in the project i disconnect the power supply with a relay for all components after shutting down: could it help to let the VS1053 live longer with a capacitor?

Thanks a lot,
Greetings Daniel.

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

Re: VS1053 EndFillBytes + Power Off "Plopp"

Post by pasi » Tue 2020-06-09 15:14

Do you have schematics (pdf) we could look at, or just a general block diagram?
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

DrDoom
User
Posts: 7
Joined: Tue 2018-12-11 16:21

Re: VS1053 EndFillBytes + Power Off "Plopp"

Post by DrDoom » Wed 2020-06-17 11:39

Apologies for the late reply.
I had no scheme and tried different programs. now i have used a very simple program. I hope the scheme is understandable.

The system is supplied by a relay which is switched on physically via a button and switched off via the ESP32 (depending on the power button press).
The amplifier and a buck converter are attached to the relay, which supplies all other components with 5.1V (incl. VS1053).

I colored the planned capacitor green. But I suspect that the capacitor is discharged very quickly through all components.
Attachments
Sound Box.jpg
the sound box
Sound Box.jpg (4.55 MiB) Viewed 682 times
Schema.png
simple schematic
Schema.png (31.51 KiB) Viewed 682 times

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

Re: VS1053 EndFillBytes + Power Off "Plopp"

Post by pasi » Wed 2020-06-17 14:30

The best possible mute is implemented using a relay, which keeps the amplifier input at zero under software control.

When turning on, the mute needs to be active until the vs1053b has biased its output on the other side of the DC block.
When turning off, the mute is first engaged, then the vs1053 is powered off, then the amplifier can be powered off.

A FET/Transistor can also be used, but it will quickly affect the signal quality.

In the mute circuit of DSPeaker Anti-Mode X4 there is also a power-loss indication directly from the transformer, so missing even a single 50Hz (half)cycle will enable the mute.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

DrDoom
User
Posts: 7
Joined: Tue 2018-12-11 16:21

Re: VS1053 EndFillBytes + Power Off "Plopp"

Post by DrDoom » Wed 2020-06-17 17:18

The best possible mute is implemented using a relay, which keeps the amplifier input at zero under software control.
My problem is...that the relay is the power supply for the amplifier "AND" for all other components (via Buck Converter) at the same time. I have no more GPIO's available to use another relay exclusively for the amplifier.

So I looked for another solution to at least reduce the pop, e.g. via the VS1053 or a capacitor.

Hannu
Senior User
Posts: 88
Joined: Mon 2016-05-30 11:54

Re: VS1053 EndFillBytes + Power Off "Plopp"

Post by Hannu » Thu 2020-06-18 7:32

Have you already used VS1053 GPIOs? If amplifier or extra relay has enable (signal high lets audio pass to output) controlling VS1053 GPIO pin is few SCI operations. Pull-down on the pin will keep output muted and when VS1053 is awaken and in use, it can be used to enable the output. The signal polarity enable/Xmute keeps the output muted when VS1053 is in reset or powered off.

DrDoom
User
Posts: 7
Joined: Tue 2018-12-11 16:21

Re: VS1053 EndFillBytes + Power Off "Plopp"

Post by DrDoom » Thu 2020-06-18 23:12

Have you already used VS1053 GPIOs?
Yes, but only to deactivate the midi mode. i had a problem that mp3 data was not processed and that was due to the standard midi mode (lc technology board) and a user posted a corresponding solution about the gpio's in a forum.
however, i did not find any information about the gpio's in the data sheet.
Could you give an example of which gpio should I need to pull down to mute the output?
I would really like to try it out.
Thank you so far.

Hannu
Senior User
Posts: 88
Joined: Mon 2016-05-30 11:54

Re: VS1053 EndFillBytes + Power Off "Plopp"

Post by Hannu » Mon 2020-06-22 8:03

My point was that if you don't have any GPIOs left on the MCU you can control the VS1053 GPIOs through SCI interface.

Datasheet pages: 44, 45 and 76 have info about these.

I haven't tested this, but pin control should go like this...
Registers are:
0xC017 DDR
0xC018 IDATA
0xC019 ODATA
And then normal read modify write operation:

1) Write SCI_WRAMADDR 0xC017
2) Read 3 16-bit words to ddr, idata, odata from SCI_WRAM
3) modify those words (wanted bit high, idata isn't interesting, output high too)
4) Write SCI_WRAMADDR 0xC017
5) write 3 16-bit words from ddr, idata, odata to SCI_WRAM

Post Reply