iMX RT1052 USB audio unified device callback issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX RT1052 USB audio unified device callback issue

2,462 Views
VeselinK
Contributor I

Hello NXP team,

Im using MCUXpresso to generate the USB stack skeleton for a custom board which uses RT1052. First i tried with the "Audio 2.0 - speaker" preset in the peripherals and I got it working, it plays audio through the SAI peripheral and everything looks ok. Now i want to add a microphone interface. I started from the same baseline as in the speaker preset but selected the unified preset, but now the USB callbacks are not called. I know the PC is sending data because i see it on an analyzer, but "USB_AudioSpeakerPutBuffer" never gets called, neither do "USB_DeviceAudioIsoOut" or "USB_DeviceInterface0AudioControlCallback". I tested that even with no modification to the code, the speaker preset executes the callbacks, and they fill the buffers, but with the unified preset all I see is the volume changing , but no data in the buffers because the callbacks are not executed. I suppose its something minimal but im having trouble figuring it out. What could be the reasons to not go into the callbacks.

Best Regards,

Veselin

Labels (1)
0 Kudos
13 Replies

1,276 Views
asarbs
Contributor II

Hi, @VeselinK 

I have exactly the same issue for rt1024, did you mange to solve and have any callback for speaker? 

B.S. 

0 Kudos

2,147 Views
MathiasFriis
Contributor II

Has there by any chance been any updates to this issue? I'm facing a similar problem.


BR,

Mathias

0 Kudos

2,455 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @VeselinK 

  Do you test this SDK code directly:

SDK_2.9.1_EVKB-IMXRT1050\boards\evkbimxrt1050\usb_examples\usb_device_audio_generator

  This will simulate one microphone interface in the pc, then you can use this tool:

https://webcammictest.com/check-mic.html

 connect your microphone 2-USB AUDIO DEMO, hear audio sound.

  I think you can don't test the combined speaker and the microphone, just test the microphone seperately, whether it works or not

Best Regards,

kerry

 

0 Kudos

2,449 Views
VeselinK
Contributor I

Hello @kerryzhou ,

I have tried the microphone example separately, i have also tried the speaker and they both work when they are on their own. I need to have both input and output so i am trying the unified example but the callback is called only for the microphone. I can see the descriptors and the streaming data with an analyzer but if we dont enter the callback the buffers on the board never get filled. Would it be easy to start with the working speaker example and add a microphone ?

Best Regards

Veselin

0 Kudos

2,437 Views
VeselinK
Contributor I

I did some more debugging and i see that in the unified example the usb interrupt only gets triggered by the microphone (in endpoint). When i stop recording and start playback the interrupt does not get triggered. Can errata ERR050101 be the cause of this issue? Im not using any hubs.

 

Regards,

Veselin

0 Kudos

2,429 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @VeselinK 

  If you want to use both of speaker and the microphone, you need to modify the descriptor and the endpoint.

  Do you try to modify the descriptor based on the microphone project, then at least the microphone is working, and you just need to check the speaker function, which can refer to the speaker project.

  About the errata, if you don't use the hub, I think it should not the errata issues. When just test the directly microphone, do you also meet the interrupt not triggered issues or not?

 

Best Regards,

kerry

0 Kudos

2,423 Views
VeselinK
Contributor I

Hi @kerryzhou,

What i do is create a new project, using the mcuexpresso config tools i configure the pins and clocks for the usb, after that i use the peripheral config tool and generate the audio unified preset. In this case the interrupt is not triggered for the speaker, only for the microphone.

I have not modified any descriptors, im only using the generated code.

Regards,

Veselin

 

0 Kudos

2,421 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @VeselinK 

  Share me your USB project which is generated by the MCUXpresso CFG tool, I will check it on my side.

 

Best Regards,

Kerry

0 Kudos

2,418 Views
VeselinK
Contributor I

Hi @kerryzhou,

Thank you, i have attached a zip with the project. If you comment lines 60 to 76 its runnable on an EVK board, and the behavior is the same, interrupt is triggered only for mic. I can also send the project where the speaker is working if that would help.

Regards,

Veselin

0 Kudos

2,394 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi VeselinK

  Please also share with me the speaker working code, then I can check together, if I also reproduce the issues, I will check internally with the expert.

  Thanks for your patient.

Best Regards,

kerry

0 Kudos

2,390 Views
VeselinK
Contributor I

Hi @kerryzhou ,

Here is the working speaker code. Since this was test code the tx_callback for the SAI peripheral is in the USB generated code and can get overwritten if the USB code is generated again. I will move it in the future but it shouldnt be a problem for now. Thank you for your time.

Best Regards,

Veselin

0 Kudos

2,373 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @VeselinK 

  Please give me more time to test and analyze it, as these days, really a lot of cases in the testing queue.

  I will assign time to test it, and any updated information from my side, I will let you know, please keep patient.

 

Best Regards,

Kerry

0 Kudos

2,344 Views
VeselinK
Contributor I

Hi @kerryzhou,

Thank you for the feedback, Im currently trying to approach the problem from a different direction but no luck yet.

Thank you for the time, im very interested to see if you will have the same issue.

Best Regards,

Veselin

0 Kudos