From nobody Sat Sep 26 22:01:47 2026 Received: from sender4-op-o11.zoho.com (sender4-op-o11.zoho.com [136.143.188.11]) (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 CD6932AD2C; Sat, 29 Aug 2026 00:50:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.11 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787964646; cv=pass; b=GTqmVoqkCqTMneRQ2rcZIKF5r4FbWNt+6jV9n9z25isSW1UqGHafSgKji8rbwV8IF54can7HrZl4E56ZvjDZblNMeNVRDwWB/5zhoHjy6wvbKa/+Ksn6jSIzZzoKYQhOMBBy2eOcCSPCybBo/zzAmEgK+Mejmw319miAOzMQZr0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787964646; c=relaxed/simple; bh=1sEjwqWvAkiIRdxi4jChkAhGZ+4ZN2MCUrB289Okz1c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ImEOQgtlNZGD6keCfMl/FR1lGxbzln4hd5snnKzTShbfLbFJj5gLGkSgcDjQLSfuA6IbuiTvNmotlacNPExw14gqmLOVJki9hxm9la9iFRIrYFsgwHPU0IEWWtl9wxhcEtvNCmEve740rTwygugXMcD7aMXHpd8JSWripJ8Xm6Q= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=soh.re; spf=pass smtp.mailfrom=soh.re; dkim=pass (1024-bit key) header.d=soh.re header.i=jon@soh.re header.b=LtJnCoeD; arc=pass smtp.client-ip=136.143.188.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=soh.re Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soh.re Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=soh.re header.i=jon@soh.re header.b="LtJnCoeD" ARC-Seal: i=1; a=rsa-sha256; t=1787964613; cv=none; d=zohomail.com; s=zohoarc; b=mfH58SgtqNsQtdr5ZJZmu6V35YQ5SDTkoKbrb7o3SjoFwIwDtU4hHg39g6AqFdPie248qzPjQX/bdUQ4PDzYxpZKAqGL2sLEh8stg0CX26LW4oycO/2H3VQHRP6g40ZwYghimF3aSY/bi3ANcbS9+NJwY3GW5XeDPlT92HXscjY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787964613; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=lMh5TQOF+AgVpss4y7NGo4dyGSpcwBl56sCbbtKuyp4=; b=ZGDvlWmhR+IRIISck6Y98O1uSHImHyryOsqTU2vC0psI5E2cPpW5bhdLEw8bQSkNN0YkHI50a5u5nQOiqd5aTwfb4w0Fv6DNYi+gDbQ5U1GlS0LxaUbcic52Lt6BYKoLDVHolCH5tc1XjBJEBfdD2SPkFs5ndbQiC8hUT6GIkj4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=soh.re; spf=pass smtp.mailfrom=jon@soh.re; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1787964613; s=zmail; d=soh.re; i=jon@soh.re; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=lMh5TQOF+AgVpss4y7NGo4dyGSpcwBl56sCbbtKuyp4=; b=LtJnCoeDK5kefdCQuux/jQh83dauDIpK4qOxuCNJXIJ4TBhgyO4IYnY2PV4d8m4F 8oBkTukY2Xwl3F/eMuTl79ZSfWPNBia0c6GkJEPReo8tnVqhkYCkjohLJ5hzfTXX4X7 PCFnpAXDPHMgTuqmvbSzr5/OGtzhz76CpVaMrxmo= Received: by mx.zohomail.com with SMTPS id 1787964609497689.1917788456784; Fri, 28 Aug 2026 17:50:09 -0700 (PDT) From: Jonathan Seth Mainguy To: linux-sound@vger.kernel.org Cc: perex@perex.cz, tiwai@suse.com, niklas@aldervall.se, linux-kernel@vger.kernel.org, Jonathan Seth Mainguy Subject: [PATCH 1/4] ALSA: usb-audio: add Roland OCTA-CAPTURE multirate support Date: Fri, 28 Aug 2026 20:49:58 -0400 Message-ID: <20260829005001.534571-2-jon@soh.re> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260829005001.534571-1-jon@soh.re> References: <20260829005001.534571-1-jon@soh.re> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" The OCTA-CAPTURE provides one alternate setting for each supported sample rate. Add the 48, 96 and 192 kHz playback and capture settings. The existing S32_LE description causes the white-noise playback reported by Niklas Aldervall and other users. The device sends packed 24-bit samples, but S32_LE makes ALSA interpret each sample as a four-byte value, which misaligns the stream. USB captures and PCM streaming tests confirm that S24_3LE is the correct format for every setting. The device provides 10 playback and 12 capture channels through 96 kHz, and four channels in each direction at 192 kHz. Correct the product name in the commented override. Tested on a physical OCTA-CAPTURE with full-duplex streams at 44.1, 48, 96 and 192 kHz. Reported-by: Niklas Aldervall Closes: https://lore.kernel.org/alsa-devel/6b623cb6-3a9b-4fe4-a57c-9a165d26= 1692@aldervall.se/ Signed-off-by: Jonathan Seth Mainguy --- sound/usb/quirks-table.h | 104 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 100 insertions(+), 4 deletions(-) diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index dd02c6294edf..ef618a0f18d3 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -1227,15 +1227,15 @@ YAMAHA_DEVICE(0x7010, "UB99"), } }, { - /* only 44.1 kHz works at the moment */ + /* S24_3LE; altsettings 1-4 match the device clock. */ USB_DEVICE(0x0582, 0x0120), QUIRK_DRIVER_INFO { /* .vendor_name =3D "Roland", */ - /* .product_name =3D "OCTO-CAPTURE", */ + /* .product_name =3D "OCTA-CAPTURE", */ QUIRK_DATA_COMPOSITE { { QUIRK_DATA_AUDIOFORMAT(0) { - .formats =3D SNDRV_PCM_FMTBIT_S32_LE, + .formats =3D SNDRV_PCM_FMTBIT_S24_3LE, .channels =3D 10, .iface =3D 0, .altsetting =3D 1, @@ -1249,9 +1249,57 @@ YAMAHA_DEVICE(0x7010, "UB99"), .rate_table =3D (unsigned int[]) { 44100 } } }, + { + QUIRK_DATA_AUDIOFORMAT(0) { + .formats =3D SNDRV_PCM_FMTBIT_S24_3LE, + .channels =3D 10, + .iface =3D 0, + .altsetting =3D 2, + .altset_idx =3D 2, + .endpoint =3D 0x05, + .ep_attr =3D 0x05, + .rates =3D SNDRV_PCM_RATE_48000, + .rate_min =3D 48000, + .rate_max =3D 48000, + .nr_rates =3D 1, + .rate_table =3D (unsigned int[]) { 48000 } + } + }, + { + QUIRK_DATA_AUDIOFORMAT(0) { + .formats =3D SNDRV_PCM_FMTBIT_S24_3LE, + .channels =3D 10, + .iface =3D 0, + .altsetting =3D 3, + .altset_idx =3D 3, + .endpoint =3D 0x05, + .ep_attr =3D 0x05, + .rates =3D SNDRV_PCM_RATE_96000, + .rate_min =3D 96000, + .rate_max =3D 96000, + .nr_rates =3D 1, + .rate_table =3D (unsigned int[]) { 96000 } + } + }, + { + QUIRK_DATA_AUDIOFORMAT(0) { + .formats =3D SNDRV_PCM_FMTBIT_S24_3LE, + .channels =3D 4, + .iface =3D 0, + .altsetting =3D 4, + .altset_idx =3D 4, + .endpoint =3D 0x05, + .ep_attr =3D 0x05, + .rates =3D SNDRV_PCM_RATE_192000, + .rate_min =3D 192000, + .rate_max =3D 192000, + .nr_rates =3D 1, + .rate_table =3D (unsigned int[]) { 192000 } + } + }, { QUIRK_DATA_AUDIOFORMAT(1) { - .formats =3D SNDRV_PCM_FMTBIT_S32_LE, + .formats =3D SNDRV_PCM_FMTBIT_S24_3LE, .channels =3D 12, .iface =3D 1, .altsetting =3D 1, @@ -1265,6 +1313,54 @@ YAMAHA_DEVICE(0x7010, "UB99"), .rate_table =3D (unsigned int[]) { 44100 } } }, + { + QUIRK_DATA_AUDIOFORMAT(1) { + .formats =3D SNDRV_PCM_FMTBIT_S24_3LE, + .channels =3D 12, + .iface =3D 1, + .altsetting =3D 2, + .altset_idx =3D 2, + .endpoint =3D 0x85, + .ep_attr =3D 0x25, + .rates =3D SNDRV_PCM_RATE_48000, + .rate_min =3D 48000, + .rate_max =3D 48000, + .nr_rates =3D 1, + .rate_table =3D (unsigned int[]) { 48000 } + } + }, + { + QUIRK_DATA_AUDIOFORMAT(1) { + .formats =3D SNDRV_PCM_FMTBIT_S24_3LE, + .channels =3D 12, + .iface =3D 1, + .altsetting =3D 3, + .altset_idx =3D 3, + .endpoint =3D 0x85, + .ep_attr =3D 0x25, + .rates =3D SNDRV_PCM_RATE_96000, + .rate_min =3D 96000, + .rate_max =3D 96000, + .nr_rates =3D 1, + .rate_table =3D (unsigned int[]) { 96000 } + } + }, + { + QUIRK_DATA_AUDIOFORMAT(1) { + .formats =3D SNDRV_PCM_FMTBIT_S24_3LE, + .channels =3D 4, + .iface =3D 1, + .altsetting =3D 4, + .altset_idx =3D 4, + .endpoint =3D 0x85, + .ep_attr =3D 0x25, + .rates =3D SNDRV_PCM_RATE_192000, + .rate_min =3D 192000, + .rate_max =3D 192000, + .nr_rates =3D 1, + .rate_table =3D (unsigned int[]) { 192000 } + } + }, { QUIRK_DATA_MIDI_FIXED_ENDPOINT(2) { .out_cables =3D 0x0001, --=20 2.55.0 From nobody Sat Sep 26 22:01:47 2026 Received: from sender4-op-o12.zoho.com (sender4-op-o12.zoho.com [136.143.188.12]) (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 678C5231A23; Sat, 29 Aug 2026 00:50:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.12 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787964657; cv=pass; b=plOouJeE66krQcSXwyLGozimYSbAAXsB+naQbxMezavC8xKiX0uhYIZBc1qwwtQTogZGAEdjcXACufFSDABWsc4o3TXd7ArKnyvVK1uiMXYuXMGeBIEb0rRanHRylUUGDz/Ok6kqYWkcApy+GD06c+RbIl3tKIbsS6cV1kJw/oM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787964657; c=relaxed/simple; bh=hqVid05sXo2Y5XtykFtON6yQR4CvCozk3bsW36bwdfM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kzmwtrVIc1q/TIO598vEDQzcXNjwQpQ3kmeyqcFCIJhyWHCmDHoblCnj71AKmS7LY1V39Q+dJd5fNdporoaLED/d9a0JEFfYuR/azPK+MYJFH4KzIWCTBhccrcIkbtkkzlGMMrUeSvBcZ+R1fjJp8AHh/wTPyhrXvs7P8hC4GoQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=soh.re; spf=pass smtp.mailfrom=soh.re; dkim=pass (1024-bit key) header.d=soh.re header.i=jon@soh.re header.b=L+jb8KqJ; arc=pass smtp.client-ip=136.143.188.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=soh.re Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soh.re Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=soh.re header.i=jon@soh.re header.b="L+jb8KqJ" ARC-Seal: i=1; a=rsa-sha256; t=1787964616; cv=none; d=zohomail.com; s=zohoarc; b=GbJP5hQLIaJQPN0iDO0YT0HSvEXymjFu9SHPz3pgwtHUvP/ciJQhQ7YDxng6hCy2At0eDMAsmiwrHVIMH6/KpsW8Xwc3UsJ8pI+4DF8h8LQdp/+l6zuz32TuGhCfPpOiTmW/EMPVdNxrNKZZPtDmri2CxkivWfaG6bTY7tt/ueE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787964616; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZXJksmxYjcYv5lCh3/A2GHIMEHhoFas8aljForLYpoY=; b=Ns1t0kLBiH7DF2rDzy4OjsorxNpFh2L/ed9HNhFejMhpXnXo6mmZnXKBxf7w1gKI49FZZP31hq+x0AU1MG2CgDlnM6pHYUeHe3FzXN33FdrS8uRo63nReao10SyqmVOwUupnh2ZUczoibrvQZuXkOQPToZVvVpuyf+2qINJuTJE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=soh.re; spf=pass smtp.mailfrom=jon@soh.re; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1787964616; s=zmail; d=soh.re; i=jon@soh.re; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=ZXJksmxYjcYv5lCh3/A2GHIMEHhoFas8aljForLYpoY=; b=L+jb8KqJU/yi6ELZfy+w6xnU7gzxrS0VliMA6CiFSej2LrDKtwjC08nR36zh93gQ 0m8zly0142Y6AgxiIc3lIRHhNGzxIXkXJqNc6LAarQXwh3AyGIg/5VNP1YZqjv5jH/c 5YIKoaw+Z9QTg1O5oj9LN2QenMiJP5MDAZtTuLOc= Received: by mx.zohomail.com with SMTPS id 1787964614257231.2541926529036; Fri, 28 Aug 2026 17:50:14 -0700 (PDT) From: Jonathan Seth Mainguy To: linux-sound@vger.kernel.org Cc: perex@perex.cz, tiwai@suse.com, niklas@aldervall.se, linux-kernel@vger.kernel.org, Jonathan Seth Mainguy Subject: [PATCH 2/4] ALSA: usb-audio: expose OCTA-CAPTURE control MIDI cables Date: Fri, 28 Aug 2026 20:49:59 -0400 Message-ID: <20260829005001.534571-3-jon@soh.re> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260829005001.534571-1-jon@soh.re> References: <20260829005001.534571-1-jon@soh.re> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" The OCTA-CAPTURE uses cable 0 for MIDI. Control requests use cable 2, and replies use cable 1. Expose output cables 0 and 2 with mask 0x0005, and input cables 0 and 1 with mask 0x0003. Tested on a physical OCTA-CAPTURE. Control requests sent on cable 2 received matching readback replies on cable 1, while cable 0 remained available for MIDI. Signed-off-by: Jonathan Seth Mainguy Reported-by: Niklas Aldervall --- sound/usb/quirks-table.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index ef618a0f18d3..35eef9cf834b 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -1363,8 +1363,8 @@ YAMAHA_DEVICE(0x7010, "UB99"), }, { QUIRK_DATA_MIDI_FIXED_ENDPOINT(2) { - .out_cables =3D 0x0001, - .in_cables =3D 0x0001 + .out_cables =3D 0x0005, + .in_cables =3D 0x0003 } }, { QUIRK_DATA_IGNORE(3) }, --=20 2.55.0 From nobody Sat Sep 26 22:01:47 2026 Received: from sender5-op-o12.zoho.com (sender5-op-o12.zoho.com [165.173.182.12]) (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 C28CB2AD2C; Sat, 29 Aug 2026 00:51:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=165.173.182.12 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787964672; cv=pass; b=jg34kdpL+0obq6kDcE2jS1Nq9K3T/yyQnatzZ7wcmV9OjVyw5sp/CmvuJnn8NKEj0FHjdz5H7yRS6S5wuWGRwfC1nN6wwSexO4/APAeo1vZiv4A2rxk3sPCy9Qlx09aVgzfbFHRXjj0/9H6fRsPZWrH+XQW2FqX5+1XFI3W6KP0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787964672; c=relaxed/simple; bh=KcKC1lpd5M/MScUYNZMIZGW1zrmDVHSsSf9u2gafMIo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U8zR0UyDzaW7HQZGrb3ch3bBlvdpIggHgvKEo4HOYIHf6hklJmhHSW/Yk5ZZQLvgj/oeEnsRb8x9FatZLcD+9H01QqyWgTi2NpAgS4YWxU5PZDtPMkwzoVzM2BEJ1mIQiXV5k9kw5JMsEF67+5ZYSlXUCYQu5cESRKpimZapniE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=soh.re; spf=pass smtp.mailfrom=soh.re; dkim=pass (1024-bit key) header.d=soh.re header.i=jon@soh.re header.b=SLWl0ZZM; arc=pass smtp.client-ip=165.173.182.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=soh.re Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soh.re Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=soh.re header.i=jon@soh.re header.b="SLWl0ZZM" ARC-Seal: i=1; a=rsa-sha256; t=1787964620; cv=none; d=zohomail.com; s=zohoarc; b=M0KixUE2X4FvSnv0OWv7T+6lugmnStjMWs0IsVa7cwEJ/RiTaK5ZUe1gsMXrCucc/cRaH+xQZhZdm5uY38vHHwkmyGhqro7PTzBq7Cn1OBZTOdLxkmNCn3tvFhY2hyryvJybThjnrVDXCLwWBpvwUQOqvokpI/Vf3MV4PnqISL0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787964620; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=eGLCFh/sS8kocbDCnBxw63CA+DWB2qQYWqmiwR0wgiA=; b=WcoPGCS82fk14hSQffbYnbw31404I8E5CdQd5rCnzHNKX7AOAs6c8EpJ6hyL5xkLVe0jJKUSyB6qqVueicdjcSpMM3CFwAzYFPUjBd53kb94Kwu6BUj9jhv5ZxrznPgdnsab110aOVqHdZtqcsf7xw1zl0s6YmKANFAXy9gdTlU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=soh.re; spf=pass smtp.mailfrom=jon@soh.re; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1787964620; s=zmail; d=soh.re; i=jon@soh.re; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=eGLCFh/sS8kocbDCnBxw63CA+DWB2qQYWqmiwR0wgiA=; b=SLWl0ZZMM7t4OSXpwGMAGreXuy1BuvhrDs9071RTtGPQXpgWxJlD8ZlgAreXYvh5 svrzK8fQgVNUhOboXY3W6/Qzo+WRIZDL3O9g20+GgJVttQLXQVbMOEcWtcVAY7GQ7rp X84lsU0JgfB/a8NnvuBfRnPmQOOhWGcGpMSkr8A0= Received: by mx.zohomail.com with SMTPS id 1787964618085979.0671666183343; Fri, 28 Aug 2026 17:50:18 -0700 (PDT) From: Jonathan Seth Mainguy To: linux-sound@vger.kernel.org Cc: perex@perex.cz, tiwai@suse.com, niklas@aldervall.se, linux-kernel@vger.kernel.org, Jonathan Seth Mainguy Subject: [PATCH 3/4] ALSA: usb-audio: add Roland QUAD-CAPTURE multirate support Date: Fri, 28 Aug 2026 20:50:00 -0400 Message-ID: <20260829005001.534571-4-jon@soh.re> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260829005001.534571-1-jon@soh.re> References: <20260829005001.534571-1-jon@soh.re> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" The QUAD-CAPTURE provides alternate settings for 44.1, 48, 96 and 192 kHz. Its fixed quirk currently describes only 44.1 kHz. Add the remaining playback and capture settings. The device provides four playback and six capture channels through 96 kHz, and two channels in each direction at 192 kHz. Each setting uses an S32_LE container. Tested on a physical QUAD-CAPTURE with full-duplex streams at 44.1, 48, 96 and 192 kHz. Signed-off-by: Jonathan Seth Mainguy Reported-by: Niklas Aldervall --- sound/usb/quirks-table.h | 98 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index 35eef9cf834b..a1a33f11de4a 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -1374,7 +1374,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), } }, { - /* only 44.1 kHz works at the moment */ + /* S32_LE; altsettings 1-4 match the device clock. */ USB_DEVICE(0x0582, 0x012f), QUIRK_DRIVER_INFO { /* .vendor_name =3D "Roland", */ @@ -1396,6 +1396,54 @@ YAMAHA_DEVICE(0x7010, "UB99"), .rate_table =3D (unsigned int[]) { 44100 } } }, + { + QUIRK_DATA_AUDIOFORMAT(0) { + .formats =3D SNDRV_PCM_FMTBIT_S32_LE, + .channels =3D 4, + .iface =3D 0, + .altsetting =3D 2, + .altset_idx =3D 2, + .endpoint =3D 0x05, + .ep_attr =3D 0x05, + .rates =3D SNDRV_PCM_RATE_48000, + .rate_min =3D 48000, + .rate_max =3D 48000, + .nr_rates =3D 1, + .rate_table =3D (unsigned int[]) { 48000 } + } + }, + { + QUIRK_DATA_AUDIOFORMAT(0) { + .formats =3D SNDRV_PCM_FMTBIT_S32_LE, + .channels =3D 4, + .iface =3D 0, + .altsetting =3D 3, + .altset_idx =3D 3, + .endpoint =3D 0x05, + .ep_attr =3D 0x05, + .rates =3D SNDRV_PCM_RATE_96000, + .rate_min =3D 96000, + .rate_max =3D 96000, + .nr_rates =3D 1, + .rate_table =3D (unsigned int[]) { 96000 } + } + }, + { + QUIRK_DATA_AUDIOFORMAT(0) { + .formats =3D SNDRV_PCM_FMTBIT_S32_LE, + .channels =3D 2, + .iface =3D 0, + .altsetting =3D 4, + .altset_idx =3D 4, + .endpoint =3D 0x05, + .ep_attr =3D 0x05, + .rates =3D SNDRV_PCM_RATE_192000, + .rate_min =3D 192000, + .rate_max =3D 192000, + .nr_rates =3D 1, + .rate_table =3D (unsigned int[]) { 192000 } + } + }, { QUIRK_DATA_AUDIOFORMAT(1) { .formats =3D SNDRV_PCM_FMTBIT_S32_LE, @@ -1412,6 +1460,54 @@ YAMAHA_DEVICE(0x7010, "UB99"), .rate_table =3D (unsigned int[]) { 44100 } } }, + { + QUIRK_DATA_AUDIOFORMAT(1) { + .formats =3D SNDRV_PCM_FMTBIT_S32_LE, + .channels =3D 6, + .iface =3D 1, + .altsetting =3D 2, + .altset_idx =3D 2, + .endpoint =3D 0x85, + .ep_attr =3D 0x25, + .rates =3D SNDRV_PCM_RATE_48000, + .rate_min =3D 48000, + .rate_max =3D 48000, + .nr_rates =3D 1, + .rate_table =3D (unsigned int[]) { 48000 } + } + }, + { + QUIRK_DATA_AUDIOFORMAT(1) { + .formats =3D SNDRV_PCM_FMTBIT_S32_LE, + .channels =3D 6, + .iface =3D 1, + .altsetting =3D 3, + .altset_idx =3D 3, + .endpoint =3D 0x85, + .ep_attr =3D 0x25, + .rates =3D SNDRV_PCM_RATE_96000, + .rate_min =3D 96000, + .rate_max =3D 96000, + .nr_rates =3D 1, + .rate_table =3D (unsigned int[]) { 96000 } + } + }, + { + QUIRK_DATA_AUDIOFORMAT(1) { + .formats =3D SNDRV_PCM_FMTBIT_S32_LE, + .channels =3D 2, + .iface =3D 1, + .altsetting =3D 4, + .altset_idx =3D 4, + .endpoint =3D 0x85, + .ep_attr =3D 0x25, + .rates =3D SNDRV_PCM_RATE_192000, + .rate_min =3D 192000, + .rate_max =3D 192000, + .nr_rates =3D 1, + .rate_table =3D (unsigned int[]) { 192000 } + } + }, { QUIRK_DATA_MIDI_FIXED_ENDPOINT(2) { .out_cables =3D 0x0001, --=20 2.55.0 From nobody Sat Sep 26 22:01:47 2026 Received: from sender4-op-o12.zoho.com (sender4-op-o12.zoho.com [136.143.188.12]) (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 E5C572AD2C; Sat, 29 Aug 2026 00:51:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.12 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787964682; cv=pass; b=JzVBpYdlq4TRWlgDH/rvaV/ppC7IJZchHUSjX5wZ/kkbGZzgeHqzOSqIFVQkZ0KSTczljK3LPO66JoOHz2Wzompu2/qdyh6KEGqkS0a892t1Rv+Ym6DmuLusRyfN75y2SiL9zBTLjDbWh5i2s0/odW01y7vulznjmoc9RFjK19k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787964682; c=relaxed/simple; bh=tVXdyNOKYq3qisWP/jPBYLDndSKOYshz7xCR09Z+TcM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PSaMi5tRBEMe7JW/uLZp/Hl4l6KMApWWJ18y6c6RYSY/ZrccujDInTFeDIZVJkB5Cb7QiSLOnt0QRYB1wCzxsgOamfb2YAe1sCbkmCRJGGKO9UD2YsAauVtFX+dsztfibe+MjsSrX2wj6f8qvALG1nKBABPjl6r6r2EE9dm9er0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=soh.re; spf=pass smtp.mailfrom=soh.re; dkim=pass (1024-bit key) header.d=soh.re header.i=jon@soh.re header.b=OwHr1HNc; arc=pass smtp.client-ip=136.143.188.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=soh.re Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soh.re Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=soh.re header.i=jon@soh.re header.b="OwHr1HNc" ARC-Seal: i=1; a=rsa-sha256; t=1787964624; cv=none; d=zohomail.com; s=zohoarc; b=PT8VBHVoZ6m7y17X1GbbBxsJ4u5KlGp+gyWyb5H8EzmG+ewYDutgvlWDb8snACf8Gfk9IrvkH3+BDkuNa4UGEVaAltwwVrmyMg8PhiOLgkEAJn2aa+qCXkx2m+FJX8rzwkyMohCPFmwMUudlM6nMxa6DyyK0iRADyKttUNVzqoI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787964624; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=B2dQm398SYqYVR2Fx56qj0yNqkR/SFsRTmj7xa8dWK8=; b=RSmGiHLV47hgaEiiqeHjM/9vxUh2SICxJnXl9lYmk8LJS+SVai4euldJDSb2JCe8voA9RaKS5NenZzO6LDvIzD9b2WgPrySjKE6ziUR7mxebFnrAEbEkLrHdfdsw2jq11Ir/vWFTy+A+sa0/2oNsbg1Wjf/ppvQf8aihCAZWkks= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=soh.re; spf=pass smtp.mailfrom=jon@soh.re; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1787964624; s=zmail; d=soh.re; i=jon@soh.re; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=B2dQm398SYqYVR2Fx56qj0yNqkR/SFsRTmj7xa8dWK8=; b=OwHr1HNcknp0MaWnQl15EbmNknI19ziAywj6JdHfXWfoVSPszpbxgGpxtKIAATnT 4Rs/XRO38YP+4hxBYncznpwX4c243AWRrzLfXP6UBgr9Qc8pun3NVfg8diBze4PtMlW SxXbzbjl4PGPzHInUbIhZ/FMAE0JVvJ2B4bF/nfg= Received: by mx.zohomail.com with SMTPS id 1787964621972180.44364146302325; Fri, 28 Aug 2026 17:50:21 -0700 (PDT) From: Jonathan Seth Mainguy To: linux-sound@vger.kernel.org Cc: perex@perex.cz, tiwai@suse.com, niklas@aldervall.se, linux-kernel@vger.kernel.org, Jonathan Seth Mainguy Subject: [PATCH 4/4] ALSA: usb-audio: set Roland Capture rate during stream preparation Date: Fri, 28 Aug 2026 20:50:01 -0400 Message-ID: <20260829005001.534571-5-jon@soh.re> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260829005001.534571-1-jon@soh.re> References: <20260829005001.534571-1-jon@soh.re> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" Roland OCTA-CAPTURE and QUAD-CAPTURE select their hardware clock with a vendor control request. Streaming fails when the hardware clock differs from the rate selected for the USB endpoint. During stream preparation, read the hardware rate and send the rate request only when it differs from the selected endpoint rate. The control transfer can complete before the device reports the new clock rate, so poll readback every 25 ms and continue as soon as it matches. Forty attempts avoid hammering the control endpoint while bounding an unresponsive transition to one second. Run the transaction from the existing format-setup quirk, after ALSA has selected the endpoint rate and before data URBs are submitted. Hold the USB-audio device mutex so playback and capture preparation cannot issue overlapping clock changes. Apply the quirk to: 0582:0120 Roland OCTA-CAPTURE 0582:012f Roland QUAD-CAPTURE Tested on physical OCTA-CAPTURE and QUAD-CAPTURE units. Rate changes followed by full-duplex streaming succeeded at 44.1, 48, 96 and 192 kHz on both. External digital clocking on the OCTA-CAPTURE was tested at all supported rates: 44.1, 48 and 96 kHz. The OCTA-CAPTURE disables its digital input and output at 192 kHz, so external clocking is unavailable at that rate. Signed-off-by: Jonathan Seth Mainguy Reported-by: Niklas Aldervall --- sound/usb/quirks.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 91938172912a..4936d66f9591 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -3,6 +3,7 @@ */ =20 #include +#include #include #include #include @@ -1855,6 +1856,75 @@ static int rme_digiface_set_format_quirk(struct snd_= usb_substream *subs) return 0; } =20 +#define ROLAND_CAPTURE_RATE_REQUEST 3 +#define ROLAND_CAPTURE_RATE_READ_VALUE 0x0001 +#define ROLAND_CAPTURE_RATE_WRITE_VALUE 0x0008 +#define ROLAND_CAPTURE_RATE_WRITE_PREFIX 0x40 +#define ROLAND_CAPTURE_RATE_RETRIES 40 +#define ROLAND_CAPTURE_RATE_POLL_MS 25 + +/* + * OCTA-CAPTURE and QUAD-CAPTURE use the same vendor request for their + * hardware clock. A read returns the 24-bit little-endian rate followed = by + * a transition-status byte. A write carries 0x40 followed by the rate. + */ +static int roland_capture_read_rate(struct usb_device *dev, u32 *rate) +{ + u8 data[4]; + int err; + + err =3D snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), + ROLAND_CAPTURE_RATE_REQUEST, + USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, + ROLAND_CAPTURE_RATE_READ_VALUE, 0, + data, sizeof(data)); + if (err !=3D sizeof(data)) + return err < 0 ? err : -EIO; + + *rate =3D combine_triple(data); + return 0; +} + +static void roland_capture_set_rate(struct snd_usb_substream *subs) +{ + struct snd_usb_audio *chip =3D subs->stream->chip; + struct usb_device *dev =3D chip->dev; + u32 rate =3D subs->data_endpoint->cur_rate; + u32 current_rate; + u8 data[4]; + int err; + int i; + + /* Serialize playback and capture endpoint starts during a clock change. = */ + guard(mutex)(&chip->mutex); + err =3D roland_capture_read_rate(dev, ¤t_rate); + if (!err && current_rate =3D=3D rate) + return; + + data[0] =3D ROLAND_CAPTURE_RATE_WRITE_PREFIX; + data[1] =3D rate; + data[2] =3D rate >> 8; + data[3] =3D rate >> 16; + err =3D snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), + ROLAND_CAPTURE_RATE_REQUEST, + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, + ROLAND_CAPTURE_RATE_WRITE_VALUE, 0, + data, sizeof(data)); + if (err !=3D sizeof(data)) { + usb_audio_warn(chip, "cannot set Roland sample rate to %u Hz: %d\n", + rate, err < 0 ? err : -EIO); + return; + } + + for (i =3D 0; i < ROLAND_CAPTURE_RATE_RETRIES; i++) { + err =3D roland_capture_read_rate(dev, ¤t_rate); + if (!err && current_rate =3D=3D rate) + return; + msleep(ROLAND_CAPTURE_RATE_POLL_MS); + } + usb_audio_warn(chip, "Roland sample rate did not reach %u Hz\n", rate); +} + void snd_usb_set_format_quirk(struct snd_usb_substream *subs, const struct audioformat *fmt) { @@ -1885,6 +1955,10 @@ void snd_usb_set_format_quirk(struct snd_usb_substre= am *subs, case USB_ID(0x2a39, 0x3fa0): /* RME Digiface USB (alternate) */ rme_digiface_set_format_quirk(subs); break; + case USB_ID(0x0582, 0x0120): /* Roland OCTA-CAPTURE */ + case USB_ID(0x0582, 0x012f): /* Roland QUAD-CAPTURE */ + roland_capture_set_rate(subs); + break; } } =20 --=20 2.55.0