From: x.zupftom@web.de
To: Dave Phillips <dlphillips@woh.rr.com>, x.zupftom@web.de
Cc: linux-msdos@vger.kernel.org
Subject: Re: MIDI input
Date: Sat, 12 Jul 2008 15:38:02 +0200 [thread overview]
Message-ID: <206410256@web.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 505 bytes --]
Hi all,
Stas Sergeev sent me a patch offlist that fixed my problem (see attachment). Thank you so much, Stas! Would anyone be so kind and apply it to the repository?
Thomas W.
P.S.: I thought I already sent this to the list some weeks ago, but the typical "reply vs. reply all" error happened.
_________________________________________________________________
WEB.DE schenkt Ihnen jeden Monat einen hochkarätigen Blockbuster
von maxdome! Jetzt anmelden unter http://www.blockbuster.web.de
[-- Attachment #2: sb_irq3.diff --]
[-- Type: text/x-diff, Size: 4712 bytes --]
Index: src/dosext/sound/sound.c
===================================================================
--- src/dosext/sound/sound.c (revision 1864)
+++ src/dosext/sound/sound.c (working copy)
@@ -660,6 +660,8 @@
S_printf("MPU401: Read data port = 0x%02x, %i bytes still in queue\n",
r,Q_HOLDS(mpu401_info.data));
sb_deactivate_irq(SB_IRQ_MIDI);
+ if (Q_HOLDS(mpu401_info.data))
+ sb_activate_irq(SB_IRQ_MIDI);
break;
case 1:
/* Read status port */
Index: src/base/init/config.c
===================================================================
--- src/base/init/config.c (revision 1864)
+++ src/base/init/config.c (working copy)
@@ -302,9 +302,9 @@
}
}
- (*print)("\nSOUND:\nsb_base 0x%x\nsb_dma %d\nsb_hdma %d\nsb_irq %d\n"
+ (*print)("\nSOUND:\nengine %d\nsb_base 0x%x\nsb_dma %d\nsb_hdma %d\nsb_irq %d\n"
"mpu401_base 0x%x\nsb_dsp \"%s\"\nsb_mixer \"%s\"\nsound_driver \"%s\"\n",
- config.sb_base, config.sb_dma, config.sb_hdma, config.sb_irq,
+ config.sound, config.sb_base, config.sb_dma, config.sb_hdma, config.sb_irq,
config.mpu401_base, config.sb_dsp, config.sb_mixer, config.sound_driver);
(*print)("\nSOUND_OSS:\noss_min_frags 0x%x\noss_max_frags 0x%x\n"
"oss_stalled_frags 0x%x\noss_do_post %d\noss_min_extra_frags 0x%x\n"
Index: src/base/dev/sb16/sb16.h
===================================================================
--- src/base/dev/sb16/sb16.h (revision 1864)
+++ src/base/dev/sb16/sb16.h (working copy)
@@ -83,6 +83,7 @@
#define DSP_OUT_FIFO_TRIGGER 32
#define DSP_IN_FIFO_TRIGGER 32
#define MIDI_FIFO_SIZE 32
+#define MPU401_IN_FIFO_TRIGGER 1
struct rng_s midi_fifo_in;
struct rng_s midi_fifo_out;
void *dspio;
Index: src/base/dev/sb16/sb16.c
===================================================================
--- src/base/dev/sb16/sb16.c (revision 1864)
+++ src/base/dev/sb16/sb16.c (working copy)
@@ -323,6 +323,14 @@
return (sb.mixer_regs[0x82] & type);
}
+static void sb_request_irq(int type)
+{
+ if (type & SB_IRQ_DSP)
+ pic_request(pic_irq_list[sb_get_dsp_irq_num()]);
+ if (type & SB_IRQ_MPU401)
+ pic_request(pic_irq_list[CONFIG_MPU401_IRQ]);
+}
+
static void sb_activate_irq(int type)
{
S_printf("SB: Activating irq type %d\n", type);
@@ -330,10 +338,7 @@
S_printf("SB: Warning: Interrupt already active!\n");
return;
}
- if (type & SB_IRQ_DSP)
- pic_request(pic_irq_list[sb_get_dsp_irq_num()]);
- if (type & SB_IRQ_MPU401)
- pic_request(pic_irq_list[CONFIG_MPU401_IRQ]);
+ sb_request_irq(type);
sb.mixer_regs[0x82] |= type;
}
@@ -351,6 +356,14 @@
}
}
+static void sb_run_irq(int type)
+{
+ if (!sb_irq_active(type))
+ return;
+ S_printf("SB: Run irq type %d\n", type);
+ sb_request_irq(type);
+}
+
void sb_handle_dma(void)
{
sb.dma_count--;
@@ -528,7 +541,7 @@
/* for High-Speed mode reset means only exit High-Speed */
S_printf("SB: Reset called, exiting High-Speed DMA mode\n");
sb.dma_cmd = 0;
- } else if (sb_midi_input() && sb_midi_uart()) {
+ } else if (sb_midi_uart()) {
S_printf("SB: Reset called, exiting UART midi mode\n");
sb.midi_cmd = 0;
} else {
@@ -1134,7 +1147,7 @@
/* == DSP == */
case 0x0C: /* dsp write register */
- if (sb_midi_input() && sb_midi_uart()) {
+ if (sb_midi_uart()) {
sb_write_midi(value);
break;
}
@@ -1200,8 +1213,11 @@
rng_get(&sb.dsp_queue, &value);
S_printf("SB: Read 0x%x from SB DSP\n", value);
result = value;
- if (sb_midi_input() && sb_midi_int())
- sb_deactivate_irq(SB_IRQ_MIDI);
+ if (sb_midi_int()) {
+ if (!rng_count(&sb.dsp_queue))
+ sb_deactivate_irq(SB_IRQ_MIDI);
+ sb_run_irq(SB_IRQ_MIDI);
+ }
break;
case 0x0C: /* DSP Write Buffer Status */
@@ -1284,6 +1300,7 @@
r, rng_count(&sb.midi_fifo_in));
if (!rng_count(&sb.midi_fifo_in))
sb_deactivate_irq(SB_IRQ_MPU401);
+ sb_run_irq(SB_IRQ_MPU401);
break;
case 1:
/* Read status port */
@@ -1357,8 +1374,10 @@
process_sb_midi_input();
if (sb_midi_int())
sb_activate_irq(SB_IRQ_MIDI);
- } else if (sb.mpu401_uart)
- sb_activate_irq(SB_IRQ_MPU401);
+ } else if (sb.mpu401_uart) {
+ if (rng_count(&sb.midi_fifo_in) == MPU401_IN_FIFO_TRIGGER)
+ sb_activate_irq(SB_IRQ_MPU401);
+ }
}
void run_new_sb(void)
@@ -1382,7 +1401,7 @@
io_device.handler_name = "Midi Emulation";
io_device.start_addr = config.mpu401_base;
io_device.end_addr = config.mpu401_base + 0x001;
- io_device.irq = EMU_NO_IRQ;
+ io_device.irq = CONFIG_MPU401_IRQ;
io_device.fd = -1;
if (port_register_handler(io_device, 0) != 0)
error("MPU-401: Cannot registering port handler\n");
next reply other threads:[~2008-07-12 13:38 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-12 13:38 x.zupftom [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-06-18 22:41 MIDI input x.zupftom
2008-06-19 12:11 ` Dave Phillips
2008-06-18 20:47 x.zupftom
2008-06-18 22:09 ` Dave Phillips
2008-06-18 13:09 x.zupftom
2008-06-18 13:37 ` Dave Phillips
2008-06-16 21:22 x.zupftom
2008-06-16 23:23 ` Dave Phillips
2008-06-15 9:42 x.zupftom
2008-06-16 16:38 ` Dave Phillips
2008-06-13 21:54 x.zupftom
2008-06-13 18:09 x.zupftom
2008-06-12 23:47 x.zupftom
2008-06-13 0:50 ` Dave Phillips
2008-06-12 22:12 x.zupftom
2008-06-12 22:57 ` Tony Borras
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=206410256@web.de \
--to=x.zupftom@web.de \
--cc=dlphillips@woh.rr.com \
--cc=linux-msdos@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox