mutex_unlock(&dev->lock);
        }
 
+       /* Dynamically adjust the period size */
        snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
+       snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
+                                    dev->adev.period * 95 / 100,
+                                    dev->adev.period * 105 / 100);
+
        dev->adev.capture_pcm_substream = substream;
 
        return 0;
        em28xx_info("Number of URBs: %d, with %d packets and %d size",
                    num_urb, npackets, urb_size);
 
+       /* Estimate the bytes per period */
+       dev->adev.period = urb_size * npackets;
+
        /* Allocate space to store the number of URBs to be used */
 
        dev->adev.transfer_buffer = kcalloc(num_urb,