cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
319 Views
Registered: ‎12-04-2018

Audio through HDMI IP cores

I am working on a project that I need to get the video and audio from hdmi rx ss and sends them to hdmi tx ss and then see the video and hear the audio from the screen which is connected to hdmi port. I can get the video with no issue but the audio is not working as expected.

The HDMI RX Subsystem should take the audio and sends parallel audio to I2S transmit IP core and then the I2S transmit send the serialized audio to I2S Receive IP and from I2S receive the parallel audio data goes to HDMI TX Subsystem. The HDMI TX Subsystem should take audio streams and transfers it to an HDMI stream. The stream is then forwarded to the video PHY layer and I should be able to hear the audio from the screen connected to the HDMI port.

I inserted multiple logic analyzer (ILA) cores in the design. I see the parallel data on the output of hdmi rx ss, I see the serialized data in the output of the i2s transmit and I see the parallel data in the input of HDMI tx ss but I do not hear any audio coming out of the screen.

Does anyone used HDMI IP cores for audio before ? Is there an example of the audio that I can use as a reference ? Does anyone have any idea what can be wrong ?

 

Tags (3)
0 Kudos
3 Replies
Highlighted
Moderator
Moderator
223 Views
Registered: ‎04-09-2019

Hello @m.yaghmai ,

Could You please check our pass through example design with I2S audio developed on ZCU102 board. The same was addressed in the Chapter - 6, example design section of PG236.

Kindly go through the example design and let me know If You have any concerns against to this case.

With Regards,

Ashok.

Tags (2)
Forum I2S Audio.JPG
0 Kudos
Highlighted
Contributor
Contributor
189 Views
Registered: ‎12-04-2018

Hello @ashokkum 

Thank you very much for the suggestion. I do not have the ZCU102 development board but I checked the example design in the document you suggested. The issue is in HDMI TX SS when it receives the AXI audio and needs to converts it back to HDMI stream. As I mentioned before, the audio goes all the way to hdmi tx subsystem and I see the parallel data on the hdmi tx subsystem audio input(AUDIO_IN_tdata) but I do not hear any audio coming out of the screen which is connected to it. Is there any specific configuration that needs to be done on hdmi tx ss for audio ? 

0 Kudos
Highlighted
Contributor
Contributor
77 Views
Registered: ‎12-04-2018

Hello,

Does anybody have a suggestion for my issue ?

I started playing with audio Infoframe on SDK and now I have some audio through HDMI but with so much noise on it. so for example I hear the music I play but with so much noise on top of the music.

Is there any specific paramet I need to set ?

This is what I have in SDK : 

 

 

// -------------------------------------------------------------------
// Send Vendor Specific InfoFrame
void SendVSInfoframe(XV_HdmiTxSs *HdmiTxSsPtr)
{
	XHdmiC_VSIF *VSIFPtr;
	VSIFPtr = XV_HdmiTxSs_GetVSIF(HdmiTxSsPtr);

	XHdmiC_Aux Aux;

	(void)memset((void *)VSIFPtr, 0, sizeof(XHdmiC_VSIF));
	(void)memset((void *)&Aux, 0, sizeof(XHdmiC_Aux));

	VSIFPtr->Version = 0x1;
	VSIFPtr->IEEE_ID = 0xC03;

	if (XVidC_IsStream3D(&(HdmiTxSsPtr->HdmiTxPtr->Stream.Video))) {
		VSIFPtr->Format = XHDMIC_VSIF_VF_3D;
		VSIFPtr->Info_3D.Stream = HdmiTxSsPtr->HdmiTxPtr->Stream.Video.Info_3D;
		VSIFPtr->Info_3D.MetaData.IsPresent = FALSE;
	} else if (HdmiTxSsPtr->HdmiTxPtr->Stream.Video.VmId ==
					   XVIDC_VM_3840x2160_24_P ||
			   HdmiTxSsPtr->HdmiTxPtr->Stream.Video.VmId ==
					   XVIDC_VM_3840x2160_25_P ||
			   HdmiTxSsPtr->HdmiTxPtr->Stream.Video.VmId ==
					   XVIDC_VM_3840x2160_30_P ||
			   HdmiTxSsPtr->HdmiTxPtr->Stream.Video.VmId ==
					   XVIDC_VM_4096x2160_24_P) {
		VSIFPtr->Format = XHDMIC_VSIF_VF_EXTRES;

		/* Set HDMI VIC */
		switch(HdmiTxSsPtr->HdmiTxPtr->Stream.Video.VmId) {
			case XVIDC_VM_4096x2160_24_P :
				VSIFPtr->HDMI_VIC = 4;
				break;
			case XVIDC_VM_3840x2160_24_P :
				VSIFPtr->HDMI_VIC = 3;
				break;
			case XVIDC_VM_3840x2160_25_P :
				VSIFPtr->HDMI_VIC = 2;
				break;
			case XVIDC_VM_3840x2160_30_P :
				VSIFPtr->HDMI_VIC = 1;
				break;
			default :
				break;
		}
	} else {
		VSIFPtr->Format = XHDMIC_VSIF_VF_NOINFO;
	}
	Aux = XV_HdmiC_VSIF_GeneratePacket(VSIFPtr);
	XV_HdmiTxSs_SendGenericAuxInfoframe(HdmiTxSsPtr, &Aux);
}

