XMOS audio issue when USB cables plugged and unplugged multiple times

If you have a simple question and just want an answer.
karthik
Member
Posts: 8
Joined: Wed Nov 17, 2021 4:39 am

XMOS audio issue when USB cables plugged and unplugged multiple times

Post by karthik »

Hello there,
I have an issue with the audio when I plug and unplug the USB cable to a windows PC multiple times. Further debugging I figured out the issue was with 'XUD_GetData_Select' function which was supposed to be true when audio data is received from the host. But after re-plugging the cable a couple of time, the select function does not hit even when the audio is being played and continuous to be in the state untill the XMOS is reset.
mC: xs1-u6a-64-fb96-c5

Can someone please help me debug the issue further?

Code: Select all

 case XUD_GetData_Select(c_aud_out, ep_aud_out, length, result):
            {
                GET_SHARED_GLOBAL(aud_from_host_buffer, g_aud_from_host_buffer);
                write_via_xc_ptr(aud_from_host_buffer, length);
                /* Sync with decouple thread */
                SET_SHARED_GLOBAL0(g_aud_from_host_flag, 1);
             }
Thanks,
Karthik
User avatar
Ross
Verified
XCore Legend
Posts: 1117
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Is this project using the library from sc_xud or so you have xud source complied in?
Technical Director @ XMOS. Opinions expressed are my own
karthik
Member
Posts: 8
Joined: Wed Nov 17, 2021 4:39 am

Post by karthik »

I'm using the XUD library.
User avatar
Ross
Verified
XCore Legend
Posts: 1117
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Its going to be hard to support you using sc_xud and the static library in there. Can you move your project to lib_xud?

The issue is resolved in v1.1.1 (https://github.com/xmos/lib_xud/blob/de ... NGELOG.rst)

You need to keep below v2 since we removed xs1 support then.
Technical Director @ XMOS. Opinions expressed are my own
karthik
Member
Posts: 8
Joined: Wed Nov 17, 2021 4:39 am

Post by karthik »

Thank you for the info. Will I be able to move project by replacing 'module_xud' folder of my project with 'lib_xud' ?
Can you please provide me with some documentation on how to do it?
User avatar
Ross
Verified
XCore Legend
Posts: 1117
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

well firstly clone the repo, then in the USED_MODULES of the makefile change module_xud to lib_xud

I believe the API is largely the same, there maybe very small changes required.
Technical Director @ XMOS. Opinions expressed are my own
karthik
Member
Posts: 8
Joined: Wed Nov 17, 2021 4:39 am

Post by karthik »

I did the same. I can see the lib_xud has been included. But it still considers module_xud as well and hence I get multiple definitions warning and errors. I tried deleting the module_xud folder itself but I again get errors stating 'module_xud' and the path that it points at is the xTimeComposer studio installation path. I tried to debug by searching the folder to see if there is 'module_xud' hardcoded somewhere but it wasn't.
Is there anything else to be done other than the makefile changes?
You do not have the required permissions to view the files attached to this post.
MaximLiadov
XCore Addict
Posts: 143
Joined: Mon Apr 16, 2018 9:14 am

Post by MaximLiadov »

Adding/removing files and folders to/from workspace in OS is not a correct operation. You should add/remove it correct way in the xTimeComposer as it makes changes in its internal database. Then make sure you have no any old module/links in your project setting.
karthik
Member
Posts: 8
Joined: Wed Nov 17, 2021 4:39 am

Post by karthik »

I did change the makefile. I replace module_xud with lib_xud. But still when compiling, I can see that module_xud is included.
MaximLiadov
XCore Addict
Posts: 143
Joined: Mon Apr 16, 2018 9:14 am

Post by MaximLiadov »

There is no such a thing as a replacement. You should delete your old module from project. Not files. Not just editing makefile. You still have links to the old module in your project options.