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.
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.
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.