iMX RT1052 USB audio unified device callback issue

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

iMX RT1052 USB audio unified device callback issue

3,604件の閲覧回数
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

ラベル(1)
0 件の賞賛
返信
13 返答(返信)

2,418件の閲覧回数
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 件の賞賛
返信

3,289件の閲覧回数
MathiasFriis
Contributor II

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


BR,

Mathias

0 件の賞賛
返信

3,597件の閲覧回数
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 件の賞賛
返信

3,591件の閲覧回数
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 件の賞賛
返信

3,579件の閲覧回数
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 件の賞賛
返信

3,571件の閲覧回数
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 件の賞賛
返信

3,565件の閲覧回数
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 件の賞賛
返信

3,563件の閲覧回数
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 件の賞賛
返信

3,560件の閲覧回数
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 件の賞賛
返信

3,536件の閲覧回数
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 件の賞賛
返信

3,532件の閲覧回数
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 件の賞賛
返信

3,515件の閲覧回数
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 件の賞賛
返信

3,486件の閲覧回数
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 件の賞賛
返信