Page 1 of 2

XMOS audio issue when USB cables plugged and unplugged multiple times

Posted: Mon Feb 28, 2022 6:51 am
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

Re: XMOS audio issue when USB cables plugged and unplugged multiple times

Posted: Wed Mar 02, 2022 12:34 pm
by Ross
Is this project using the library from sc_xud or so you have xud source complied in?

Re: XMOS audio issue when USB cables plugged and unplugged multiple times

Posted: Thu Mar 03, 2022 9:58 am
by karthik
I'm using the XUD library.

Re: XMOS audio issue when USB cables plugged and unplugged multiple times

Posted: Thu Mar 03, 2022 11:44 am
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.

Re: XMOS audio issue when USB cables plugged and unplugged multiple times

Posted: Mon Mar 07, 2022 6:54 am
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?

Re: XMOS audio issue when USB cables plugged and unplugged multiple times

Posted: Wed Mar 09, 2022 11:19 am
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.

Re: XMOS audio issue when USB cables plugged and unplugged multiple times

Posted: Mon Mar 14, 2022 5:22 am
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?

Re: XMOS audio issue when USB cables plugged and unplugged multiple times

Posted: Mon Mar 14, 2022 9:08 am
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.

Re: XMOS audio issue when USB cables plugged and unplugged multiple times

Posted: Fri Mar 18, 2022 5:45 am
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.

Re: XMOS audio issue when USB cables plugged and unplugged multiple times

Posted: Sun Mar 20, 2022 4:29 pm
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.