xmos / lib_xua

XMOS USB Audio
Other
17 stars 15 forks source link

UAC2 mode does not come out of input underflow when FS=16k and ch=2 #434

Open ed-xmos opened 1 month ago

ed-xmos commented 1 month ago

The problem is that in this case the min_packet_size is 12. The exit for "in underflow" is fillLevel between 2 and 3 min_packet_size which is 24 <= size < 36.

https://github.com/xmos/lib_xua/blob/7ade1262970f318c1096e00a3ff1e027a03b5b90/lib_xua/src/core/buffer/decouple/decouple.xc#L1073

However the drain function for the input buffer stops at fillLevel 40 which is 2 * max_packet_size. So the window is never hit and it stays in underflow.

https://github.com/xmos/lib_xua/blob/7ade1262970f318c1096e00a3ff1e027a03b5b90/lib_xua/src/core/buffer/decouple/decouple.xc#L610

SO basically if 2 max_packet_size > 3 min_packet_size there is an issue.