From: Takashi Iwai <tiwai@suse.de>
To: Sinan Turunc <enscrpt@pm.me>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: usx2y: Account for every period a URB completes
Date: Mon, 16 Nov 2026 16:41:09 +0100 [thread overview]
Message-ID: <874idgyeay.wl-tiwai@suse.de> (raw)
In-Reply-To: <20261115121638.168-1-enscrpt@pm.me>
On Sun, 15 Nov 2026 13:16:55 +0100,
Sinan Turunc wrote:
>
> 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>
Applied now. Thanks.
Takashi
prev parent reply other threads:[~2026-11-16 15:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-15 12:16 [PATCH] ALSA: usx2y: Account for every period a URB completes Sinan Turunc
2026-11-16 15:41 ` Takashi Iwai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874idgyeay.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=enscrpt@pm.me \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox