Go Down

Topic: Arduino Lightsaber for/with LED string blade (Read 123322 times) previous topic - next topic

RobMonty

No links to photobucket work for me... odd....

Protonerd

No links to photobucket work for me... odd....
Photobucket links do not work anymore for anyone. That *** of a company changed their policy wrt 3rd party hosting, deleting a decade of visual documentation on nearly all internet forums around the globe.

PedroRS

Hi guys

I'm building a homebrew (right now as prototype using Aurduino UNO) + neopixel strip version.
Final target is to use 18650 battery but currently I'm using laboratory power supply fixed to 5V.

After configuring the OS and burn the code mainly all seems working fine. Congratulations Protonerd !!!!!  :smiley-yell:

But operating it a little bit I found one audio issue.
SOME of the sounds keep in infinite loop after playing them. For example the saber ignition off or some config menu voices. I can solve the issue provoking another audio execution or rebooting.

Are someone facing a similar problem?

I could notice some uP reboots navigating through config menu always including some strange noise in loop as well... but I'm not sure if it's related or not.

I'm using the serial resistor in DFPlayer RX line to adapt arduino tx 5V.

Thanks in advance !!!
Pedro.-

jbkuma

This is not a common or persistent problem, it sounds like a configuration issue.  It could be that your sounds are not addressed properly and they are repeating as a hum.

Are you using one of our supplied fonts or a font of your own? Did you convert it properly?

PedroRS

Hi jbkuma, thanks for so quick reply!

I'm using supplied fonts.
In fact, I used all the content included in the file DIYino_Prime_SDCard_image.7z
Basically I uncompresed all the content, and after format SD card I drag and drop all the content (config sounds and 5 soundfonts folders).

For example when I turn off the sable, the retraction sound seems the proper one, bit just keep in loop.
Also the config vocals seems matching with the proper configuration option.

Protonerd

Are you using FX-SaberOS? If yes, do you configure your board type correctly? If you are using a home brew solution, you shall define DIYino Prime as board, because the Stardust only expects 3 sound fonts, with a different structure, it might be the source of your problems.

PedroRS

#711
Feb 01, 2018, 09:42 pm Last Edit: Feb 01, 2018, 11:34 pm by PedroRS
Hi again !!!

I'm using FX-SaberOS (github.com/Protonerd/FX-SaberOS) master version.
Yes, I defined DIYino-Prime as hardware type, and I confirmed the soundfont structure defined in the code and it's exactly same as the one you supplied.

I made I video showing the behaviour: http://gofile.me/2aJqt/u99y6rddR

While recording I notice I thing. Ignition OFF is working properly (no loop) if I turn off saber before HUM sound is starting the second loop. In de video you can see it looking the DFPlayer LED.
Also I extend the video navigating through Config Menu to show you what happens with sound changing config options and modifying volume value. Maybe this strange noises are related.
As I mention before I'm facing some resets during config for example changing volume value.

As you can see, the sounds are apparently selected properly inside de soundfont.
Anyway I tried two different SDCards, 3 different DFPlayers and I format many times the card to write files by different ways, as for example drag and drop all folders at the same time, one by one in other...

I will agree some ideas to test ! :-)

Thanks a lot.
Pedro.-

PedroRS

Hi guys!
Still I don't know exactly the root cause of why I facing the audio problem I explained... but after some hours investigating I have some details I wanna share.

Basically what happens is that at least my DFPLAYERmini boards are no disabling the loop mode automatically when executing the function SinglePlay_Sound what is basically executing the library function dfplayer.playPhysicalTrack. So once a track has been played using LoopPlay_Sound (library dfplayer.playSingleLoop).

I simulated this working mode in a test scketch using original DFRobot library (DFRobotDFPlayerMini), and I could reproduce exactly the same with a this simple code:
Quote
myDFPlayer.loop(59);
    delay(20000);
    myDFPlayer.play(35);
    delay(5000);
When track 35 starts player keeps in loop mode.
┬┐Only my DFPlayer boards? I don't know.... :-o

Checking a little all available functions in the library I could found the function disableLoopAll(), and I added it before reproduction of track 35... and... it starts to work as expected !

