This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

USB Audio SOF

I'm using SDK 15.2 and trying to set up a USB mic class. I am having trouble getting the SOF audio interrupt to fire.

I initialize the app_usbd module with the configuration for enable_sof set to true. I register an sof event handler with app_usbd_audio_sof_interrupt_register() like in the SDK USB Audio example which sets it up for headphones. The SOF event never triggers my sof event handler for the microphone. Instead, I do get SOF events inside usbd user event handler where I can start audio transmission. I have tried this with APP_USBD_CONFIG_SOF_HANDLING_MODE set to 1 (compress queue) as well as 2 (Interrupt). 

Am I missing some configuration?

  • Hello,

    Can you share code and config?

    Are you getting SOF events in hp_audio_user_ev_handler instead of hp_sof_ev_handler?

    Best regards,
    Kenneth

  • Hi,

    Unfortunately, I cannot share the code since it's tightly coupled with the rest of our system. I don't have a headphones class, only microphone. I am getting SOF events inside usbd_user_ev_handler().

    Here are relevant pieces of code:

    static void mic_sof_ev_handler(uint16_t framecnt);


    /* Initialize the usbd library */
    static const app_usbd_config_t usbd_config = {
    .ev_state_proc = usbd_user_ev_handler, .enable_sof = true};
    APP_ERROR_CHECK(app_usbd_init(&usbd_config));

    app_usbd_class_inst_t const *class_inst_mic =
    app_usbd_audio_class_inst_get(&m_app_audio_microphone);
    APP_ERROR_CHECK(app_usbd_audio_sof_interrupt_register(class_inst_mic, mic_sof_ev_handler));
    APP_ERROR_CHECK(app_usbd_class_append(class_inst_mic));

    app_usbd_power_events_enable();


  • I have added this to internal Jira (NRFFOETT-2203), though I don't have an estimate of when the designers have time to look at it. For now my best suggestion is to try to workaround it in other ways.

    Best regards,
    Kenneth

Related