VS1053 ogg encoder stop encoding after ogg header is sent

Installing and using VSIDE tools for VLSI Solution's devices that contain a VSDSP signal processor.
Post Reply
cariplex
User
Posts: 3
Joined: Thu 2015-09-03 0:44

VS1053 ogg encoder stop encoding after ogg header is sent

Post by cariplex » Thu 2015-09-03 9:29

I"ve having a problem with the vs1053. I can play sine test. I got the encoder to start encoding using OGG plugin but after it generates the first 690 bytes which i think is the ogg file header because it has the ogg info.

"OggSxV4 ëÜivorbis€>耨OggSxV4)‡Ë;8vorbisVLSI Solution OyENCODER=VS1053 v1.70OggSxV4ýc_Qÿÿÿÿºvorbis....."

Its stops and no further data can be read. All value read from SCI_HDAT1 = 0 ; i'm not using a profile with Vox/Pause After spending days researching this i found this blog post and i realize me and this guy is having the Same exact problem.

viewtopic.php?f=7&t=595

He didn't seem to post a valid fix for the issue because i'm not using any state machine code.

My code is listed below.



hardreset();
SYS_CONSOLE_PRINT("SPI : RESTARTED ENCODER \r\n"); delay_us(300); while(!getDREQ()){};
WRITE_SPI_CMD_REG(SCI_CLOCKF,0xC000); delay_us(20); while(!getDREQ()){};
SYS_CONSOLE_PRINT("SPI : CLOCK [%i] \r\n", READ_SPI_CMD_REG(SCI_CLOCKF));

WRITE_SPI_CMD_REG(SCI_BASS ,0x0000);
SYS_CONSOLE_PRINT("SPI : BASS [%i] \r\n", READ_SPI_CMD_REG(SCI_BASS));

softReset();
SYS_CONSOLE_PRINT("SPI : SOFT RESET [%i] \r\n", READ_SPI_CMD_REG(SCI_MODE));

WRITE_SPI_CMD_REG(SCI_AIADDR,0x0000);

WRITE_SPI_CMD_REG(SCI_WRAMADDR,0xC01A);
SYS_CONSOLE_PRINT("SPI : SCI_WRAMADDR [%i] \r\n", READ_SPI_CMD_REG(SCI_WRAMADDR));

WRITE_SPI_CMD_REG(SCI_WRAM,0x0002);
SYS_CONSOLE_PRINT("SPI : RAM [%i] \r\n", READ_SPI_CMD_REG(SCI_WRAM));

LoadPlugin(encoder_plugin, sizeof(encoder_plugin)/sizeof(encoder_plugin[0]));
SYS_CONSOLE_PRINT("SPI : PLUGIN LOADED [%i] \r\n", sizeof(encoder_plugin)/sizeof(encoder_plugin[0]));

// WRITE_SPI_CMD_REG(SCI_MODE, SM_LINE1 | SM_ADPCM | SM_SDINEW); while(!getDREQ()){}; delay_us(100);
WRITE_SPI_CMD_REG(SCI_MODE, SM_ADPCM | SM_SDINEW); while(!getDREQ()){}; delay_us(100);
SYS_CONSOLE_PRINT("SPI : ENABLEING ENCODING [%i] \r\n", READ_SPI_CMD_REG(SCI_MODE));

WRITE_SPI_CMD_REG(SCI_AICTRL0,0x8000); delay_us(100);
SYS_CONSOLE_PRINT("SPI : SCI_AICTRL0 [%i] \r\n", READ_SPI_CMD_REG(SCI_AICTRL0));


WRITE_SPI_CMD_REG(SCI_AICTRL1,0x0000);
SYS_CONSOLE_PRINT("SPI : SCI_AICTRL1 [%i] \r\n", READ_SPI_CMD_REG(SCI_AICTRL1));

WRITE_SPI_CMD_REG(SCI_AICTRL2,0x0000);
SYS_CONSOLE_PRINT("SPI : SCI_AICTRL2 [%i] \r\n", READ_SPI_CMD_REG(SCI_AICTRL2));

WRITE_SPI_CMD_REG(SCI_AICTRL3,0x0000);
SYS_CONSOLE_PRINT("SPI : SCI_AICTRL3 [%i] \r\n", READ_SPI_CMD_REG(SCI_AICTRL3));

WRITE_SPI_CMD_REG(SCI_AIADDR,0x34); delay_us(100); while(!getDREQ()){}; delay_us(100);

Iv'e verified that i've written to all registers successfully because the console prints back what i wrote in.

I also tried setting my microcontroller spi clock speed is set to 1 to 10 mhz clock speed.
I receive the header and it stops for between 1 to 10 mhz buf if i go higher then the information returned seems to be invalid because it no longer has the header information in it.


I've been on this trying to get it to work for the past 3 weeks can you please help me resolve this issue.
Last edited by cariplex on Sat 2015-09-05 23:28, edited 2 times in total.

cariplex
User
Posts: 3
Joined: Thu 2015-09-03 0:44

Re: VS1053 ogg Not starting recording

Post by cariplex » Sat 2015-09-05 23:26

i want to also add that pcm encoding works with no issues.


The ogg plugin is doing the same thing as the pcm without the imafix patch.


Is there a patch to start OGG encoding ???

Also sometimes i hear audio in headphones and other time i hear a tone signal like a sine wave

User avatar
Henrik
VLSI Staff
Posts: 1107
Joined: Tue 2010-06-22 14:10

Re: VS1053 ogg encoder stop encoding after ogg header is sen

Post by Henrik » Tue 2015-10-20 11:28

Hello!

Have you been able to sort out your issue? If not, could you tell the exact profile name you are using as well as a dump of what exactly you have been able to receive? Also, could you share your data receive loop?

Some things to check:
- Make sure your softReset() function doesn't load any patches
- When you write to SCI_WRAM, i recommend that you not read back through SCI_WRAM. That operation may have unexpected side effects

Apart from this, your code looks fine. And as an answer to your question, the Ogg Vorbis encoder is a stand-alone application, so you should not load any separate pieces of VS1053b software (including patches) when running it.

Kind regards,
- Henrik
Good signatures never die. They just fade away.

Edzelf
User
Posts: 2
Joined: Wed 2016-05-11 11:45

Re: VS1053 ogg encoder stop encoding after ogg header is sent

Post by Edzelf » Tue 2016-05-17 17:54

Cariplex,

You are probably using a Chinese board. They have GPIO[0] and GPIO[1] floating.
Set them to LOW by:
wram_write ( 0xC017, 3 ) ; // GPIO DDR = 3
wram_write ( 0xC019, 0 ) ; // GPIO ODATA = 0

Ed.

Post Reply