--- mtpav.c	2003-02-12 14:24:48.000000000 -0800
+++ mtpav-rpav.c	2003-02-12 14:29:45.000000000 -0800
@@ -135,6 +135,7 @@
 	u8 number;
 	u8 hwport;
 	u8 mode;
+	u8 running_status;
 	snd_rawmidi_substream_t *input;
 	snd_rawmidi_substream_t *output;
 } mtpav_port_t;
@@ -300,6 +301,11 @@
 					snd_rawmidi_substream_t *substream)
 {
 	u8 outbyte;
+	int bytes_copied;
+
+	// Get the outbye first, so we can emulate running status if
+	// necessary
+	bytes_copied = snd_rawmidi_transmit(substream, &outbyte, 1);
 
 	// send port change command if necessary
 
@@ -310,12 +316,19 @@
 		snd_mtpav_send_byte(mtp_card, port->hwport);
 		//snd_printk("new outport: 0x%x\n", (unsigned int) port->hwport);
 
+		if (bytes_copied == 1 && !(outbyte & 0x80))
+			snd_mtpav_send_byte(mtp_card, port->running_status);
 	}
 
 	// send data
 
-	while (snd_rawmidi_transmit(substream, &outbyte, 1) == 1)
+	while (bytes_copied == 1) {
+		if(outbyte & 0x80)
+			port->running_status = outbyte;
+		
 		snd_mtpav_send_byte(mtp_card, outbyte);
+		bytes_copied = snd_rawmidi_transmit(substream, &outbyte, 1);
+	}
 }
 
 static void snd_mtpav_output_write(snd_rawmidi_substream_t * substream)