I created inside DFPlayer_LSOS library a function to call this serial command (0x11 0x00) and executing it like this, the issue is solved...:
 
Quote
dfplayer.disableAllLoops();
  delay(100); 
  dfplayer.playPhysicalTrack(track);
This high delay is not so good but without delay the playback of the single track is not executed...

I will continue the investigation!

By the way... I detected a short noise at the end of some soundfont wav tracks (in my previos video is possible to heard them).
I read something about it, and it's related with the metadata included in the wav files. I removed all this metadata and these noises disappears at all !!!

It happens only with my DFPlayer boards?
They are from china, and if they are the origin of my problems I will try to obtain a pair of the original ones.... :-o


Protonerd

This problem is not known to me. If a new playback is started, the previous playback (no matter if looped or single playback) will end. There will be a gapless transition.

It's interesting what you wrote about the metadata. Can you share more info on that? Never encountered this.

If you want to be sure that it is a genuine DFPlayer, look at the main 24-pin chip. It shall be either a YX5200-24SS or YX6300-24SS type.

PedroRS

Hi,

Regarding metadata, I read about it from the developer of this library: https://github.com/jonnieZG/DFPlayerMini.
He mention about it in the readme:
"The DFPlayerMini supports both WAV and MP3 formats. When using WAV files, you should make sure to remove any metadata from the WAV file, since the player will interpret it as noise."
Attached an example screenshot of the metadata included in volume.wav.
After remove this data and save save the file without them "my" dfplayer is not reproducing noise at the end of the track.

By other side, I confirmed the IC mounted in my board and it's not one of the references you mentioned. I added a picture. It's like "JC AA1746CJ1Uxxxxx"Any number is matching... and I cannot find any reference in google about it... :-)

Maybe the firmware version of my boards are different or just olders... I will investigate about it because according datasheet there is a query for software version.

I will post If I have updates.

Protonerd

Hi,

Regarding metadata, I read about it from the developer of this library: https://github.com/jonnieZG/DFPlayerMini.
He mention about it in the readme:
"The DFPlayerMini supports both WAV and MP3 formats. When using WAV files, you should make sure to remove any metadata from the WAV file, since the player will interpret it as noise."
Attached an example screenshot of the metadata included in volume.wav.
After remove this data and save save the file without them "my" dfplayer is not reproducing noise at the end of the track.

By other side, I confirmed the IC mounted in my board and it's not one of the references you mentioned. I added a picture. It's like "JC AA1746CJ1Uxxxxx"Any number is matching... and I cannot find any reference in google about it... :-)

Maybe the firmware version of my boards are different or just olders... I will investigate about it because according datasheet there is a query for software version.

I will post If I have updates.
This certainly does not look like a genuine DFPlayer... where did you get it? The DFPlayer chips are from a Chineese company called YX and the 2 products mentioned are the only ones mounted on genuine DFPlayer parts.

PedroRS

I bought them from Aliexpress. But there are a lot of sellers offering this product.
Exactly this one in my case: https://es.aliexpress.com/item/5Pcs-DFPlayer-Mini-MP3-Player-Module-For-Arduino/32750446150.html?spm=a2g0s.9042311.0.0.3BHe06
Of course the chip I received is not the one you can see in the pictures. They are showing DFRobot module, same as the original com DFRobot.com

I will order form another seller or the original ones. In Aliexpress I could see customer pictures of the product and the mounted IC are the YX one.

xl97

#717
Mar 01, 2018, 11:54 pm Last Edit: Mar 02, 2018, 06:50 pm by xl97
I ordered some DFPlayers to play with as well..

stand alone used with an Arduino, not a completed DIYino board to be clear.

They are legit boards/chips..

I have 1 hardware question and some software questions if anyone has dealt with this, I'd appreciate some feedback.

I currently get a loud POP from the speaker conected to the DFPlayer when the project is powered on/off..

Audio playback once powered up is fine.

Has anyone had this issue?  And what was your fix?  I read about a MOD to the DFPlayer board itself.. (but was hoping for alternate solutions?)


