I have LPC54608 Dev Board and implementing USB async Audio device using SDK v2.2.0
Device have 2 audio streaming interfaces, one for playback, second for recording from line in of board
If I play music from PC everything seems to work fine for hours.
But when I enable recording interface(start recording on PC side), after ~20-300 seconds music playback stops.
I am debugging this problem currently, but your advises may be helpful.
Here is what I have found for now:
- Via hardware USB sniffer found out that actually audio data packets actually continue to be sent to isochronous OUT EP. PC even don't knows that something goes wrong;
- USB Interrupt for incoming audio packet not generated anymore after such fault(all other, including packet sent interrupt flag generated as should);
- Music stop and start again(actually performs set interface=0 and set interface=1 packets) makes playback work again until next same fault;
- All subsequent calls to USB_DeviceAudioRecv after such faults always returns by
isBusy also set in:
deviceHandle->endpointCallback[(uint8_t)((uint32_t)endpoint << 1U) | direction].isBusy
- And final and most interesting: disabling of USB double buffering fixes the problem(usb_device_lpcip3511.h)
#define USB_DEVICE_IP3511_DOUBLE_BUFFER_ENABLE (0u)
To sum up, everything works like sometime I miss call to USB_DeviceAudioRecv, but as can be seen by busy states it is always called as it should. I think as problem somewhere in USB stack, as when double buffering enabled there is added interrupt disabling and re-enabling when buffer switching made.
Hope for your advices