Skip to contentSkip to conversation

ALSA: usb-audio: Add support for Akai MPC Element USB MIDI controller

PATCH In review Paul Bonser 3 participants 6 messages Jan 8, 2015 – Jan 9, 2015 Sound

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ALSA: usb-audio: Add support for Akai MPC Element USB MIDI controller

From: Paul Bonser <[email protected]>

The Akai MPC Element incorrectly reports its bInterfaceClass as 255, but otherwise implements the USB MIDI spec correctly.

This adds a quirks-table.h entry which allows the device to be recognized as a standard USB MIDI device.

---

sound/usb/quirks-table.h +22 -0
index 8590a32..e869b6c 100644
@@ -2516,6 +2516,28 @@ YAMAHA_DEVICE(0x7010, "UB99"),
 	}
 },
 
+{
+	/* Akai MPC Element */
+	USB_DEVICE(0x09e8, 0x0021),
+	.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = & (const struct snd_usb_audio_quirk[]) {
+			{
+				.ifnum = 0,
+				.type = QUIRK_IGNORE_INTERFACE
+			},
+			{
+				.ifnum = 1,
+				.type = QUIRK_MIDI_STANDARD_INTERFACE
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},
+
 /* TerraTec devices */
 {
 	USB_DEVICE_VENDOR_SPEC(0x0ccd, 0x0012),
#1 lore raw
Quoted 27 lines · Paul Bonser

The Akai MPC Element incorrectly reports its bInterfaceClass as 255, but otherwise implements the USB MIDI spec correctly.

This adds a quirks-table.h entry which allows the device to be recognized as a standard USB MIDI device.

---

sound/usb/quirks-table.h +11 -0
index 8590a32..e869b6c 100644
@@ -2516,6 +2516,28 @@ YAMAHA_DEVICE(0x7010, "UB99"),
 	}
 },
 
+{
+	/* Akai MPC Element */
+	USB_DEVICE(0x09e8, 0x0021),
+	.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = & (const struct snd_usb_audio_quirk[]) {
+			{
+				.ifnum = 0,
+				.type = QUIRK_IGNORE_INTERFACE
+			},

sound/usb/quirks-table.h YAMAHA_DEVICE(0x7010, "UB99"), · line 2539

Quoted 10 lines
sound/usb/quirks-table.h +10 -0
+			{
+				.ifnum = 1,
+				.type = QUIRK_MIDI_STANDARD_INTERFACE
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},

Why a composite quirk? Does a single quirk entry not work?

Regards,
Clemens

#2 lore raw
Quoted 32 lines · Clemens Ladisch
Quoted 31 lines · Paul Bonser

The Akai MPC Element incorrectly reports its bInterfaceClass as 255, but otherwise implements the USB MIDI spec correctly.

This adds a quirks-table.h entry which allows the device to be recognized as a standard USB MIDI device.

---

sound/usb/quirks-table.h +15 -0
index 8590a32..e869b6c 100644
@@ -2516,6 +2516,28 @@ YAMAHA_DEVICE(0x7010, "UB99"),
 	}
 },
 
+{
+	/* Akai MPC Element */
+	USB_DEVICE(0x09e8, 0x0021),
+	.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = & (const struct snd_usb_audio_quirk[]) {
+			{
+				.ifnum = 0,
+				.type = QUIRK_IGNORE_INTERFACE
+			},
+			{
+				.ifnum = 1,
+				.type = QUIRK_MIDI_STANDARD_INTERFACE
+			},
Quoted 8 lines

sound/usb/quirks-table.h YAMAHA_DEVICE(0x7010, "UB99"), · line 2539

Quoted 6 lines
sound/usb/quirks-table.h +6 -0
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},

Why a composite quirk? Does a single quirk entry not work?

A single quirk entry results in an error message in dmesg:
"snd-usb-audio: probe of 3-2:1.0 failed with error -5"

Adding the QUIRK_IGNORE_INTERFACE stops that.

Quoted 5 lines

Regards,
Clemens

#3 lore raw
Quoted 33 lines · Paul Bonser
Quoted 23 lines · Clemens Ladisch
Quoted 22 lines · Paul Bonser

The Akai MPC Element incorrectly reports its bInterfaceClass as 255, but otherwise implements the USB MIDI spec correctly.

This adds a quirks-table.h entry which allows the device to be recognized as a standard USB MIDI device.

+++ b/sound/usb/quirks-table.h

sound/usb/quirks-table.h +15 -0
+{
+	/* Akai MPC Element */
+	USB_DEVICE(0x09e8, 0x0021),
+	.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = & (const struct snd_usb_audio_quirk[]) {
+			{
+				.ifnum = 0,
+				.type = QUIRK_IGNORE_INTERFACE
+			},
+			{
+				.ifnum = 1,
+				.type = QUIRK_MIDI_STANDARD_INTERFACE
+			},
Quoted 8 lines

sound/usb/quirks-table.h YAMAHA_DEVICE(0x7010, "UB99"), · line 2539

Quoted 6 lines
sound/usb/quirks-table.h +6 -0
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},

Why a composite quirk? Does a single quirk entry not work?

Quoted 2 lines

A single quirk entry results in an error message in dmesg:
"snd-usb-audio: probe of 3-2:1.0 failed with error -5"

That message is normal for unhandled interfaces.

Does it actually prevent the device from working?

Regards,
Clemens

#4 lore raw

At Fri, 09 Jan 2015 09:48:42 +0100,

Quoted 35 lines · Clemens Ladisch
Quoted 33 lines · Paul Bonser
Quoted 31 lines · Clemens Ladisch
Quoted 18 lines · Paul Bonser

The Akai MPC Element incorrectly reports its bInterfaceClass as 255, but otherwise implements the USB MIDI spec correctly.

This adds a quirks-table.h entry which allows the device to be recognized as a standard USB MIDI device.

+++ b/sound/usb/quirks-table.h

sound/usb/quirks-table.h +11 -0
+{
+	/* Akai MPC Element */
+	USB_DEVICE(0x09e8, 0x0021),
+	.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = & (const struct snd_usb_audio_quirk[]) {
+			{
+				.ifnum = 0,
+				.type = QUIRK_IGNORE_INTERFACE
+			},

sound/usb/quirks-table.h YAMAHA_DEVICE(0x7010, "UB99"), · line 2539

Quoted 10 lines
sound/usb/quirks-table.h +10 -0
+			{
+				.ifnum = 1,
+				.type = QUIRK_MIDI_STANDARD_INTERFACE
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},

Why a composite quirk? Does a single quirk entry not work?

Quoted 4 lines
Quoted 2 lines

A single quirk entry results in an error message in dmesg:
"snd-usb-audio: probe of 3-2:1.0 failed with error -5"

That message is normal for unhandled interfaces.

It's still not good to show a message, so using QUIRK_IGNORE_INTERFACE is good enough as a workaround. So I applied it as is to for-next branch now. Though...

Quoted 1 line

Does it actually prevent the device from working?

... it's still interesting why it needs a special handling. If we find out more and have a better fix, let's put on top of the current patch.

thanks,

Takashi

#5 lore raw
Quoted 46 lines · Takashi Iwai

At Fri, 09 Jan 2015 09:48:42 +0100,

Quoted 35 lines · Clemens Ladisch
Quoted 33 lines · Paul Bonser
Quoted 31 lines · Clemens Ladisch
Quoted 18 lines · Paul Bonser

The Akai MPC Element incorrectly reports its bInterfaceClass as 255, but otherwise implements the USB MIDI spec correctly.

This adds a quirks-table.h entry which allows the device to be recognized as a standard USB MIDI device.

+++ b/sound/usb/quirks-table.h

sound/usb/quirks-table.h +11 -0
+{
+	/* Akai MPC Element */
+	USB_DEVICE(0x09e8, 0x0021),
+	.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = & (const struct snd_usb_audio_quirk[]) {
+			{
+				.ifnum = 0,
+				.type = QUIRK_IGNORE_INTERFACE
+			},

sound/usb/quirks-table.h YAMAHA_DEVICE(0x7010, "UB99"), · line 2539

Quoted 10 lines
sound/usb/quirks-table.h +10 -0
+			{
+				.ifnum = 1,
+				.type = QUIRK_MIDI_STANDARD_INTERFACE
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},

Why a composite quirk? Does a single quirk entry not work?

Quoted 4 lines
Quoted 2 lines

A single quirk entry results in an error message in dmesg:
"snd-usb-audio: probe of 3-2:1.0 failed with error -5"

That message is normal for unhandled interfaces.

It's still not good to show a message, so using QUIRK_IGNORE_INTERFACE is good enough as a workaround. So I applied it as is to for-next branch now. Though...

Quoted 5 lines
Quoted 1 line

Does it actually prevent the device from working?

... it's still interesting why it needs a special handling. If we find out more and have a better fix, let's put on top of the current patch.

Interface 0 is the empty audio control interface (with no endpoints) that standard USB MIDI devices have, but as with interface 1, it has its bInterfaceClass set to 255 instead of 1.

As far as I can tell the error does not prevent the device itself from working. I tried using QUIRK_AUDIO_STANDARD_INTERFACE and I believe it had the same error. I'm guessing this is because it has no endpoints, so the driver doesn't know what to do with it?