PDM Mic and USB-Audio on XU208

If you have a simple question and just want an answer.
User avatar
xaerox
Active Member
Posts: 43
Joined: Thu Apr 30, 2015 6:12 pm

PDM Mic and USB-Audio on XU208

Postby xaerox » Wed Jul 17, 2019 10:17 am

Hello everybody!
I hope you can help me.
I started a new xTime-Composer-Project using following steps for an XUF208-256...:
https://www.xmos.com/download/AN01027:- ... .0rc1).pdf

I only need PDM-Mics and USB Audio and no additional I2S. I was trying using the Multichannel Audio reference software, also the Mic-Array software.

Actually I'm trying it on the last reference software example named above. actually the Masterclock for I2S and PDM-Clock are using the same clock block.

Did anybody solved this problem on that device?

Best regards,
Thomas
User avatar
xaerox
Active Member
Posts: 43
Joined: Thu Apr 30, 2015 6:12 pm

Postby xaerox » Tue Jul 23, 2019 11:22 am

Hello together,
I checked it out and removed all I2S-Code.
But now I have the problem, that the PDM-tasks will need 5 Cores and USB-Audio 4 another cores.
So it will not work on XUF208-256-TQ64.
I deactivated 4 PDM Mics, so that I only use one decimator and the result is 8 cores.

The XUD Manager is also working on tile[0] but it requires using less than 6 cores.
So would you aggree that using 8 PDMs with USB-Audio on the chip named above is not possible?

Best regards,
Thomas
User avatar
akp
Respected Member
Posts: 314
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Thu Jul 25, 2019 8:50 pm

I have not worked with the PDM library but with 8 PDMs it looks like it only need 3 cores per Fig 2 of https://www.xmos.com/download/lib_mic_a ... .1rc1).pdf. That would be a total of 7 cores. Correct me if I am wrong.

On the U208 the app note you can clearly see that one of the cores is 100MIPS high priority and that leaves 400MIPS/7 = 57MIPS if you use all 8 cores. That might just work fine, but the PDM lib supposedly wants 62.5MIPS cores. So if you can keep everything to 7 cores then you would have 100MIPS for the critical USB core, and 400/6 = 66.7 MIPS for each of the low prio cores I suppose. And that should definitely work I would think.

Furthermore, it seems like it should be possible to get 8 PDMs even if you need all 8 cores, but you might have to play around with maximum sample rate (e.g. 24kHz vs 48kHz) and which cores get high prio (if any, perhaps the USB doesn't need high prio with only 8 channels x 48kHz? or maybe both the USB core and the decimate by 8 core need it?) Or maybe you do 24kHz but the PDM clock is 1.536 MHz instead of 3.072 MHz?

Lots of stuff to try.
User avatar
xaerox
Active Member
Posts: 43
Joined: Thu Apr 30, 2015 6:12 pm

Postby xaerox » Fri Jul 26, 2019 2:44 pm

Thank you for your help, akp!
Currently I'm working on 8 Cores for USB-Audio and PDM.
The PDM-Lib needs 4 Cores for 8 Channel Audio:
- mic_array_pdm_rx
- mix_array_decimate_to_pcm_4ch (first 4 channels)
- mix_array_decimate_to_pcm_4ch (last 4 channels)
- pdm_process

I tried to make a streaming chanend directly between pdm_process() and the usb_audio_core(), so the usb_audio_io() core is not needed anymore.

I dont find any other way to get at least 7 cores as you described above.
Maybe I can try using another sampling rate.

Another question: Does the Function XUD_Manager() already set the high priority on core or should we set the function "set_core_high_priority_on()"?
The function XUD_Manager() is a compiled build so I can't change the code inside this function.

Best regard,
Thomas
User avatar
akp
Respected Member
Posts: 314
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Fri Jul 26, 2019 4:18 pm

Ok, you can set the core to high prio before you call the XUD manager. But it's probably already set, setting it twice won't hurt, i am pretty sure it just sets a condition flag on the core status register or something.

What you write makes sense why you need 8 cores. I haven't used the pdm code so I didn't know. I don't think I will be able to help you much further but it sounds like you're on the right track. Good luck
User avatar
xaerox
Active Member
Posts: 43
Joined: Thu Apr 30, 2015 6:12 pm

Postby xaerox » Mon Jul 29, 2019 10:10 am

Thank you for your support. You gave me some usefull tips.
I'm going on trying to work on 8 cores and I'll test USB-Audio this afternoon.

I'll post if it works/doesn't work.

Best, Thomas
rgilio
Active Member
Posts: 33
Joined: Wed Jul 03, 2019 1:01 am

Postby rgilio » Fri Aug 09, 2019 6:06 pm

xaerox wrote:
Tue Jul 23, 2019 11:22 am
Hello together,
I checked it out and removed all I2S-Code.
But now I have the problem, that the PDM-tasks will need 5 Cores and USB-Audio 4 another cores.
So it will not work on XUF208-256-TQ64.
I deactivated 4 PDM Mics, so that I only use one decimator and the result is 8 cores.

The XUD Manager is also working on tile[0] but it requires using less than 6 cores.
So would you aggree that using 8 PDMs with USB-Audio on the chip named above is not possible?

Best regards,
Thomas
I believe that chip is an XS2 Architecture which means it's not subject to the 6 core requirement for the XUD_Manger if I'm correct.
I'm getting my information from this thread here: viewtopic.php?t=7035
User avatar
akp
Respected Member
Posts: 314
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Fri Aug 09, 2019 6:08 pm

Yeah, that's right.
User avatar
xaerox
Active Member
Posts: 43
Joined: Thu Apr 30, 2015 6:12 pm

Postby xaerox » Mon Sep 02, 2019 10:30 am

Thank you for your replies!
I just tried it on a prototype and my computer detects the USB-Audio device. But no samples are transferred.

I'm solving the problem using the XUF212 chip now.

Thank you very much!

Who is online

Users browsing this forum: No registered users and 1 guest