Search found 1765 matches

by pasi
Yesterday 15:13
Forum: Microcontroller Software
Topic: VS1053 sample rate fine tuning value changes after a while
Replies: 12
Views: 447

Re: VS1053 sample rate fine tuning value changes after a while

I think there is one race condition that could happen with the current AdjustRate() function and bit errors in the mp2 header. 1. Bit error happens, mp2 decoder sees the rate is different than in its previously decoded frame and sets rate, SCI_AUDATA is written. 2. AdjustRate() reads SCI_AUDATA. 3. ...
by pasi
Fri 2021-02-26 14:50
Forum: Microcontroller Software
Topic: VS1053 sample rate fine tuning value changes after a while
Replies: 12
Views: 447

Re: VS1053 sample rate fine tuning value changes after a while

Another question: how fast is the SDI FIFO actually filling up? It's hard to guess from the graphs. I think the only way for the buffer to start filling up is when the vs10xx plays the audio too slowly. This would indicate too slow samplerate. An error in the samplerate field of the mp2 stream would...
by pasi
Thu 2021-02-25 12:31
Forum: Microcontroller Software
Topic: VS1053 sample rate fine tuning value changes after a while
Replies: 12
Views: 447

Re: VS1053 sample rate fine tuning value changes after a while

There's some register that indicate audio frames drop count or something like that... to verify if VS1053 has discarded some audio frames? No, when there's an error, the next frame header is found and decoding continues. Fortunately Layer II frames are self-contained (layer III uses bit reservoir),...
by pasi
Wed 2021-02-24 15:36
Forum: Microcontroller Software
Topic: VS1063a MP3 Encode Not Working. Decoding just fine
Replies: 10
Views: 808

Re: VS1063a MP3 Encode Not Working. Decoding just fine

Your WriteSci() in the signal handler can occur at any time, even during an ongoing SCI operation.

See Hannu's suggestion above about setting a variable in the signal handler instead (and declare it volatile to be certain), and only performing SCI and SDI operations in the main loop.
by pasi
Wed 2021-02-24 11:35
Forum: Microcontroller Software
Topic: VS1053 sample rate fine tuning value changes after a while
Replies: 12
Views: 447

Re: VS1053 sample rate fine tuning value changes after a while

NB: I decode an MPEG 1 Layer II stream Is the stream guaranteed to be error-free? Are you able to store the data you send to vs1053b? However, I would expect bit errors to cause audio frames to be discarded, and then the finetune value should become negative to play the audio slower to account for ...
by pasi
Tue 2021-02-23 16:50
Forum: Microcontroller Software
Topic: VS1053 sample rate fine tuning value changes after a while
Replies: 12
Views: 447

Re: VS1053 sample rate fine tuning value changes after a while

Temperature (and voltage) variation affect the oscillation frequency. Capacitance also affects the oscillation frequency - how well protected is your card? Is it in a metal enclosure? The card being a different temperature would explain some long-term variance. During winter the air is quite dry and...
by pasi
Tue 2021-02-23 16:31
Forum: Microcontroller Software
Topic: VS1063a MP3 Encode Not Working. Decoding just fine
Replies: 10
Views: 808

Re: VS1063a MP3 Encode Not Working. Decoding just fine

Can you post the code which sets SM_CANCEL? I think the problem must be there.
by pasi
Mon 2021-02-22 14:55
Forum: Slave Decoder Applications
Topic: VS1063 play G722 stream
Replies: 5
Views: 1432

Re: VS1063 play G722 stream

Hi, I thought the decoder would eventually get back in sync, because it has (should have) code to saturate the states, and thus be able to pick up decoding mid-stream. We'll need to take a look at that. Edit : In my tests of starting the decoding at various parts of my test g722 file it worked perfe...
by pasi
Mon 2021-02-15 12:27
Forum: Microcontroller Software
Topic: VS1063a MP3 Encode Not Working. Decoding just fine
Replies: 10
Views: 808

Re: VS1063a MP3 Encode Not Working. Decoding just fine

Which routine is run when you want to end encoding?

When you cancel the encoding, make sure you are not clearing the SM_ENCODE bit in SCI_MODE.

(Also, after finalizing, give a software (or hardware) reset before loading the patches package.)
by pasi
Thu 2021-02-11 14:05
Forum: Microcontroller Software
Topic: VS1063a MP3 Encode Not Working. Decoding just fine
Replies: 10
Views: 808

Re: VS1063a MP3 Encode Not Working. Decoding just fine

Does that mean that SCI_RECWORDS never goes to 0 after setting SM_CANCEL?

The data FIFO could wrap if you read too many words, but I don't see any problem with your code. (Could happen e.g. reading RECWORDS immediately after reading RECDATA.)