nrf5340 usb device for audio

I have found that nrf5340 support the usb device function. It can be used for sound card which can receive the audio signal from the PC, and output the mic signal to PC.

And I have tested that function from the nrf5340_audio application.

My question is if we made a USB Docking, if i plug my device which uesd nrf5340 to the docking, can output music(for example, the i2s input to the nrf5340) to the docking which can convert it to analog signal so people can hear them through the wired headset.

Because i thought that first, may be the Docking shoud support the USB HOST function, and the second question is we need the nrf5340 to output the audio signal through the USB prot, not only the MIC signal, I don not know if there some limtations in that.

Thank you very much for helping.

Parents
  • Hello,

    I am not quite sure if I understand your topology correctly - you can indeed use the microphone on the nRF5340 LE Audio DK to output audio to a connected computer over USB, but the nRF5340 LE Audio can not serve as a USB Host.
    So, you are correct that you can have your nRF5340 LE Audio DK output the music to the docking (as digital, over USB), or it could output the audio as analog audio out through the headphone jack (by sending the digital audio to the onboard Cirrus Logic hardware codec DAC/DSP).

    Please elaborate on your intentions and topology if this did not fully answer your question.

    Best regards,
    Karl

  • Hello Karl,

    Thank you for your help. We plan to design an audio product with USB function and using battery. And we also want to design a docking for it, the docking can charging the device. So we need to consider whether it is possible to add a headphone jack on Docking so that users can listen to music through wired headphones. If we want to meet this requirement, we first need to evaluate whether it is possible to output music through the nrf5340 USB port.

    So, you are correct that you can have your nRF5340 LE Audio DK output the music to the docking (as digital, over USB).

    Does that means if the docking can work like PC(USB HOST), we can output the audio to it? You know, the nrf5340_audio application only can oputput the mic signal to PC. So I'm not sure if there are any limitations on USB role, such as USB devices can only being able to output MIC signal or if there are bandwidth limitations. Because we want to output the normal music signal, i think the resource requirment should be larger than mic.

    Thank you very much.

  • Hello Karl,

    Thank you very much for your help.

    What we think of may be adding up to 8 channels.

    Fortunately, when evaluating this feature, we can first not consider the resource consumption of encoding and decoding functions, as the features on USB may only be applied locally.

    I also saw through the log that the system resource usage is not very high when stereo input/output is enabled.

    Does this mean that nrf5340 has the opportunity to support multi-channel USB sound cards in this situation? If possible, could you please point out where to modify this part of the driver? After all, I haven't paid attention to this part before.

    Thank you very much and looking forward for your reply.

  • Hello,

    huma said:
    Thank you very much and looking forward for your reply.

    No problem at all, I am happy to help! :) 

    huma said:
    Fortunately, when evaluating this feature, we can first not consider the resource consumption of encoding and decoding functions, as the features on USB may only be applied locally.

    Does this mean that you intend to do the LC3 encoding and decoding on the USB host side, and then transfer it over to the nRF5340 for transmitting over LE Audio?

    huma said:
    Does this mean that nrf5340 has the opportunity to support multi-channel USB sound cards in this situation? If possible, could you please point out where to modify this part of the driver? After all, I haven't paid attention to this part before.

    Right now we are using two audio channels over USB (using USB Audio) which are bi-directional, and so we use 4 endpoints for this. This is the only configuration we regularly test, but so long as you have the bandwidth and processing for it then it should be fine to increase this as well as far as I can tell - my hesitation to decisively confirm this only stems from the fact that we only test with the stereo USB, and so I don't have any personal experience with additional channels all the way up to 8 channels.
    As far as I can tell there should be no issue with this, but I would recommend you to give this a try and let us know if you run into any issues with it.

    Best regards,
    Karl

  • Hello Kaarl

    Thank you for  your reply.

    I am sorry for the late reply due to the holiday.

    Can you tell me where the USB driver is in the code and where I can modify the number of audio channels on the USB device, so that I can save some time and try to modify it directly to verify.

    Thank you very much and looking forward for your reply.

  • Hello,

    huma said:
    I am sorry for the late reply due to the holiday.

    No worries at all - we will continue this whenever you have a chance! :) 

    huma said:
    Can you tell me where the USB driver is in the code and where I can modify the number of audio channels on the USB device, so that I can save some time and try to modify it directly to verify.

    The USB functionality used in the nRF5340 LE Audio reference application is contained in the audio_usb.c/.h files.
    You should also take a look in the kconfigs for the project to see which USB related configurations that are set there.

    Best regards,
    Karl

  • Hello, Karl

    Thank you very much for your reply.

    In the default sample, the Windows11 can recognized it:

    Then I have tried to add the "mic-channel-c;" to the dt overlay file.

    &hs_0 {
        mic-channel-c;
    };

    Then the windows can recognized it, but there is no Advanced page to check the channel:

    And I have checked the kconfigs in the project, but i found nothing about the channel settings. Also for the audio_usb.c/.h. I know if i add the channel, the file shoud be modified. But I want the Windows 11 can get the channel of my device first, even if it doesn't work.

    Thank you very much and looking forward for your reply.

Reply
  • Hello, Karl

    Thank you very much for your reply.

    In the default sample, the Windows11 can recognized it:

    Then I have tried to add the "mic-channel-c;" to the dt overlay file.

    &hs_0 {
        mic-channel-c;
    };

    Then the windows can recognized it, but there is no Advanced page to check the channel:

    And I have checked the kconfigs in the project, but i found nothing about the channel settings. Also for the audio_usb.c/.h. I know if i add the channel, the file shoud be modified. But I want the Windows 11 can get the channel of my device first, even if it doesn't work.

    Thank you very much and looking forward for your reply.

Children
Related