void SendInfoframe(XV_HdmiTxSs *HdmiTxSsPtr)
{
	u32 Status;
	XHdmiC_AVI_InfoFrame *AviInfoFramePtr;
	XHdmiC_AudioInfoFrame *AudioInfoFramePtr;
	XHdmiC_VSIF *VSIFPtr;

	AviInfoFramePtr = XV_HdmiTxSs_GetAviInfoframe(HdmiTxSsPtr);
	AudioInfoFramePtr = XV_HdmiTxSs_GetAudioInfoframe(HdmiTxSsPtr);

	AudioInfoFramePtr->Version            = 1;
	AudioInfoFramePtr->ChannelCount       = 1;
	AudioInfoFramePtr->CodingType         = XHDMIC_AUDIO_CODING_TYPE_PCM;
	AudioInfoFramePtr->SampleSize         = XHDMIC_SAMPLE_SIZE_24;
	AudioInfoFramePtr->SampleFrequency    = XHDMIC_SAMPLING_FREQUENCY_48K;
	AudioInfoFramePtr->CodingTypeExt      = 0;
	AudioInfoFramePtr->ChannelAllocation  = 0;
	AudioInfoFramePtr->LFE_Playback_Level = 0;
	AudioInfoFramePtr->LevelShiftVal      = 0;
	AudioInfoFramePtr->Downmix_Inhibit    = 0;


	AviInfoFramePtr->Version		= 3;
	AviInfoFramePtr->ColorSpace		= XHDMIC_COLORSPACE_RGB;
	AviInfoFramePtr->ActiveFormatDataPresent = 0;
	AviInfoFramePtr->BarInfo		= XHDMIC_BAR_INFO_NA;
	AviInfoFramePtr->ScanInfo		= XHDMIC_SCAN_INFO_NA;
	AviInfoFramePtr->Colorimetry		= XHDMIC_COLORIMETRY_ITU709;
	AviInfoFramePtr->PicAspectRatio		= XHDMIC_PIC_ASPECT_RATIO_NA;
	AviInfoFramePtr->ActiveAspectRatio	= 0	;
	AviInfoFramePtr->Itc			= 0	;
	AviInfoFramePtr->ExtendedColorimetry = XHDMIC_EXTENDED_COLORIMETRY_YCC_601	;
	AviInfoFramePtr->QuantizationRange = XHDMIC_RGB_QUANTIZATION_RANGE_DEFAULT	;
	AviInfoFramePtr->NonUniformPictureScaling = XHDMIC_NON_UNIFORM_PICTURE_SCALING_NA	;
	AviInfoFramePtr->VIC = 16;
	AviInfoFramePtr->YccQuantizationRange = XHDMIC_YCC_QUANTIZATION_RANGE_LIMITED	;
	AviInfoFramePtr->ContentType	= XHDMIC_CONTENT_TYPE_GRAPHICS;
	AviInfoFramePtr->PixelRepetition= XHDMIC_PIXEL_REPETITION_FACTOR_1;
	AviInfoFramePtr->TopBar		= 0	;
	AviInfoFramePtr->BottomBar	= 0	;
	AviInfoFramePtr->LeftBar	= 0	;
	AviInfoFramePtr->RightBar	= 0	;

	VSIFPtr = XV_HdmiTxSs_GetVSIF(HdmiTxSsPtr);
	Status = (XST_FAILURE);

	if (!IsPassThrough) {
		// Generate Aux from the current TX InfoFrame
		AuxFifo[0] = XV_HdmiC_AVIIF_GeneratePacket(AviInfoFramePtr);
		XV_HdmiTxSs_SendGenericAuxInfoframe(HdmiTxSsPtr, &(AuxFifo[0]));

		int result_SendGenericAuxInfoframe;
		
	AuxFifo[0] = XV_HdmiC_AudioIF_GeneratePacket(AudioInfoFramePtr);
	XV_HdmiTxSs_SendGenericAuxInfoframe(HdmiTxSsPtr, &(AuxFifo[0]));
		SendVSInfoframe(HdmiTxSsPtr);
	} else {
		if(AuxFifoCount > AUXFIFOSIZE) {
			AuxFifoStartIndex = AuxFifoEndIndex;
		}

	// If PassThrough, update TX's InfoFrame Data Structure from AuxFiFO
	while (AuxFifoStartIndex != AuxFifoEndIndex) {
		if(AuxFifo[AuxFifoStartIndex].Header.Byte[0] == AUX_VSIF_TYPE) {
		// Reset Vendor Specific InfoFrame
		(void)memset((void *)VSIFPtr, 0, sizeof(XHdmiC_VSIF));
			XV_HdmiC_VSIF_ParsePacket(&AuxFifo[AuxFifoStartIndex],VSIFPtr);
} else if(AuxFifo[AuxFifoStartIndex].Header.Byte[0] ==
		AUX_AVI_INFOFRAME_TYPE) {
// Reset Avi InfoFrame
(void)memset((void *)AviInfoFramePtr, 0,sizeof(XHdmiC_AVI_InfoFrame));				XV_HdmiC_ParseAVIInfoFrame(&AuxFifo[AuxFifoStartIndex],AviInfoFramePtr);
} else if(AuxFifo[AuxFifoStartIndex].Header.Byte[0] ==
					AUX_AUDIO_INFOFRAME_TYPE) {
// Reset Audio InfoFrame
(void)memset((void *)AudioInfoFramePtr, 0,sizeof(XHdmiC_AudioInfoFrame));
				XV_HdmiC_ParseAudioInfoFrame(&AuxFifo[AuxFifoStartIndex],AudioInfoFramePtr);

}

Status = XV_HdmiTxSs_SendGenericAuxInfoframe(HdmiTxSsPtr,&(AuxFifo[AuxFifoStartIndex]));

/* If TX Core's hardware Aux FIFO is full, break from the while
* loop, retry during the next main while iteration.
*/
if (Status != (XST_SUCCESS)) {
	xil_printf(ANSI_COLOR_RED "HW Aux Full" ANSI_COLOR_RESET"\r\n");
			}

			if(AuxFifoStartIndex < (AUXFIFOSIZE - 1)) {
				AuxFifoStartIndex++;
			} else {
				AuxFifoStartIndex = 0;
			}
		}

		AuxFifoCount = 0;
	}
}

void TxInfoFrameReset(void)
{
	XHdmiC_AVI_InfoFrame *AviInfoFramePtr;
	XHdmiC_AudioInfoFrame *AudioInfoFramePtr;

	AviInfoFramePtr = XV_HdmiTxSs_GetAviInfoframe(&HdmiTxSs);
	AudioInfoFramePtr = XV_HdmiTxSs_GetAudioInfoframe(&HdmiTxSs);

	// Reset Avi InfoFrame
	(void)memset((void *)AviInfoFramePtr, 0, sizeof(XHdmiC_AVI_InfoFrame));
	// Reset Audio InfoFrame
	(void)memset((void *)AudioInfoFramePtr, 0, sizeof(XHdmiC_AudioInfoFrame));

	AviInfoFramePtr->Version = 2;
	AviInfoFramePtr->ColorSpace = XHDMIC_COLORSPACE_RGB;
	AviInfoFramePtr->VIC = 16;
	AviInfoFramePtr->PicAspectRatio = XHDMIC_PIC_ASPECT_RATIO_16_9;
}

 

 

I also attached the hdmi tx subsystem IP configuration.

hdmi_tx_ss.PNG
0 Kudos