From nobody Mon Jun 8 22:51:07 2026 Received: from mail-dl1-f54.google.com (mail-dl1-f54.google.com [74.125.82.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB5B01E7C18 for ; Tue, 26 May 2026 07:29:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779780556; cv=none; b=Jxl7ANu9TlLs0gV4u/RWJ3sKPbu2SBTMIPErZQ2Cxi74Z6gkBq5BJX41hj1HmkvoH8gJ0OlM/QtQxcG0Su2gOkx9JEJBFvE4jV55pe6HW3Ja7qn2Hvce4r4BJ9xX49JC0QEuSkt9pNrTIjGAvcBF2iGUJk2nHk+nVOSYkniIY9k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779780556; c=relaxed/simple; bh=xvumc7IKqu8Qnwk8AWxZpI8AvAIPSVAsd+6YsJ+3Nfk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=X0cIxnkHozv5uXlxWlXHIfYb48nTvfy+xfj8kCx5VyPHDpZ2mfcY0wDR/EyxOMXxYBNySsYny2Bnjd508H6/nQ9xaqkOVYxUV7GTnYnS+vVNb61LohMXlaUplUMswI7eM0gvnnSpBaZL/BLlNxrEgcIFdbL5rwrYTjEbqPvPsq0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ss0lak6t; arc=none smtp.client-ip=74.125.82.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ss0lak6t" Received: by mail-dl1-f54.google.com with SMTP id a92af1059eb24-1334825de43so8910074c88.0 for ; Tue, 26 May 2026 00:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779780553; x=1780385353; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=duOeqU2aHW72kUeDt2Zev5JrjKN42G9f1OMWDHaWfO0=; b=ss0lak6tO23vFfIxatIIyGv4VH4oMqh8gHXODw/3c7oDlkrRyzLlvFO9KmM/m2Wf5M nNWkehd1FtZk/VA9Kj1y7Wfef+J6uXtBtp3rh5fZMfJrZ+8NhSq2tylshWEc+g1M+B5w GslWZkVPf16+UHWFz5utE4RXS5O4Oyg3HM2VADCHijfQWiX4IkkHZNsAjMO3kMKPzQ+B bsZFHMcuuL43HFFgeAzVY5SXn+I14CBQRsNCv4XWNOhpU5KRty5/o82hgn5JNAtXl9yS 8ziSgHvMZsfjAl5oTcvhpmflXwBi2W1RPbJE08uoYA3/3Hw2SFV8GV9wP/die2sS3b9M FFqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779780553; x=1780385353; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=duOeqU2aHW72kUeDt2Zev5JrjKN42G9f1OMWDHaWfO0=; b=nyAlcPheWZXgerYtssWX9ODF9sF2BK8kDyNb37mBuQGtEm3qxokxkqxqw3ZyG9CIvW pMnj6G0L9/Q1vxRfoIOADipjNLeUYbEbRhPCZ2WYpHbLdQTEBYj9lm/i3/dn5SAp9czU iwjobG20M2o5bAQUGdxgv/MBFanGsrO6erifnn6TnC8uGhdayZVJ3wWcSIuBR4Jwvht9 CQwwSBhmZVq5mzreuw4bo5hcumpy5n5T+X/ZHoMmXB2O0mCszVNh5Sw2WDzwEmacuALI Ony52yZP8AUIjR+g1LlZqSZXqq/pqNCyIl5/Y8XV3Y9Z5y9jGLdnSLdDEm9uUR+zez9+ CJCQ== X-Forwarded-Encrypted: i=1; AFNElJ/3IPqg6snEyOwAdJw7XHFK5bLTh8sFzhlqqhSDxnFezdPP6SfP4SAJB4SVdAzJ64chZoz72jZbOrXQR9w=@vger.kernel.org X-Gm-Message-State: AOJu0YxWULi7GRzRD4wUeTh6u0SDDvO/+PD2ZALyDQMG1kMiZIgy0SoA zC6Rf5BNnHYgXU66vlaLmoMUVjIExrk5VpiHASz+GsggBHQ0QysQ0Cpy X-Gm-Gg: Acq92OHihNCeMH+E5i8qW+CtiPqC9Zo4sowyf9xw4gE45qosA1Zk1QfPHDMjeJhVsW+ e6nuntZgMttU1QiuzA5Oq2Obe3ei0CZzkoAAG3AWDAyxMkDrLEvH1JVsDc4VNwK6icnv3vhmmYI gQPvrnIvwVwuj0/QIgO/wzQLcSL/kY1JnwYqpHGF8Yyd1OoW4upTrP7iz2N+y0fUmEWP7ZEBlFS X/rQxI+MltOjZNHc8bLAtukY1h0sxzE1yAcxOSVXazqBgu9Vb8xqcwlKaHdKpoHAgy+zINbMXdn NS42CFfagJLliy6tk1mZUWWQ++ySyia313tAdvsQDDP0UxlhEtNIGzeEc46elIWct8uw1poJuWU 1VKSVRiWHOSHtCbdMFkXpgE0HO4YjqVIbRfjVIxN5IDg2aJFt297DZoKAiyKBOfH0UhCfxQxd5h DAKzKzYMK8Jxxy1E4vjdC3QSJt3+QnMgVXghSMQ4lpENjH1TNQMT4KCSDrH4FAX0yXbc4= X-Received: by 2002:a05:7300:7fa6:b0:2ea:edc0:4fbe with SMTP id 5a478bee46e88-30449095631mr8456932eec.14.1779780552677; Tue, 26 May 2026 00:29:12 -0700 (PDT) Received: from localhost.localdomain ([24.249.245.149]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3045245d6aesm9292001eec.26.2026.05.26.00.29.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 May 2026 00:29:12 -0700 (PDT) From: Gordon Chen To: linux-sound@vger.kernel.org Cc: Takashi Iwai , Jaroslav Kysela , linux-kernel@vger.kernel.org, Gordon Chen Subject: [PATCH] ALSA: usb-audio: add IFB_SILENCE_ON_EMPTY quirk for Behringer Flow 8 Date: Tue, 26 May 2026 15:29:06 +0800 Message-ID: <20260526072906.90106-1-chengordon326@gmail.com> X-Mailer: git-send-email 2.50.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Behringer Flow 8 (1397:050c) is an 8-channel USB mixer that declares OUT EP 0x01 with implicit feedback from capture EP 0x81 via its UAC2 endpoint companion descriptor. After 5-35 minutes of continuous playback, the device occasionally returns a capture URB in which every iso_frame_desc has a non-zero status (-EXDEV bursts, visible as rate-limited "frame N active: -18" lines in dmesg from pcm.c). In that case snd_usb_handle_sync_urb() at endpoint.c counts bytes=3D=3D0 and falls into the early "skip empty packets" return originally added for M-Audio Fast Track Ultra. As a result the playback EP loses its sole IFB-driven feeder and the OUT ring starves permanently: hw_ptr stops advancing while substream state remains RUNNING. Only USB re-enumeration recovers. Three independent ftrace captures (taken at the moment of stall via a userspace watchdog) consistently show: - 60-70 capture URB completions in the 70ms window before the marker - 0 retire_playback_urb / queue_pending_output_urbs / snd_usb_endpoint_implicit_feedback_sink calls - every usb_submit_urb in the window comes from snd_complete_urb+0x64e (capture self-resubmit), none from the queue_pending_output_urbs path Add a new opt-in quirk QUIRK_FLAG_IFB_SILENCE_ON_EMPTY: when set, the early return is skipped and we fall through to enqueue a packet_info whose packet_size[i] are all 0 (the existing loop already maps status!=3D0 packets to size 0). prepare_outbound_urb then emits a silence packet, the OUT ring keeps moving, and the device rides through the glitch. The default behaviour (early return) is preserved for all existing devices including M-Audio Fast Track Ultra. Only Flow 8 opts in here. Cc: stable@vger.kernel.org Signed-off-by: Gordon Chen --- sound/usb/endpoint.c | 10 +++++++++- sound/usb/quirks.c | 3 +++ sound/usb/usbaudio.h | 8 ++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 6fbcb1175..24cd7692b 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -1780,8 +1780,16 @@ static void snd_usb_handle_sync_urb(struct snd_usb_e= ndpoint *ep, /* * skip empty packets. At least M-Audio's Fast Track Ultra stops * streaming once it received a 0-byte OUT URB + * + * However, on devices where bytes=3D=3D0 means every sync-source + * packet errored (e.g. Behringer Flow 8 returning -EXDEV bursts + * for entire capture URBs), an unconditional return starves the + * IFB-fed OUT ring permanently. Such devices set + * QUIRK_FLAG_IFB_SILENCE_ON_EMPTY to fall through and enqueue a + * packet_info with size 0 packets, so playback emits silence + * and the OUT ring keeps moving. */ - if (bytes =3D=3D 0) + if (bytes =3D=3D 0 && !(ep->chip->quirk_flags & QUIRK_FLAG_IFB_SILENCE_O= N_EMPTY)) return; =20 spin_lock_irqsave(&ep->lock, flags); diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 31cbe383a..e2c95be38 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -2365,6 +2365,8 @@ static const struct usb_audio_quirk_flags_table quirk= _flags_table[] =3D { QUIRK_FLAG_PLAYBACK_FIRST | QUIRK_FLAG_GENERIC_IMPLICIT_FB), DEVICE_FLG(0x1397, 0x0509, /* Behringer UMC404HD */ QUIRK_FLAG_PLAYBACK_FIRST | QUIRK_FLAG_GENERIC_IMPLICIT_FB), + DEVICE_FLG(0x1397, 0x050c, /* Behringer Flow 8 */ + QUIRK_FLAG_IFB_SILENCE_ON_EMPTY), DEVICE_FLG(0x13e5, 0x0001, /* Serato Phono */ QUIRK_FLAG_IGNORE_CTL_ERROR), DEVICE_FLG(0x152a, 0x880a, /* NeuralDSP Quad Cortex */ @@ -2602,6 +2604,7 @@ static const char *const snd_usb_audio_quirk_flag_nam= es[] =3D { QUIRK_STRING_ENTRY(SKIP_IFACE_SETUP), QUIRK_STRING_ENTRY(MIXER_PLAYBACK_LINEAR_VOL), QUIRK_STRING_ENTRY(MIXER_CAPTURE_LINEAR_VOL), + QUIRK_STRING_ENTRY(IFB_SILENCE_ON_EMPTY), NULL }; =20 diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h index 58fd07f8c..9afcad8f1 100644 --- a/sound/usb/usbaudio.h +++ b/sound/usb/usbaudio.h @@ -236,6 +236,12 @@ extern bool snd_usb_skip_validation; * QUIRK_FLAG_MIXER_CAPTURE_LINEAR_VOL * Similar to QUIRK_FLAG_MIXER_PLAYBACK_LINEAR_VOL, but for capture strea= ms. * Overrides QUIRK_FLAG_MIXER_CAPTURE_MIN_MUTE + * QUIRK_FLAG_IFB_SILENCE_ON_EMPTY + * In implicit feedback mode, when an entire capture URB returns with + * all iso_frame_desc[i].status !=3D 0 (bytes=3D=3D0), do not silently re= turn + * from snd_usb_handle_sync_urb. Instead fall through and enqueue a + * packet_info containing only size-0 packets, so the OUT ring keeps + * moving (emits silence). Needed by Behringer Flow 8 (1397:050c). */ =20 enum { @@ -268,6 +274,7 @@ enum { QUIRK_TYPE_SKIP_IFACE_SETUP =3D 26, QUIRK_TYPE_MIXER_PLAYBACK_LINEAR_VOL =3D 27, QUIRK_TYPE_MIXER_CAPTURE_LINEAR_VOL =3D 28, + QUIRK_TYPE_IFB_SILENCE_ON_EMPTY =3D 29, /* Please also edit snd_usb_audio_quirk_flag_names */ }; =20 @@ -302,5 +309,6 @@ enum { #define QUIRK_FLAG_SKIP_IFACE_SETUP QUIRK_FLAG(SKIP_IFACE_SETUP) #define QUIRK_FLAG_MIXER_PLAYBACK_LINEAR_VOL QUIRK_FLAG(MIXER_PLAYBACK_LIN= EAR_VOL) #define QUIRK_FLAG_MIXER_CAPTURE_LINEAR_VOL QUIRK_FLAG(MIXER_CAPTURE_LINEA= R_VOL) +#define QUIRK_FLAG_IFB_SILENCE_ON_EMPTY QUIRK_FLAG(IFB_SILENCE_ON_EMPTY) =20 #endif /* __USBAUDIO_H */ --=20 2.54.0