Home Forums Sparkfun MP3 Shield Library Support Forum Occasional Pops/Glitches

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3497
    Anonymous
    Inactive

    Hi there –

    I posted a month or so ago, using Michael Flaga’s random code. I managed to get everything up and working with an older version of the Arduino IDE.

    The issue now, though, is that the audio does not play completely smoothly. Every minute-or-so, erratically, there will be a pop or glitch in the audio. I’m wondering if there is a good way to increase the buffer size or smooth out the playback. Would it help if the files were uncompressed?

    Thank you.

    #3503

     

    You can try to increase the SFEMP3Shield::mp3DataBuffer from 32 to larger values. The minimum needs to be 32.  http://mpflaga.github.io/Sparkfun-MP3-Player-Shield-Arduino-Library/class_s_f_e_m_p3_shield.html#ab1027c13d5feef5d3b928f4d53e1f602

    hmm, “pop or glitch”… is odd. The MP3 file is frame of packets. There should not be glitches. It has been my experience if there is a lack of real time (too busy doing other things) then there are short pauses of silence, until the buffers catch up and resume playing. pops are an indication of lost data.

    FYI, the SdFat library reads the Card in chunks of 500 Bytes at a time in to local cache of RAM. and refills that as it needs to. And reads the next 32 it will send to the 1053. Where the 1053’s buffer is 32. So sending more may exceed the 1053’s buffer and sending less may cause more cycles to fill the 1053. But it is simple enough to try and mess with.

    I would be more suspiciuos of any periods of your code that may disable interrupts. with the cli() or noInterupt() commands that do something and then re-enable with sei() or interupt() commands. Excessive use of these cause the buffer to stall. It may be possible there are other libraries that you are using that may intermittently block interrupts. Example the NeoPixel library. If well written they can block for very short periods and then release. Others may not.

    #3538
    Anonymous
    Inactive

    I also suffered from ‘pops & glitches’. In my case it was caused by some connections working themselves loose. I resolved the problem by checking everything was a tight fit and soldering where possible.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.