VS1003b SPI Audio In-Audio Out Problem

Discussion about writing software for VS1005 and the VSOS Operating System. Also posts about VS1005-related hardware design and device drivers should be posted here.
Post Reply
HanjinData
User
Posts: 2
Joined: Wed 2017-11-29 11:04

VS1003b SPI Audio In-Audio Out Problem

Post by HanjinData »

Hello Everyone;
I am using the VS1003b SPI Audio IN-Audio Out board. I followed the reference source code of VLSI which is available pdf file(http://www.vlsi.fi/fileadmin/software/V ... 03_aec.pdf) but it is not properly working. When I used Audio IN using LINE connector and Output Audio (speaker sound) is not clear. Sound output is coming but not clear. I am searching the VS1003b SPI Audio in-Audio out sample code. And I request for correct source code if someone has. I hope, I will get reply. Thank you.



Korea/South
Last edited by HanjinData on Mon 2017-12-11 11:54, edited 1 time in total.
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

Re: VS1003b SPI Audio In-Audio Out Problem

Post by Panu »

Hi!

Can you describe further which PCB you are using (please post a web link) and which firmware you are using (please post a web link to download file). Can you explain further what does it mean that the output is "not clear"... what kind of problems there are? (noise, hiss, too low volume, extra sounds etc)

-Panu

PS. This message is in the wrong forum. It doesn't belong to the VS1005 forum because it's not about VS1005. It will be moved to "Audio and DSP software" forum at viewforum.php?f=7 soon.
HanjinData
User
Posts: 2
Joined: Wed 2017-11-29 11:04

Re: VS1003b SPI Audio In-Audio Out Problem

Post by HanjinData »

Hello Mr. Pau;
Thank you for allow and reply in forum of my post. I have already posted there the output sound from VS1003b eva board is not clear when I input line/speaker sound. Clear mean, noisy and sound volume is so low.
I am going to send VS1003b link address here and request to check :
https://www.openimpulse.com/blog/produc ... icrophone/

I think, there is not problem about HW because when I play the sound file from controller board to VS1003b by SPI method, it has not problem.
We need AEC application for test. And below, I am going to send question and used code which has same problem.

Software question

1-Request to check Below AEC application code?
2- Does it necessary wav header code in RIFF_header_play(); function ?
3- We need to support to check the Line OUT - Earpphone and Line IN - music code?
4- According to the AEC system block diagram, does below program correct or we need to develop more?
5- Could VLSI support to provide AEC application code?


Test program

Code: Select all

  	Vs1003_Init(); 
  	Mp3Reset();
  	Vs1003SoftReset();
	LoadUserCode();
	Vs1003_CMD_Write(SPI_VOL, 0x1010);
//	wav_play();		          // for H/W test (*.wav play in the TFCARD)
	VsSineTest();  			 // TEST SOUND

//  AEC application code
	Vs1003_CMD_Write(SPI_AICTRL1, 0);  	       //autogain
	Vs1003_CMD_Write(SPI_MODE, 0x4800);	         //new mode, select line
	Vs1003_CMD_Write(SPI_AICTRL0, 0x0002);	 //default
//	Vs1003_CMD_Write(SPI_AICTRL0, 0x0012);	 //default
	Vs1003_CMD_Write(SPI_WRAMADDR, 0x0000);	  //flags off
	Vs1003_CMD_Write(SPI_AIADDR, 0x0030);	         //start application

// 	RIFF_header_play();			   // need wav header or not?  

	while(1){
/**
		if(SamplesFromFarEnd()) {
			reg = GetSampleFromFarEnd();
			SPI_ReadWriteByte(reg); // Send data to Speaker through SDI 
		}
**/

// Line OUT - Earpphone 
		 if (sflag) {
			LED2 = ~LED2;			        // for test
			MP3_DCS_SET(0);   		         // _DATA_CS=0;
			SPI_ReadWriteByte(recbuf[0]); 	// Send data to Speaker through SDI 
			SPI_ReadWriteByte(recbuf[1]); 	// Send data to Speaker through SDI 
			SPI_ReadWriteByte(recbuf[2]); 	// Send data to Speaker through SDI 
			SPI_ReadWriteByte(recbuf[3]); 	// Send data to Speaker through SDI 
			MP3_DCS_SET(1);   		       // DATA_CS=1;
			MP3_CCS_SET(1);   		      // CMD_CS=1; 
			sflag = 0;
		 }

// Line IN  - music 
		w=Vs1003_REG_Read(SPI_HDAT1);					
		if(w >= 2) {
			LED3 = ~LED3;			                        // for test	
			idy=0;
			while(idy< 2*2){
				w=Vs1003_REG_Read(SPI_HDAT0);	// 
				recbuf[idy++]=w>>8;	  	                // low byte
				recbuf[idy++]=w&0xFF;		              // high byte
			}
			sflag = 1;
		}
/**
		if (saveConversation) {
			w=Vs1003_REG_Read(SPI_AICTRL3);					
			if(w >= 2) {
				LED3 = ~LED3;		
				idy=0;
				while(idy < 2*1){
					w=Vs1003_REG_Read(SPI_AUDATA);	// 
					recbuf[idy++]=w>>8;	  	// low byte
					recbuf[idy++]=w&0xFF;		// high byte
				}
			}
		}
**/
	}
}
Post Reply