Secondly..  (I'm currently using the DFRobot lib, but will use another if meets my needs and has documentation about the functions/how to use them..etc)..

How are people detecting the 'end' of the file playback?  (ie: playback completion?)

I am currently attempting this as so:

I only need to know when track '2' is done playing (which is only set to be played once)... so I can automatically trigger another file to play an in infinite loop..

currentTrack is var to hold the currentTrack playing
doCompletion check is a var so the 'check' only happens one time in my loop.

Code: [Select]
if(currentTrack == 2 && doCompletionCheck == true){
    if(myDFPlayer.available()) {
       if(isFinished(myDFPlayer.readType(), myDFPlayer.read()) == 1){           
        //Serial.println(F(">>> PLAYBACK COMPLETE <<<"));       
        currentTrack = 3;
        doCompletionCheck = false;   
        myDFPlayer.loop(3);                         
      }             
    }
}


I have tried
readState()
readType()...

and combinations of both..

I found the serial output seems correct, but the audio gets 'janky'... 

project summary:
press button, triggers 001.wav to play (once)
if button is still being pressed and 001.wav is complete,..trigger 002.wav to play immediately, and loop forever (until button is released)
when button released, play 003.wav file (once)..

I have/am experiencing the same issue as PedroRS is....
Is there a proper procedure/order when playing a file one time and playing a looping file.. and then going to another file to play it once?

sometimes the 001.wav doesnt trigger
after running the looped file for a while, sometimes the 003.wav file doesnt play.. or the 001.wav doesnt play when the button is pressed again.

I -feel- like there is supposed to a proper way to 'stop' the files from playing before calling a new one to play?  (but sometimes it DOES work)..

I have no delays in my sketch, its a FSM type of approach...

The above is even more prevalent when I added in some Neopixels..  (more audio playback issues)

Any ideas? or suggestions?

Is there any specific documentation about the other DFPlayer classes out there? DIYino or neskweek variant?  (I'm looking for some documentation of the public methods, and what they do/examples of usage)..

Maybe these have built in 'watch dogs' for when I file completes playback? 



Update question:  Has anyone else ran into issues while using NeoPixels, and serial comm. with the DFPlayer?  The NeoPixel lib (form my understanding) disables interrupts during its updating of the led strip...  disabling of interrupts causes issues with serial communication (which is needed for communicating to the DFPlayer)..   what has everyone been doing to address this issue?  Different approach? Different libraries? (although I'm not sure if you can work around the timing requirements of the Neopixels)..

Thanks!



@Protonerd

Yikes!  Sorry I didnt realize until now this was a gallery post!!  (sorry)..
I just saw others discussing their component issues..etc..etc..  and posted.
I can move it if you like.

Protonerd

Good news for all those who want to have a known-good module with a proven architecture, and that for a very friendly price:

I proudly and happily announce the newest member of my Arduino compatible family of boards, the

DIYino Stardust V3 (NEW!!!)





More info can be found here:

Link to Stardust V3 thread

PedroRS

Hi guys

I'm building a homebrew (right now as prototype using Aurduino UNO) + neopixel strip version.
Final target is to use 18650 battery but currently I'm using laboratory power supply fixed to 5V.

After configuring the OS and burn the code mainly all seems working fine. Congratulations Protonerd !!!!!  :smiley-yell:

But operating it a little bit I found one audio issue.
SOME of the sounds keep in infinite loop after playing them. For example the saber ignition off or some config menu voices. I can solve the issue provoking another audio execution or rebooting.

Are someone facing a similar problem?

I could notice some uP reboots navigating through config menu always including some strange noise in loop as well... but I'm not sure if it's related or not.

I'm using the serial resistor in DFPlayer RX line to adapt arduino tx 5V.

Thanks in advance !!!
Pedro.-
Replying myself.... and just to help somebody facing same issue.

I confirmed the route cause of problem with DFPlayers mounting non XY devices (they have a lot of incorrect behaviors).
After replace in my modules the IC with an XY all is working as expected (audio loop stops, metadata in wav files are not provoking noises, and no more hung ups while navigating the config menu).
Seems like a firmwares issue or similar...

Regards!

Go Up