]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: Check available frames for the next packet size
authorTakashi Iwai <tiwai@suse.de>
Wed, 29 Sep 2021 08:08:41 +0000 (10:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Dec 2021 08:04:36 +0000 (09:04 +0100)
commited30645c9b57d6984a5665138b1cfaf9d842d6c2
treee030470b2a942b4b68298d4627b60e96996e60dc
parent4962295a50a879727e8e365051a1e19dc711413f
ALSA: usb-audio: Check available frames for the next packet size

commit e3913063b5b65e3fd6bf5afa119fee9ed0fddc4c upstream.

This is yet more preparation for the upcoming changes.

Extend snd_usb_endpoint_next_packet_size() to check the available
frames and return -EAGAIN if the next packet size is equal or exceeds
the given size.  This will be needed for avoiding XRUN during the low
latency operation.

As of this patch, avail=0 is passed, i.e. the check is skipped and no
behavior change.

Link: https://lore.kernel.org/r/20210929080844.11583-7-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/endpoint.c
sound/usb/endpoint.h
sound/usb/pcm.c