I2S mic to USB audio (nRF5 SDK v17.0.2)

Hello,

nRF5 SDK v17.0.2, Keil5

USB audio demo and I2S demo,

i2s cannect two mic(L and R),  16bit 48K STEREO,

how to put i2s data to usb audio?

i add function to USB audio demo as follow:

uint16_t usb_put_data(const uint16_t* p_buff, uint16_t size)
{
 	ret_code_t ret = app_usbd_audio_class_tx_start(&m_app_audio_microphone.base, p_buff, size*2);
 	if (NRF_SUCCESS == ret)
	{
		//bsp_board_led_invert(LED_AUDIO_RX);
	}
	return size;
}

don't know if it sucess, so some audio data lost.

it note This function should be called in reaction to a SOF event.

where the SOF?

int hp_sof_ev_handler(uint16_t framecnt)

or 

usbd_user_ev_handler(app_usbd_event_type_t event)  ---> case APP_USBD_EVT_DRV_SOF:

   How to do it specifically?

      

Best regards

Parents Reply
  • call app_usbd_audio_class_tx_start() got return code 17 when failed,

    total count: successed 12402, got APP_USBD_AUDIO_USER_EVT_TX_DONE  12401, failed 10578.

    failed means lost data, if call again in DOWN event maybe repeat data or wrong order.

      

    is our a old project use nRF52840,  Too many functions to migrate to Zephyr.

    please help slove it.

Children
No Data
Related