Skip to contentSkip to conversation

hdsp ghost midi device fix

PATCH In review thomas charbonnel 2 participants 2 messages Jan 28, 2005 – Jan 31, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hdsp ghost midi device fix

Hi,

The following patch, on top of the patches I submitted yesterday, prevents a ghost midi device to be created on cards with only one midi I/O (Multiface and HDSP9632).
It closes the ALSA bug #0000286.

Thomas

ChangeLog:
* Prevents the creation of a second midi device for cards with only one midi I/O

hdsp.c renamed from hdsp.c.old +8 -5
@@ -3670,7 +3670,7 @@
 			snd_hdsp_midi_input_read (&hdsp->midi[0]);
 		}
 	}
-	if (midi1 && midi1status) {
+	if (hdsp->io_type != Multiface && hdsp->io_type != H9632 && midi1 && midi1status) {
 		if (hdsp->use_midi_tasklet) {
 			/* we disable interrupts for this input until processing is done */
 			hdsp->control_register &= ~HDSP_Midi1InterruptEnable;
@@ -4827,10 +4827,11 @@
 		return err;
 	}
 
-
-	if ((err = snd_hdsp_create_midi(card, hdsp, 1)) < 0) {
-		snd_printk("Hammerfall-DSP: Error creating second midi interface\n");
-		return err;
+	if (hdsp->io_type == Digiface || hdsp->io_type == H9652) {
+		if ((err = snd_hdsp_create_midi(card, hdsp, 1)) < 0) {
+			snd_printk("Hammerfall-DSP: Error creating second midi interface\n");
+			return err;
+		}
 	}
 
 	if ((err = snd_hdsp_create_controls(card, hdsp)) < 0) {
@@ -4967,6 +4968,8 @@
 	hdsp->midi[1].input = NULL;
 	hdsp->midi[0].output = NULL;
 	hdsp->midi[1].output = NULL;
+	hdsp->midi[0].pending = 0;
+	hdsp->midi[1].pending = 0;
 	spin_lock_init(&hdsp->midi[0].lock);
 	spin_lock_init(&hdsp->midi[1].lock);
 	hdsp->iobase = NULL;
#1 lore raw

At Fri, 28 Jan 2005 18:17:39 +0100,

Quoted 8 lines · thomas charbonnel

Hi,

The following patch, on top of the patches I submitted yesterday, prevents a ghost midi device to be created on cards with only one midi I/O (Multiface and HDSP9632).
It closes the ALSA bug #0000286.

Quoted 7 lines

Thomas

ChangeLog:
* Prevents the creation of a second midi device for cards with only one midi I/O

Thanks. Applied to CVS.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl