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.

  • Hello again,

    Thank you for your patience with this. I have been out of office for some days but now I am back.

    huma said:
    Your help has given me a great inspiration. I made a series of modifications on the walkie talkie demo to verify the USB output stereo audio signal. Although these modifications may seem non-standard, they at least proved that my idea is feasible. I will further explore and ask you if I have any questions.

    I am glad to read that you found my comments helpful and that you successfully have tested the desired configuration!

    huma said:
    And I have a new question. I found that the default config for the usb sound card is two channel, left and right. But can the nrf5340 support the multichannel usb sound card? for example can it tell PC it support 8 ch then receive the 8 ch audio signal?

    I cant find any notes in our documentation that this is specifically tested, but I would think that you could do this as long as you have enough bandwidth to do so - you should give this a try and see.
    Regardless of this, in the LE Audio case you will quickly hit a limitation on the processing power required to LC3 encode all of these streams, since the rule of thumb is that a 96 kbps stream will require roughly ~30% CPU to encode, and ~15% to decode the same stream. Could you elaborate on your applications requirements in regards to number of audio channels?

    Best regards,
    Karl

  • 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

Related