Dne 05. 02. 24 v 16:40 Minas Harutyunyan napsal(a):
Hi Pavel,
On 2/5/24 18:35, Pavel Hofman wrote:
It really looks like some DMA performance issue. Stream 980 bytes/ 250us
(bInterval=2) is bitperfect, no dropped packets. While 24 bytes/125us
(bInterval=1) gets stuck. IIUC the DMA is not capable of copying packets
every 125us. Please is there any chance to tweak the performance to
handle the 125us packets reliably?
Minas, thanks a lot!
Quick analysis.
1. In dmesg seen BNA (buffer not available) interrupt which mean driver
not prepare DMA descriptor on time.
This is still listed, even with the req_num=8 and no dropouts:
[ 1851.090554] dwc2 ff400000.usb: dwc2_hsotg_epint: BNA interrupt
[ 1851.108563] dwc2 ff400000.usb: dwc2_hsotg_epint: BNA interrupt
[ 1851.158427] dwc2 ff400000.usb: dwc2_hsotg_epint: BNA interrupt
[ 1851.166529] dwc2 ff400000.usb: dwc2_hsotg_epint: BNA interrupt
[ 1851.188525] dwc2 ff400000.usb: dwc2_hsotg_epint: BNA interrupt
[ 1851.190529] dwc2 ff400000.usb: dwc2_hsotg_epint: BNA interrupt
Please is there any way to improve? Interesting that it produces no
dropouts.
2. For a try please disable debug printing from g_audio:
[ 2080.107701] u_audio_iso_complete: iso_complete status(-61) 0/1000
That helped too, thanks.
3. Please try run device in Buffer DMA instead of Descriptor DMA:
p->g_dma_desc = hw->dma_desc_enable;
replace to:
p->g_dma_desc = 0;
Actually this made the transfer worse. With req_num=8 and dma_desc
enabled transfer clean, with dma_desc disabled many dropouts, with
req_num=2 no transfer at all.
With regards,
Pavel.