Gapless looping of files on VS1000

Designing hardware that use VLSI Solution's devices as the system controller for the entire design.
User avatar
pasi
VLSI Staff
Posts: 2120
Joined: Thu 2010-07-15 16:04

Re: Gapless looping of files on VS1000

Post by pasi »

Great that you have progress!

Are you playing from the NAND in both cases? Or is the difference between a version with file storage in NAND FLASH and SPI FLASH?

The gapless code has been tested with a SD card, so I would not expect to see such a big gap when data is loaded from SPI FLASH. (Maybe you miss some inits when you boot from SPI FLASH.)

Code: Select all

    clockX = 2;
    InitAudio(); /* goto 1.0x */
    PERIP(INT_ENABLEL) = INTF_RX | INTF_TIM0;
    PERIP(INT_ENABLEH) = INTF_DAC;
    clockX = 7;
    SetRate(48000);/*set 3.5x*/
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
bLG
User
Posts: 11
Joined: Tue 2016-06-07 23:02

Gapless looping of files on VS1000+ File "Jumping"

Post by bLG »

Hi Pasi,

I could use a little advice here. We are encountering a strange bug in VS1000 code.
As you may remember, we are using the voice mail telephony package with the gapless code integrated.
Gapless looping of files works great, thanks for your help in making that work :D .

We are observing some strange behavior.

When we loop file "a" and then increase the volume in slow ramp steps, on rare occasions, the codec plays file "b" for 5 seconds at higher volume step and then jumps back to file "a" at correct volume level.

The file system in codec seems very simple, so that seems like unlikely root cause. I am checking to see if the file length to loop exactly coincides with volume step if this could be causing the instability.

One more detail, when the codec plays the wrong file (briefly), it always play the same wrong file, regardless of what the desired .ogg file was.

Any insights or testing advice to help with this would be greatly appreciated.

Kind regards,

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

Re: Gapless looping of files on VS1000

Post by pasi »

What are the bitrates of the files? It may give some hints in what the 5 seconds might represent.

Do you change the volume while the file is looping, or is the loop exited and then restarted?

How are you changing the volume?

Volume change should be just a simple call to SetVolume() and this not affect anything in the decoding or file handling.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
bLG
User
Posts: 11
Joined: Tue 2016-06-07 23:02

Re: Gapless looping of files on VS1000

Post by bLG »

Thanks Pasi.

The file bitrates are low: 55 kbps to 67 kbps.

Yes, we do change the volume while looping. We slowly ramp the volume to the target volume using the SetVolume() command.

I would like to add few more observations. The duration of the wrong file being played is actually just ~ 3 seconds, not 5 seconds as I previously reported.

I have now observed it happening during the SetVolume command while looping and also when the unit shouldn't be playing any audio file.

My next step is to begin serial monitoring of the commands our MCU is sending to the VS1000.

If you have any other suggestions to help me track down this spurious noise, I would appreciate it.

Thanks in advance,
David
User avatar
pasi
VLSI Staff
Posts: 2120
Joined: Thu 2010-07-15 16:04

Re: Gapless looping of files on VS1000

Post by pasi »

3 seconds of 60kbit/sec means 44 disk blocks, so it certainly is not coming from any buffers.

Maybe you can put debug prints around the PlayCurrentFile() call (or whichever is used for playing a file) to see if it gets called, and then try to debug why.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
Post Reply