linux/sound
Takashi Iwai 4f9d674377 ALSA: usb-audio: Notify xrun for low-latency mode
The low-latency mode of USB-audio driver uses a similar approach like
the implicit feedback mode but it has an explicit queuing at the
trigger start time.  The difference is, however, that no packet will
be handled any longer after all queued packets are handled but no
enough data is fed.  In the case of implicit feedback mode, the
capture-side packet handling triggers the re-queuing, and this checks
the XRUN.  OTOH, in the low-latency mode, it just stops without XRUN
notification unless any new action is taken from user-space via ack
callback.  For example, when you stop the stream in aplay, no XRUN is
reported.

This patch adds the XRUN check at the packet complete callback in the
case all pending URBs are exhausted.  Strictly speaking, this state
doesn't match really with XRUN; in theory the application may queue
immediately after this happens.  But such behavior is only for
1-period configuration, which the USB-audio driver doesn't support.
So we may conclude that this situation leads certainly to XRUN.

A caveat is that the XRUN should be triggered only for the PCM RUNNING
state, and not during DRAINING.  This additional state check is put in
notify_xrun(), too.

Fixes: d5f871f89e ("ALSA: usb-audio: Improved lowlatency playback support")
Reported-by: Leonard Crestez <cdleonard@gmail.com>
Link: https://lore.kernel.org/25d5b0d8-4efd-4630-9d33-7a9e3fa9dc2b@gmail.com
Link: https://patch.msgid.link/20241128080446.1181-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-11-29 14:59:41 +01:00
..
ac97 ALSA: ac97: bus: Fix the mistake in the comment 2024-11-20 12:42:01 +01:00
aoa ALSA: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-09-20 17:44:52 +02:00
arm sound: Switch back to struct platform_driver::remove() 2024-10-30 14:47:59 +01:00
atmel sound: Switch back to struct platform_driver::remove() 2024-10-30 14:47:59 +01:00
core ALSA: ump: Update legacy substream names upon FB info update 2024-11-29 11:07:37 +01:00
drivers sound: Switch back to struct platform_driver::remove() 2024-10-30 14:47:59 +01:00
firewire Merge branch 'for-linus' into for-next 2024-11-05 13:03:12 +01:00
hda ASoC: Fixes for v6.12 2024-10-30 14:46:35 +01:00
i2c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
isa ALSA: gus: Fix some error handling paths related to get_bpos() usage 2024-10-04 09:02:30 +02:00
mips sound: Switch back to struct platform_driver::remove() 2024-10-30 14:47:59 +01:00
oss sound: Switch back to struct platform_driver::remove() 2024-10-30 14:47:59 +01:00
parisc ALSA: misc: Use *-y instead of *-objs in Makefile 2024-05-08 18:18:13 +02:00
pci ALSA: hda/conexant: fix Z60MR100 startup pop issue 2024-11-29 11:08:41 +01:00
pcmcia ALSA: vxpocket: Fix a typo at conversion to dev_*() 2024-08-08 20:23:41 +02:00
ppc sound: Switch back to struct platform_driver::remove() 2024-10-30 14:47:59 +01:00
sh sound: Switch back to struct platform_driver::remove() 2024-10-30 14:47:59 +01:00
soc ASoC: amd: yc: Add a quirk for microfone on Lenovo ThinkPad P14s Gen 5 21MES00B00 2024-11-27 13:45:45 +00:00
sparc sound: Switch back to struct platform_driver::remove() 2024-10-30 14:47:59 +01:00
spi ALSA: spi: Drop NULL check for snd_ctl_remove() 2024-06-18 12:54:34 +02:00
synth ALSA: emux: Use standard print API 2024-08-08 07:49:46 +02:00
usb ALSA: usb-audio: Notify xrun for low-latency mode 2024-11-29 14:59:41 +01:00
virtio virtio: rename virtio_find_vqs_info() to virtio_find_vqs() 2024-07-17 05:20:58 -04:00
x86 Merge drm/drm-next into drm-intel-next 2024-06-19 11:38:31 +03:00
xen ALSA: xen-front: remove unused struct 'alsa_sndif_hw_param' 2024-06-13 14:14:46 +02:00
ac97_bus.c ALSA: ac97: legacy: Add missing module description 2024-05-09 10:13:07 +02:00
Kconfig sound: Make CONFIG_SND depend on INDIRECT_IOMEM instead of UML 2024-10-10 16:11:18 +02:00
last.c
Makefile ALSA: core: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:32 +02:00
sound_core.c sound: make all 'class' structures const 2023-06-21 07:29:10 +02:00