DFPlayer Pro command delay

Hi,

I'm using a DFPlayer Pro for cosplay and it's all working fine but there is an anoying delay using the playFileNum(number) function.

I'm using wav files to reduce delay, and it works well when looping a file in SINGLECYCLE, CYCLE or PLAYALL playmodes : files are playing with no delay.
But if I send the playFileNum(number) command, there is about 200-400 ms delay between the actual sound stopped and the start of the specified file.
It's like the command is creating a delay...

Is there a way to remove/reduce that delay somehow? Thank you!

Is your device a genuine DFRobot device?
I've never noticed this phenomenon.

Yes from Digikey in DFRobot box.

Are the tracks in folders ?

Are the number of files large? Were the files stored at one time? Have you tried the same files in MP3 format (smaller file, less buffering??)?

which library are you using?

Tracks are in the root directory, they are name 01.wav, 02.wav, etc.

They were stored in playing order one at the time.

They are from 200 to 3000kb wav files. There is no delay when they are shuffleling in play all or cycling playmode, just when using playFileNum() function. So it doesn't seem a buffering issue?

I'm using the DFRobot_DF1201S library, is there another one for DFPlayer pro?

I'm also using an Arduino Nano Every on Serial1 at 115200 baudrate to drive the DFPlayer Pro.
A 1k resistor is inline on the TX line to the DFPlayer Pro RX pin.

DFPlayer Pro.
Missed that 'Pro' part. Apologies there.
I've only ever used the Mini - which I like a lot.

1 Like

So you notice the delay when a song is currently playing and you ask to play something else?

yes

the function awaits an ACK from the module

may be this ACK takes time when a song is playing

1 Like

After more analysis with some output to Serial, delay is not the problem. It's quite smooth with just a few 5-10 ms delay between command and starting.

What I tough was a delay is in fact some clipping sound from stopping the playing file, and another clipping sound from starting the file. It's not constant, sometime more clipping sounds occur, sometime less.

I don't have clipping sound when files switch in automatic cycling mode or playall mode. Only if I ask to play a specific file with playFileNum() or playSpecFile().

Those clipping sounds are ruining my sound effects, it's annoying...

too bad... have you tried sending stop before sending the playFileNum() command ?

The pause() command, there is no stop command in this library. Yes I've try to pause before the play command, not better.

Ok I've been trying to send the command before the end of the playing file. I've found a sweet spot, 600ms before the end of the playing file, where I send the playFileNum() command with a little to no clipping sound. It's not perfect but acceptable.

But I loose a part of the playing file. So next thing that I'm gonna try is to edit my wav files for a little longer to be able to send the playFileNum() while the current file is playing and before 600ms of the end. Exemple : if I have a 5000ms file now, I'll will make it 6000ms, so I can send the play new file command at 5000ms. Thus the file will play the initial 5000ms and be cut by the command play function, but clipping/popping sounds should be minimum.

It seems that sending a command to play a new file near the end of the current playing file cause some clipping/popping sounds while changing file...

I'll let you know if it worked out !

Keep us posted - good to know your findings

I have think of something! DFPlayer Pro is 3.3V logic. They say to put a 1kohms resistor on the RX/TX line if couple with an Arduino. I did that. But maybe it's not enough for protection and it's causing a voltage spike when the playing command is past?

From their own wiki it's powered with 5V and you don't need any resistor at all (unless you want to use the "button interface").

Hum you're right! I've checked so many time mini and pro page that I've registered the 1kohms from the mini wiki...

I'll try that next week, without the resistor...

Thank you

There is already a 1kohms resistor on the module, so now I have 2kohms...

I don't think it could cause the clipping noise while switching file with the play file commands, but I will still make the test and keep you post.