From nobody Sat Jul 25 21:59:35 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA40E3A5E97; Mon, 13 Jul 2026 08:10:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783930259; cv=none; b=Y+Fb0CzjZdjdD5S40OJUtNqiLhFqva9ZWD2C0eG8Ze/StSq+vaPTJ4FmC9lr9g5aOqik2VOHAsCWRWAt5XCrRxix+caQXgKCc4BoxbidmsDeDLMSDoWmKWhB8G1/ZDKuwsahM4cGINM7nPP4BRfY0vUFrxiS2kJcmaey66GWg0A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783930259; c=relaxed/simple; bh=r62lNHBeU+/LQxZVq7ReqdidWsxIYD2Dqi7IXymCZcY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=D4qx76+WKN7zQH+BmMrV54sIYqFZN2TzaSB/UF1Gee+gtMOqo68qTbk33JwBJhkxaCSHAHxiN6K+SorVKzUFGRwoCquO7Hd+A71tqagJb+8K2LrZsp/udtl8DNoZFiS2FQ5Y5MlrQyEEt6+U4ar4UJjsrSD1rEr+UO9upuGmBOI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 5dfe01267e9211f1aa26b74ffac11d73-20260713 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:4293df52-0e38-4139-bedd-47d1c8dc50b5,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:e7bac3a,CLOUDID:ca78c803f58562d2e899aad8fdff3308,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:102|850|865|898,TC:nil,Content:0|15|50,E DM:-3,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA :0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 5dfe01267e9211f1aa26b74ffac11d73-20260713 X-User: zhangheng@kylinos.cn Received: from localhost.localdomain [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 541443689; Mon, 13 Jul 2026 16:10:53 +0800 From: Zhang Heng To: perex@perex.cz, tiwai@suse.com Cc: kees@kernel.org, chengordon326@gmail.com, jussi@sonarnerd.net, hulianqin@vivo.com, i@rong.moe, g@b4.vu, cryolitia@uniontech.com, pav@iki.fi, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Zhang Heng Subject: [PATCH] usb-audio: Fix boot-time crackling for Generic USB Audio device Date: Mon, 13 Jul 2026 16:10:48 +0800 Message-Id: <20260713081048.189281-1-zhangheng@kylinos.cn> X-Mailer: git-send-email 2.25.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 Generic USB Audio device (0x1e0b:d01e) produces crackling noise during system boot when the boot music plays. The issue disappears once the system has fully started. Kernel logs show xhci-ring warnings when the device initializes: [ 2.836118] usb 1-3: New USB device found, idVendor=3D1e0b, idProduct=3D= d01e [ 9.654586] xhci_hcd 0000:03:00.3: Frame ID 644 (reg 5154, index 13) bey= ond range (645, 1539) [ 9.654589] xhci_hcd 0000:03:00.3: Ignore frame ID field, use SIA bit in= stead [ 9.655053] xhci_hcd 0000:03:00.3: Frame ID 644 (reg 5158, index 14) bey= ond range (645, 1539) [ 9.655055] xhci_hcd 0000:03:00.3: Ignore frame ID field, use SIA bit in= stead These warnings are generated by xhci_get_isoc_frame_id() in xhci-ring.c. Data endpoints have multiple TDs per URB (number_of_packets > 1). For TD index=3D0, the function adjusts start_frame to a valid range when validation fails. However, for TD index>0, the calculated Frame IDs become stale before validation completes, causing xhci_get_isoc_frame_id() to return -EINVAL and trigger a fallback to SIA (Schedule Information Address) mode for those TDs. This inconsistent scheduling between index=3D0 TD (direct Frame ID) and index>0 TDs (SIA mode) within the same data endpoint causes audio data misalignment and crackling noise during boot. Sync endpoints have only one TD per URB (number_of_packets =3D 1), so they don't suffer from this mixed scheduling issue. Fix by setting URB_ISO_ASAP flag for the data endpoint of this specific device. This flag causes the xHCI driver to skip Frame ID calculation entirely and let hardware schedule via SIA bit for all TDs, ensuring consistent scheduling within the data endpoint. Also add a quirk to skip the first 4 packets on the sync endpoint. Signed-off-by: Zhang Heng --- sound/usb/endpoint.c | 3 +++ sound/usb/quirks.c | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 24cd7692bd01..6a6a6797ac4b 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -1256,6 +1256,9 @@ static int data_ep_set_params(struct snd_usb_endpoint= *ep) goto out_of_memory; u->urb->pipe =3D ep->pipe; u->urb->transfer_flags =3D URB_NO_TRANSFER_DMA_MAP; + /* Generic USB Audio (0x1e0b:d01e): use SIA for consistent scheduling */ + if (ep->chip->usb_id =3D=3D USB_ID(0x1e0b, 0xd01e)) + u->urb->transfer_flags |=3D URB_ISO_ASAP; u->urb->interval =3D 1 << ep->datainterval; u->urb->context =3D u; u->urb->complete =3D snd_complete_urb; diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 2949a0d2d961..52a4fd352ea2 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1938,6 +1938,14 @@ void snd_usb_endpoint_start_quirk(struct snd_usb_end= point *ep) ep->type =3D=3D SND_USB_ENDPOINT_TYPE_SYNC) ep->skip_packets =3D 4; =20 + /* + * Generic USB Audio (0x1e0b:d01e) - skip initial sync packets + * to avoid crackling noise during system boot + */ + if (ep->chip->usb_id =3D=3D USB_ID(0x1e0b, 0xd01e) && + ep->type =3D=3D SND_USB_ENDPOINT_TYPE_SYNC) + ep->skip_packets =3D 4; + /* * M-Audio Fast Track C400/C600 - when packets are not skipped, real * world latency varies by approx. +/- 50 frames (at 96kHz) each time --=20 2.25.1