All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: [PATCH 7/7] ALSA: usb-audio: add quirks for Roland QUAD/OCTO-CAPTURE
Date: Thu, 27 Jun 2013 22:20:34 +0200	[thread overview]
Message-ID: <51CC9E92.8070305@ladisch.de> (raw)
In-Reply-To: <51CC9D8B.7060601@ladisch.de>

The Roland Quad/Octo-Capture devices use some unknown vendor-specific
mechanism to switch sample rates (and to manage other controls).  To
prevent the driver from attempting to use any other than the default
44.1 kHz sample rate, use quirks to hide the other alternate settings.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
---
 sound/usb/quirks-table.h | 134 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 134 insertions(+)

diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index da4d87f..9c636c2 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -1581,6 +1581,140 @@ YAMAHA_DEVICE(0x7010, "UB99"),
 		}
 	}
 },
+{
+	/* only 44.1 kHz works at the moment */
+	USB_DEVICE(0x0582, 0x0120),
+	.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+		/* .vendor_name = "Roland", */
+		/* .product_name = "OCTO-CAPTURE", */
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = (const struct snd_usb_audio_quirk[]) {
+			{
+				.ifnum = 0,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = & (const struct audioformat) {
+					.formats = SNDRV_PCM_FMTBIT_S32_LE,
+					.channels = 10,
+					.iface = 0,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.endpoint = 0x05,
+					.ep_attr = 0x05,
+					.rates = SNDRV_PCM_RATE_44100,
+					.rate_min = 44100,
+					.rate_max = 44100,
+					.nr_rates = 1,
+					.rate_table = (unsigned int[]) { 44100 }
+				}
+			},
+			{
+				.ifnum = 1,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = & (const struct audioformat) {
+					.formats = SNDRV_PCM_FMTBIT_S32_LE,
+					.channels = 12,
+					.iface = 1,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.endpoint = 0x85,
+					.ep_attr = 0x25,
+					.rates = SNDRV_PCM_RATE_44100,
+					.rate_min = 44100,
+					.rate_max = 44100,
+					.nr_rates = 1,
+					.rate_table = (unsigned int[]) { 44100 }
+				}
+			},
+			{
+				.ifnum = 2,
+				.type = QUIRK_MIDI_FIXED_ENDPOINT,
+				.data = & (const struct snd_usb_midi_endpoint_info) {
+					.out_cables = 0x0001,
+					.in_cables  = 0x0001
+				}
+			},
+			{
+				.ifnum = 3,
+				.type = QUIRK_IGNORE_INTERFACE
+			},
+			{
+				.ifnum = 4,
+				.type = QUIRK_IGNORE_INTERFACE
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},
+{
+	/* only 44.1 kHz works at the moment */
+	USB_DEVICE(0x0582, 0x012f),
+	.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+		/* .vendor_name = "Roland", */
+		/* .product_name = "QUAD-CAPTURE", */
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = (const struct snd_usb_audio_quirk[]) {
+			{
+				.ifnum = 0,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = & (const struct audioformat) {
+					.formats = SNDRV_PCM_FMTBIT_S32_LE,
+					.channels = 4,
+					.iface = 0,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.endpoint = 0x05,
+					.ep_attr = 0x05,
+					.rates = SNDRV_PCM_RATE_44100,
+					.rate_min = 44100,
+					.rate_max = 44100,
+					.nr_rates = 1,
+					.rate_table = (unsigned int[]) { 44100 }
+				}
+			},
+			{
+				.ifnum = 1,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = & (const struct audioformat) {
+					.formats = SNDRV_PCM_FMTBIT_S32_LE,
+					.channels = 6,
+					.iface = 1,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.endpoint = 0x85,
+					.ep_attr = 0x25,
+					.rates = SNDRV_PCM_RATE_44100,
+					.rate_min = 44100,
+					.rate_max = 44100,
+					.nr_rates = 1,
+					.rate_table = (unsigned int[]) { 44100 }
+				}
+			},
+			{
+				.ifnum = 2,
+				.type = QUIRK_MIDI_FIXED_ENDPOINT,
+				.data = & (const struct snd_usb_midi_endpoint_info) {
+					.out_cables = 0x0001,
+					.in_cables  = 0x0001
+				}
+			},
+			{
+				.ifnum = 3,
+				.type = QUIRK_IGNORE_INTERFACE
+			},
+			{
+				.ifnum = 4,
+				.type = QUIRK_IGNORE_INTERFACE
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},
 /* this catches most recent vendor-specific Roland devices */
 {
 	.match_flags = USB_DEVICE_ID_MATCH_VENDOR |

  parent reply	other threads:[~2013-06-27 20:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-27 20:16 [git pull] [PATCH 0/7] add support for many Roland and Yamaha devices Clemens Ladisch
2013-06-27 20:18 ` [PATCH 1/7] ALSA: usb-audio: store protocol version in struct audioformat Clemens Ladisch
2013-07-09 18:34   ` Eldad Zack
2013-06-27 20:18 ` [PATCH 2/7] ALSA: usb-audio: detect implicit feedback on Roland devices Clemens Ladisch
2013-06-27 20:19 ` [PATCH 3/7] ALSA: usb-audio: add support for many Roland/Yamaha devices Clemens Ladisch
2013-06-27 20:19 ` [PATCH 4/7] ALSA: usb-audio: add MIDI port names for some Roland devices Clemens Ladisch
2013-06-27 20:19 ` [PATCH 5/7] ALSA: usb-audio: remove superfluous Roland quirks Clemens Ladisch
2013-06-27 20:20 ` [PATCH 6/7] ALSA: usb-audio: claim autodetected PCM interfaces all at once Clemens Ladisch
2013-06-27 20:20 ` Clemens Ladisch [this message]
2013-06-28 10:17 ` [git pull] [PATCH 0/7] add support for many Roland and Yamaha devices Takashi Iwai
2013-08-09 10:52 ` Keith A. Milner
2013-08-09 13:17   ` Clemens Ladisch
2013-08-09 15:02     ` Keith A. Milner
2013-08-09 18:18       ` Clemens Ladisch
2013-08-10 12:35         ` Keith A. Milner
2013-08-11  0:10         ` Keith A. Milner
2013-08-11 12:13           ` [PATCH] ALSA: usb-audio: fix automatic Roland/Yamaha MIDI detection Clemens Ladisch
2013-08-12  9:41             ` Takashi Iwai
2013-08-12 22:00             ` Keith A. Milner
2013-08-12 22:38             ` Keith A. Milner
2013-08-12 22:42               ` Keith A. Milner
2013-08-16 12:06               ` Keith A. Milner
2013-08-11 12:15           ` [git pull] [PATCH 0/7] add support for many Roland and Yamaha devices Clemens Ladisch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51CC9E92.8070305@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.