distortion in VS1063 output

Writing software for systems that use VLSI Solution's devices as slave codecs to a host microcontroller.
Post Reply
jimlake
User
Posts: 15
Joined: Tue 2014-04-08 0:04

distortion in VS1063 output

Post by jimlake »

I have a project that uses a VS1063 to play mp3 files under the control of an 8 bit AVR. The schematic is attached. The system works, but the output audio is badly distorted, and I need some assistance determining why. I have included copies of the input files (90.mp3 and 9.mp3). I have also attached a .WAV of the output (99.WAV). I get the distortion regardless of whether the output is amplified or not. If I take the output directly from the output (LEFT or RIGHT and GBUF), the distortion is present. So, its coming from the DSP. The mp3 files are stored on flash, but I have verified that they are accurate.

I also attached the software for the micro controller (AVR1284P) running at 16.384Mhz.

Any wisdom on the source of the distortion will be appreciated.
Attachments
LMS.c
(13.49 KiB) Downloaded 247 times
99.wav
(453.28 KiB) Downloaded 217 times
9.mp3
(10.63 KiB) Downloaded 206 times
90.mp3
(11.45 KiB) Downloaded 233 times
Spoken Link V1.pdf
(110.83 KiB) Downloaded 643 times
User avatar
pasi
VLSI Staff
Posts: 2120
Joined: Thu 2010-07-15 16:04

Re: distortion in VS1063 output

Post by pasi »

Have you set the SCI_CLOCKF register to a suitable value? (After reset the chip is running at 1.0x clock. MP3 decoding needs 3.0x to decode all samplerates and bitrates.)

From the schematics:
- RX should be pulled up (or connected to IOVDD, connecting to TX is an easy patch).
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
User avatar
Henrik
VLSI Staff
Posts: 1294
Joined: Tue 2010-06-22 14:10

Re: distortion in VS1063 output

Post by Henrik »

Hello!

That is a weird kind of distortion.

Your schema seems to have correct line out components so I don't see a problem there. Your playback speed seems to be slightly too slow, so Pasi's suggestion to check what you have in VS1063 register SCI_CLOCKF is a good one. Still, I am not sure if the artifacts from a slow clock should sound like that.

Kind regards,
- Henrik
Good signatures never die. They just fade away.
User avatar
Henrik
VLSI Staff
Posts: 1294
Joined: Tue 2010-06-22 14:10

Re: distortion in VS1063 output

Post by Henrik »

Hello again!

I have just verified with a VS1063, and I believe Pasi's theory might be right: when I didn't set SCI_CLOCKF (or set it to 0), I got a sound that was very similar to what you had in 99.wav.

Kind regards,
- Henrik
Good signatures never die. They just fade away.
jimlake
User
Posts: 15
Joined: Tue 2014-04-08 0:04

Re: distortion in VS1063 output

Post by jimlake »

Pasi, Henrick,

Thank you for taking a look at this. I changed SCI_CLOCK_F to 0xB0000, as suggested in the data sheet. This does seem to have corrected the distortion. I am surprised because my mp3 files are 128KBS, which I have played successfully in the past on a VS1063 without distortion despite the fact that I did not alter SCI_CLOCK_F. But that was a different platform so perhaps something else is affecting it.
User avatar
pasi
VLSI Staff
Posts: 2120
Joined: Thu 2010-07-15 16:04

Re: distortion in VS1063 output

Post by pasi »

128kbit/sec with a lower samplerate or in mono would probably decode just fine with the default 1.0x clock.

vs1063a has a slightly more accurate mp3 decoder, so it takes a bit more processing power than the previous chips (around 30MHz vs. 24MHz).
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
jimlake
User
Posts: 15
Joined: Tue 2014-04-08 0:04

Re: distortion in VS1063 output

Post by jimlake »

Pasi,
Your comment above suggests that with a 12.288Mhz crystal on the VS1063, one should always increase the clock by at least 2.5 to decode mp3's (12.288 x 2.5 = 30.7). Is that a correct interpretation of your comment?
User avatar
pasi
VLSI Staff
Posts: 2120
Joined: Thu 2010-07-15 16:04

Re: distortion in VS1063 output

Post by pasi »

30MHz was from memory, but seems to match the Clock Speed Requirements chapter of the vs1063 datasheet. I would use 3.0x if you are only going to use mp3, and higher if you use other formats. Usually a fixed clock is better than clock adder if you use HE-AAC.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
Post Reply