summaryrefslogtreecommitdiff
path: root/include/linux/misc
diff options
context:
space:
mode:
authorSinan Turunc <enscrpt@pm.me>2026-11-15 12:16:55 +0000
committerTakashi Iwai <tiwai@suse.de>2026-11-16 16:40:59 +0100
commitae78fd83cc14f2a3cefd56bd6553e0c6d81031e4 (patch)
tree0bd8b2602e715d3a41ce4805023175773e7bea93 /include/linux/misc
parentbd691dfae024059d79eae38230c883e52ce9842f (diff)
ALSA: usx2y: Account for every period a URB completes
usx2y_urb_capt_retire() and usx2y_urb_play_retire() add the frames of a whole URB to transfer_done and subtract one period_size when it is reached. With a period of 1 ms, which snd_usx2y_pcm_open() allows, a URB of nr_of_packs() packets covers several periods, so transfer_done grows by the difference on every URB. snd_pcm_period_elapsed() is called once per URB instead of once per period, and transfer_done overflows after about 16 hours, after which period wake-ups stop. Keep only the remainder modulo period_size. ALSA's position comes from the pointer callback, so one call per URB that crosses a period is enough. Measured on 7.3-rc7 with an emulated US-122 over USB/IP and a debug print of transfer_done every 1024 capture URBs, 45-frame periods and 48-frame packets: before, transfer_done is 150573 after 1024 URBs and 8580141 after 58368; after, it never exceeds a period plus one URB and the stream runs for 30 s as before. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Sinan Turunc <enscrpt@pm.me> Link: https://patch.msgid.link/20261115121638.168-1-enscrpt@pm.me Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/linux/misc')
0 files changed, 0 insertions, 0 deletions