[linux-audio-user] Miditech Midistudio-2 and Linux

Clemens Ladisch clemens at ladisch.de
Fri Jul 22 11:10:26 EDT 2005


Hector Centeno wrote:
> ok! I got alsa rebuilt and the keyboard recognized, this is the output
> of amidi when I play some notes:
>
> [root at localhost ~]# amidi -a -d -p hw:2,0,1
> 09
> 90 3C 5F
>    09
> 90 3C 00
>    09
> 90 3B 5D

This is the standard USB MIDI protocol from the USB Audio
specification; the driver already knows how to speak this.

Please remove the change from usbquirks.h and apply the patch below
(go to the alsa-driver directory and run "patch -p1 < patchfile");
then everything should work fine.


HTH
Clemens


-- 
Index: alsa/alsa-kernel/usb/usbaudio.h
===================================================================
--- alsa.orig/alsa-kernel/usb/usbaudio.h	2005-07-04 23:24:39.000000000 +0200
+++ alsa/alsa-kernel/usb/usbaudio.h	2005-07-22 14:34:32.000000000 +0200
@@ -167,6 +167,7 @@ struct snd_usb_audio {
 #define QUIRK_MIDI_NOVATION		10
 #define QUIRK_MIDI_RAW			11
 #define QUIRK_MIDI_EMAGIC		12
+#define QUIRK_MIDI_MIDITECH		13

 typedef struct snd_usb_audio_quirk snd_usb_audio_quirk_t;
 typedef struct snd_usb_midi_endpoint_info snd_usb_midi_endpoint_info_t;
@@ -210,6 +211,8 @@ struct snd_usb_midi_endpoint_info {
 /* for QUIRK_MIDI_EMAGIC, data points to a snd_usb_midi_endpoint_info
  * structure (out_cables and in_cables only) */

+/* for QUIRK_MIDI_MIDITECH, data is NULL */
+
 /*
  */

Index: alsa/alsa-kernel/usb/usbquirks.h
===================================================================
--- alsa.orig/alsa-kernel/usb/usbquirks.h	2005-07-04 23:24:39.000000000 +0200
+++ alsa/alsa-kernel/usb/usbquirks.h	2005-07-22 14:44:06.000000000 +0200
@@ -1379,6 +1379,25 @@ YAMAHA_DEVICE(0x7010, "UB99"),
 },

 {
+	USB_DEVICE_VENDOR_SPEC(0x4752, 0x0011),
+	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
+		.vendor_name = "Miditech",
+		.product_name = "Midistart-2",
+		.ifnum = 0,
+		.type = QUIRK_MIDI_MIDITECH
+	}
+},
+{
+	USB_DEVICE_VENDOR_SPEC(0x7104, 0x2202),
+	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
+		.vendor_name = "Miditech",
+		.product_name = "MidiStudio-2",
+		.ifnum = 0,
+		.type = QUIRK_MIDI_MIDITECH
+	}
+},
+
+{
 	/*
 	 * Some USB MIDI devices don't have an audio control interface,
 	 * so we have to grab MIDI streaming interfaces here.
Index: alsa/alsa-kernel/usb/usbaudio.c
===================================================================
--- alsa.orig/alsa-kernel/usb/usbaudio.c	2005-07-11 12:23:29.000000000 +0200
+++ alsa/alsa-kernel/usb/usbaudio.c	2005-07-22 14:37:34.000000000 +0200
@@ -2972,6 +2972,7 @@ static int snd_usb_create_quirk(snd_usb_
 	case QUIRK_MIDI_NOVATION:
 	case QUIRK_MIDI_RAW:
 	case QUIRK_MIDI_EMAGIC:
+	case QUIRK_MIDI_MIDITECH:
 		return snd_usb_create_midi_interface(chip, iface, quirk);
 	case QUIRK_COMPOSITE:
 		return create_composite_quirk(chip, iface, quirk);
Index: alsa/alsa-kernel/usb/usbmidi.c
===================================================================
--- alsa.orig/alsa-kernel/usb/usbmidi.c	2005-07-20 15:13:34.000000000 +0200
+++ alsa/alsa-kernel/usb/usbmidi.c	2005-07-22 14:41:04.000000000 +0200
@@ -1515,6 +1515,9 @@ int snd_usb_create_midi_interface(snd_us
 			       sizeof(snd_usb_midi_endpoint_info_t));
 			err = snd_usbmidi_detect_endpoints(umidi, &endpoints[0], 1);
 			break;
+		case QUIRK_MIDI_MIDITECH:
+			err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
+			break;
 		default:
 			snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type);
 			err = -ENXIO;





More information about the Linux-audio-user mailing list