Page 1 of 1

latency of VS1063 encoding process

Posted: Mon 2019-02-25 12:55
by mgonen
Hello,
I am using VS1063 and STM32F4 microcontroller for MP3 encoding. I have 500mSec latency and want to reduce this delay. What is your expected latency for MP3 encoding process.

Best Regard
Mevl├╝t

Re: latency of VS1063 encoding process

Posted: Mon 2019-02-25 16:33
by pasi
What's your samplerate, channels, and bitrate?

How are you transferring the data to the decoder, and what are you using to decode?

Re: latency of VS1063 encoding process

Posted: Tue 2019-02-26 12:22
by pasi
Chapter 11.6.10 of the vs1063a datasheet gives the total encoder-decoder latency (including audio FIFO) for the available samplerates. The longest latency 350ms is with 8000Hz, the rest are 250ms down to 100ms.

So, it looks like your decoder or audio output has longer latency than a vs1063a decoder.

Re: latency of VS1063 encoding process

Posted: Wed 2019-02-27 18:32
by mgonen
Thanks for reply.
My samplerate is 48000Hz and bitrate is 32Kbit. I am tarnsferring data to computer over ethernet as UDP. And I am using VLC player to decode data.
What the latency should be at least.

Re: latency of VS1063 encoding process

Posted: Thu 2019-02-28 13:21
by pasi
At 48kHz an mp3 frame is 24ms. The encoder requires a frame of audio for analysis and windowing, then actually encoding it before sending, and the decoder needs a full frame and the next frame header before it can decode. The encoding delay is probably around 50ms and the decoding delay about the same.

The audio FIFO in vs1063a is 2048 stereo samples, i.e. 42ms at 48kHz, but a real-time system would try to keep it as empty as possible.

The audio subsystem of the PC might have large buffers.