VS1063a IMA-ADPCMA cant adjust play rate

Writing software for systems that use VLSI Solution's devices as slave codecs to a host microcontroller.
Post Reply
Posts: 2
Joined: Tue 2018-10-02 8:13

VS1063a IMA-ADPCMA cant adjust play rate

Post by micwik » Tue 2018-10-02 8:49


I'm using VS1063a in a project with IMA-ADPCMA and AEC (echo cancel).
As this is a streamed application I need to adjust play speed to avoid buffer over/under -run.

According to the specification there is a play rate adjust register at 0x1e07:1e08.
Trying this register, I can't adjust it a small amount. Only when I write big enough number at play rate adjust it is affected and sounds like donald duck.
The lowest affected value is 0x7a11d (7 is high 16-bits).
I have tried to also update AUDATA after play speed adjust (as in example for DS1053), but no luck.
Writing 0x60 to AIADDR has also been mentioned, but it results in no sound at all. This register holds the plugin pointer so it should probably stay at 0x50 as specified.

I would appreciate any help or pointer in the right direction.

Used code to change speed adjust register:

Code: Select all

#define SPI_AUDATA      	0x05   
#define SPI_WRAM        	0x06   
#define SPI_WRAMADDR    	0x07   
#define AUDATA_VAL		0x1f40		//Sampling 8K, mono audio

u16 parTab[ RSPAR_TABMAX + 1 ];

		VS1003B_CMD_Write(SPI_WRAMADDR, 0x1e07);
		VS1003B_CMD_Write(SPI_WRAM, parTab[ RSPAR_SPEED_ADJ]);
		VS1003B_CMD_Write(SPI_WRAMADDR, 0x1e08);

User avatar
VLSI Staff
Posts: 1511
Joined: Thu 2010-07-15 16:04

Re: VS1063a IMA-ADPCMA cant adjust play rate

Post by pasi » Tue 2018-10-02 12:00

The playspeed finetune is only intended for decoding mode.

In the codec mode the playback rate is tightly coupled with the encoding rate, and with AEC they must be exactly the same for the AEC to work.

Unfortunately adjusting the encoding rate isn't straightforward, and the most practical way of trying to adjust the XTAL input frequency isn't practical at all in most cases. (The easiest hack is to drop and double samples in the input and output streams.)
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Posts: 2
Joined: Tue 2018-10-02 8:13

Re: VS1063a IMA-ADPCMA cant adjust play rate

Post by micwik » Mon 2018-10-15 1:19

Thanks for the reply.
That helped a lot.

Post Reply