Hello,

I have the same issue with the device Focusrite Scarlett 8i6.

After investigating the source from the Kernel module
'snd_usb_audio' I found the issue and (partially) fixed it
on my system.

Since Kernel v6.12.115 there was a modification in the source
from the module, which result in this issue.

Linux-src/sound/usb/pcm.c:prepare_playback_urb():

v6.12.115:

for (i = 0; i < ctx->packets; i++) {
      counts = snd_usb_endpoint_next_packet_size(ep, ctx, i, avail);
      if (counts < 0 || frames + counts >= ep->max_urb_frames)
          break;
      /* set up descriptor */
      urb->iso_frame_desc[i].offset = frames * stride;
      urb->iso_frame_desc[i].length = counts * stride;

It seems the 'if' logic isn't correct here, which cause the issue
on my system.

v6.12.113:


for (i = 0; i < ctx->packets; i++) {
     counts = snd_usb_endpoint_next_packet_size(ep, ctx, i, avail);
     if (counts < 0)
        break;
     /* set up descriptor */
     urb->iso_frame_desc[i].offset = frames * stride;
     urb->iso_frame_desc[i].length = counts * stride;

This was the old code.

v7.4.x

for (i = 0; i < ctx->packets; i++) {
     counts = snd_usb_endpoint_next_packet_size(ep, ctx, i, avail);
     if (counts < 0 ||
         (frames + counts) * stride > ctx->buffer_size)
         break;
     /* set up descriptor */
     urb->iso_frame_desc[i].offset = frames * stride;
     urb->iso_frame_desc[i].length = counts * stride;

I used the code from Kernel v7.4.x in this module, which fixes
the issue for me.

Hope this help.

-- 
Kind regards,

Johannes K.

Reply via email to