All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: MIDI input patch
@ 2009-07-12 17:03 x.zupftom
  0 siblings, 0 replies; 12+ messages in thread
From: x.zupftom @ 2009-07-12 17:03 UTC (permalink / raw)
  To: Dave Phillips, Samuel Bronson; +Cc: linux-msdos

> -----Ursprüngliche Nachricht-----
> Von: "Dave Phillips" <dlphillips@woh.rr.com>

> 
> Hi guys,
> 
> I'm still on the list and I still use Sequencer Plus under DOSemu. I'll 
> apply the patch and send a report, but I'm currently swamped with other 
> work. It'll be a few days before I can experiment with the patch.
> 

That's great!  As an experienced user you're certainly in a much better position to spot possible issues than me.

> Btw, did anyone ever get MIDI input working with Score ?
> 

Sure, me ;-)!  (Thanks a lot once more, Stas!)  It has always worked on machines with ISA MIDI connection running plain DOS or DOS-based Windows versions, but not any more on more recent hard- and software.  Some people tried to make it work with virtual machines, but without success.  If anyone should ever have succeeded, this hasn't been reported.

Thomas W.
______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: MIDI input patch
@ 2009-07-17 11:10 x.zupftom
  0 siblings, 0 replies; 12+ messages in thread
From: x.zupftom @ 2009-07-17 11:10 UTC (permalink / raw)
  To: Bart Oldeman; +Cc: linux-msdos

Hi again,

I just found out myself how to emulate the CPU.  I set $_cpu_emu to "vm86" in /etc/dosemu/dosemu.conf on my T22, and so far no more problems!  Seems to be a bug that only occurs when running on the real CPU.

Thomas W.



> -----Ursprüngliche Nachricht-----
> Von: <x.zupftom@web.de>
> Gesendet: 17.07.09 11:57:08
> An: Bart Oldeman <bartoldeman@users.sourceforge.net>
> CC: linux-msdos@vger.kernel.org
> Betreff: Re: MIDI input patch


> Hi all,
> 
> it's great that MIDI is working now with the latest SVN version. However, when trying to use it on my Thinkpad T22 (Pentium III, Xubuntu Jaunty, 2.6.28-13-generic kernel), there is another problem, both in revision 1897 and 1898. Two other people have reported this problem, too. I don't experience this problem on my desktop machine (AMD Athlon 64 X2 3800+ machine, Ubuntu Hardy, 2.6.24-24-generic kernel). So this could have to do something with a real vs. an emulated CPU. I tried to force CPU emulation on the T22 by starting dosemu with dosemu -I 'cpu emulated', but I'm not sure whether this works and if CPU emulation was at all included at compile time. How can I tell whether I compiled dosemu with CPU emulation or not? And how can I influence this?
> 
> I guess the problem might also be MIDI related, even if one doesn't use MIDI input because it occurs in input mode where Score expects music input via qwerty or MIDI keyboard (you can mix both, enter some notes via MIDI, some via qwerty). I removed the dosemu-midi_in links on both my machines for the following test (both running with the MIDI patch). When I start dosemu with "dosemu -O -D+S", the first debugging output after starting Score is when I enter input mode. On my AMD 64 machine, it looks as follows:
> 
> 
> MPU401: Read status port = 0xbf
> MPU401: Read status port = 0xbf
> MPU401: Write 0xff to command port
> SB: Activating irq type 4
> MPU401: Read status port = 0x3f
> MPU401: Read data port = 0xfe, 0 bytes still in queue
> SB: Deactivating irq type 4
> MPU401: Read status port = 0xbf
> MPU401: Write 0x3f to command port
> SB: Activating irq type 4
> MPU401: Read status port = 0x3f
> MPU401: Read data port = 0xfe, 0 bytes still in queue
> SB: Deactivating irq type 4
> 
> 
> On the T22 it's the same except for one word: The last line says "SB: Warning: Deactivating irq type 4". This raises my suspicion. Anyway, so far there is no problem. I can go on and enter music with the qwerty keyboard. When I'm finished with that and Score does not expect any further input, the next messages pop up on the console.
> 
> On the AMD64:
> 
> MPU401: Read status port = 0xbf
> MPU401: Read status port = 0xbf
> MPU401: Write 0xff to command port
> SB: Activating irq type 4
> MPU401: Read status port = 0x3f
> MPU401: Read data port = 0xfe, 0 bytes still in queue
> SB: Deactivating irq type 4
> 
> 
> On the T22, almost the same, except for the lines I marked with "=>":
> 
> MPU401: Read status port = 0xbf
> MPU401: Read status port = 0xbf
> MPU401: Write 0xff to command port
> SB: Activating irq type 4
> => SB: Interrupt activated
> => SB: Activated IRQ for MIDI
> MPU401: Read status port = 0x3f
> MPU401: Read data port = 0xfe, 0 bytes still in queue
> =>
> 
> The last line from my AMD64, "SB: Deactivating irq type 4", is missing in the T22 output.
> 
> However, both machines continue to work happily, until I want to enter input mode again. This causes dosemu on the T22 to hang. On the AMD machine everything is fine and the fresh debugging output looks exactly like when entering input mode the first time.
> 
> I can only guess what this all means. Does it mean, that the T22 missed to deactivate IRQ type 4 when leaving input mode and therefore can't read status port = 0xbf?? (I've no idea what's behind all this IRQ stuff.)
> 
> Can anyone help?
> 
> Thomas W.
> 
> ______________________________________________________
> GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://movieflat.web.de
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: MIDI input patch
@ 2009-07-17  9:56 x.zupftom
  0 siblings, 0 replies; 12+ messages in thread
From: x.zupftom @ 2009-07-17  9:56 UTC (permalink / raw)
  To: Bart Oldeman; +Cc: linux-msdos

Hi all,

it's great that MIDI is working now with the latest SVN version. However, when trying to use it on my Thinkpad T22 (Pentium III, Xubuntu Jaunty, 2.6.28-13-generic kernel), there is another problem, both in revision 1897 and 1898. Two other people have reported this problem, too. I don't experience this problem on my desktop machine (AMD Athlon 64 X2 3800+ machine, Ubuntu Hardy, 2.6.24-24-generic kernel). So this could have to do something with a real vs. an emulated CPU. I tried to force CPU emulation on the T22 by starting dosemu with dosemu -I 'cpu emulated', but I'm not sure whether this works and if CPU emulation was at all included at compile time. How can I tell whether I compiled dosemu with CPU emulation or not? And how can I influence this?

I guess the problem might also be MIDI related, even if one doesn't use MIDI input because it occurs in input mode where Score expects music input via qwerty or MIDI keyboard (you can mix both, enter some notes via MIDI, some via qwerty). I removed the dosemu-midi_in links on both my machines for the following test (both running with the MIDI patch). When I start dosemu with "dosemu -O -D+S", the first debugging output after starting Score is when I enter input mode. On my AMD 64 machine, it looks as follows:


MPU401: Read status port = 0xbf
MPU401: Read status port = 0xbf
MPU401: Write 0xff to command port
SB: Activating irq type 4
MPU401: Read status port = 0x3f
MPU401: Read data port = 0xfe, 0 bytes still in queue
SB: Deactivating irq type 4
MPU401: Read status port = 0xbf
MPU401: Write 0x3f to command port
SB: Activating irq type 4
MPU401: Read status port = 0x3f
MPU401: Read data port = 0xfe, 0 bytes still in queue
SB: Deactivating irq type 4


On the T22 it's the same except for one word: The last line says "SB: Warning: Deactivating irq type 4". This raises my suspicion. Anyway, so far there is no problem. I can go on and enter music with the qwerty keyboard. When I'm finished with that and Score does not expect any further input, the next messages pop up on the console.

On the AMD64:

MPU401: Read status port = 0xbf
MPU401: Read status port = 0xbf
MPU401: Write 0xff to command port
SB: Activating irq type 4
MPU401: Read status port = 0x3f
MPU401: Read data port = 0xfe, 0 bytes still in queue
SB: Deactivating irq type 4


On the T22, almost the same, except for the lines I marked with "=>":

MPU401: Read status port = 0xbf
MPU401: Read status port = 0xbf
MPU401: Write 0xff to command port
SB: Activating irq type 4
=> SB: Interrupt activated
=> SB: Activated IRQ for MIDI
MPU401: Read status port = 0x3f
MPU401: Read data port = 0xfe, 0 bytes still in queue
=>

The last line from my AMD64, "SB: Deactivating irq type 4", is missing in the T22 output.

However, both machines continue to work happily, until I want to enter input mode again. This causes dosemu on the T22 to hang. On the AMD machine everything is fine and the fresh debugging output looks exactly like when entering input mode the first time.

I can only guess what this all means. Does it mean, that the T22 missed to deactivate IRQ type 4 when leaving input mode and therefore can't read status port = 0xbf?? (I've no idea what's behind all this IRQ stuff.)

Can anyone help?

Thomas W.

______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: MIDI input patch
@ 2009-07-13  6:28 x.zupftom
  0 siblings, 0 replies; 12+ messages in thread
From: x.zupftom @ 2009-07-13  6:28 UTC (permalink / raw)
  To: Bart Oldeman; +Cc: linux-msdos

> -----Ursprüngliche Nachricht-----
> Von: "Bart Oldeman" <bartoldeman@users.sourceforge.net>
> Gesendet: 12.07.09 23:57:11
> An: x.zupftom@web.de
> CC: Samuel Bronson <naesten@gmail.com>, linux-msdos@vger.kernel.org
> Betreff: Re: MIDI input patch


> 2009/7/12  <x.zupftom@web.de>:
> > Let me add my apologies:  Obviously I made a mistake and sent my initial post twice as well.
> >
> > I'm aware that there has been conflict between Stas and other contributors (or a single maintainer?) in the past which caused him to resign as a maintainer.  I don't know the background of this, but he certainly is knowing the internals of Dosemu very well.  I would find it pretty sad if Stas' commitment wasn't honored and the bug fix would get lost because of personal resentments.  I would really like to promote Dosemu and see more people adopting it.
> 
> There were arguments, but there are no personal resentments on my
> part. Just that last year I spent almost 0 time on DOSEMU and I didn't
> check the emails very well. The patch is fine, and Stas is the expert
> on this code.
> 
> Thanks for reminding me: it is applied as r1898 in SVN.
> 
> Bart
> 


Great!  Thanks!
______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: MIDI input patch
  2009-07-12 17:49 x.zupftom
@ 2009-07-12 21:56 ` Bart Oldeman
  0 siblings, 0 replies; 12+ messages in thread
From: Bart Oldeman @ 2009-07-12 21:56 UTC (permalink / raw)
  To: x.zupftom; +Cc: Samuel Bronson, linux-msdos

2009/7/12  <x.zupftom@web.de>:
> Let me add my apologies:  Obviously I made a mistake and sent my initial post twice as well.
>
> I'm aware that there has been conflict between Stas and other contributors (or a single maintainer?) in the past which caused him to resign as a maintainer.  I don't know the background of this, but he certainly is knowing the internals of Dosemu very well.  I would find it pretty sad if Stas' commitment wasn't honored and the bug fix would get lost because of personal resentments.  I would really like to promote Dosemu and see more people adopting it.

There were arguments, but there are no personal resentments on my
part. Just that last year I spent almost 0 time on DOSEMU and I didn't
check the emails very well. The patch is fine, and Stas is the expert
on this code.

Thanks for reminding me: it is applied as r1898 in SVN.

Bart
--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: MIDI input patch
@ 2009-07-12 17:49 x.zupftom
  2009-07-12 21:56 ` Bart Oldeman
  0 siblings, 1 reply; 12+ messages in thread
From: x.zupftom @ 2009-07-12 17:49 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: linux-msdos

> -----Ursprüngliche Nachricht-----
> Von: "Samuel Bronson" <naesten@gmail.com>

> On Sun, Jul 12, 2009 at 8:49 AM, <x.zupftom@web.de> wrote:
> 
> > Sorry, I'm not familiar with the Dosemu code, neither are my programming
> > skills (not to mention my C skills) sufficient to dive into it.  I can
> > explain the (solved) problem in more detail (in words or possibly as
> > screencast, if this helps) and provide logs from patched and unpatched
> > versions for comparison.
> 
> That's fine, I thought that likely. Which program was it that the patch
> fixed things for? Was there a public thread about it back then?
> 

Here is the archived thread:
  http://thread.gmane.org/gmane.linux.msdos.general/5314

And one later post by me (sorry, I messed up the thread):
  http://article.gmane.org/gmane.linux.msdos.general/5337

> > The problem with evaluating this patch is probably that there are hardly any
> > people using MIDI input with Dosemu, I suspect.  Dave Phillips who is using
> > (or used to use) Sequencer Plus Gold by Voyetra with Dosemu helped me with
> > getting MIDI input into Dosemu.  I could try and install that software to
> > see whether this program also works with the patch.
> 
> Yeah, that's definitely an issue. What would one need to do to test this,
> anyway?

A working MIDI setup (MIDI keyboard connected to the computer) and a DOS program that uses MIDI input.  I can't share Score, it's commercial software that's still being sold.  But the Voyetra sequencer is available for free:
  http://support.turtlebeach.com/site/kb_ftp/340.asp

Obviously this program follows a completely different strategy for reading MIDI data.  For a sequencer low latency and accurate timing are essential.  For notation software this obviously isn't an issue.  I guess Score is taking a more lazy approach.

> 
> P.S. Sorry that you'll have received this twice, the first time I
> forgot that VGER detests HTML :-(

Let me add my apologies:  Obviously I made a mistake and sent my initial post twice as well.

I'm aware that there has been conflict between Stas and other contributors (or a single maintainer?) in the past which caused him to resign as a maintainer.  I don't know the background of this, but he certainly is knowing the internals of Dosemu very well.  I would find it pretty sad if Stas' commitment wasn't honored and the bug fix would get lost because of personal resentments.  I would really like to promote Dosemu and see more people adopting it.

Thomas W.
______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: MIDI input patch
  2009-07-12 14:19 ` Samuel Bronson
@ 2009-07-12 14:30   ` Dave Phillips
  0 siblings, 0 replies; 12+ messages in thread
From: Dave Phillips @ 2009-07-12 14:30 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: x.zupftom, linux-msdos

Samuel Bronson wrote:
> On Sun, Jul 12, 2009 at 8:49 AM, <x.zupftom@web.de> wrote:
>   
>   
>> The problem with evaluating this patch is probably that there are hardly any
>> people using MIDI input with Dosemu, I suspect.  Dave Phillips who is using
>> (or used to use) Sequencer Plus Gold by Voyetra with Dosemu helped me with
>> getting MIDI input into Dosemu.  I could try and install that software to
>> see whether this program also works with the patch.
>>     
>
> Yeah, that's definitely an issue. What would one need to do to test this,
> anyway?
>
>   
Hi guys,

I'm still on the list and I still use Sequencer Plus under DOSemu. I'll 
apply the patch and send a report, but I'm currently swamped with other 
work. It'll be a few days before I can experiment with the patch.

Btw, did anyone ever get MIDI input working with Score ?

Best,

dp



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: MIDI input patch
  2009-07-12 12:49 x.zupftom
@ 2009-07-12 14:19 ` Samuel Bronson
  2009-07-12 14:30   ` Dave Phillips
  0 siblings, 1 reply; 12+ messages in thread
From: Samuel Bronson @ 2009-07-12 14:19 UTC (permalink / raw)
  To: x.zupftom; +Cc: linux-msdos

On Sun, Jul 12, 2009 at 8:49 AM, <x.zupftom@web.de> wrote:

> Sorry, I'm not familiar with the Dosemu code, neither are my programming
> skills (not to mention my C skills) sufficient to dive into it.  I can
> explain the (solved) problem in more detail (in words or possibly as
> screencast, if this helps) and provide logs from patched and unpatched
> versions for comparison.

That's fine, I thought that likely. Which program was it that the patch
fixed things for? Was there a public thread about it back then?

> The problem with evaluating this patch is probably that there are hardly any
> people using MIDI input with Dosemu, I suspect.  Dave Phillips who is using
> (or used to use) Sequencer Plus Gold by Voyetra with Dosemu helped me with
> getting MIDI input into Dosemu.  I could try and install that software to
> see whether this program also works with the patch.

Yeah, that's definitely an issue. What would one need to do to test this,
anyway?

P.S. Sorry that you'll have received this twice, the first time I
forgot that VGER detests HTML :-(

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: MIDI input patch
@ 2009-07-12 12:49 x.zupftom
  2009-07-12 14:19 ` Samuel Bronson
  0 siblings, 1 reply; 12+ messages in thread
From: x.zupftom @ 2009-07-12 12:49 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: linux-msdos

> -----Ursprüngliche Nachricht-----
> Von: "Samuel Bronson" <naesten@gmail.com>

> On Sat, Jul 11, 2009 at 8:15 PM, <x.zupftom@web.de> wrote:
> > Hi,
> >
> > a year ago (crazy, it's actually to the day a year ago) I sent a patch to the list that Stas Sergeev sent me which fixed a MIDI input problem.  Today I've been installing Dosemu on another machine and found the patch hasn't been applied to the repository.  After applying it manually, everything works fine.  Any reason why it didn't make it into the SVN repository? > Would be great if someone could do it!
> 
> Do you know what exactly all this actually does?

Sorry, I'm not familiar with the Dosemu code, neither are my programming skills (not to mention my C skills) sufficient to dive into it.  I can explain the (solved) problem in more detail (in words or possibly as screencast, if this helps) and provide logs from patched and unpatched versions for comparison.

My amateurish impression is that the unpatched dosemu isn't compatible with the program's MIDI polling strategy.  MIDI events are only taking effect with great delay.  If I'm lucky, after entering a few notes, they all pop up in the program with a delay of one or two seconds in between two notes while I'm watching.  Some events are lost entirely (particularly annoying if note-off events are lost).  Sometimes obviously events are stuck in the queue and only "pushed out" by following events, typically two notes at a time.  As long as there are events in the queue (either "stuck" or going to pop up in a few seconds), the program does not react to the qwerty keyboard.

Hopefully with this information the patch, which fixes all of this, makes more sense to you.

The problem with evaluating this patch is probably that there are hardly any people using MIDI input with Dosemu, I suspect.  Dave Phillips who is using (or used to use) Sequencer Plus Gold by Voyetra with Dosemu helped me with getting MIDI input into Dosemu.  I could try and install that software to see whether this program also works with the patch.

I hope the patch will eventually make it into mainstream distros because I know some people who are making a living from serious large scale work for major players in the music publishing industry with Score, the notation program I'm using in Dosemu.  But in order to use MIDI input, they have to maintain old machines with ISA hardware because (to my knowledge) no one in the Score community ever had success with getting MIDI input into Score with an emulator or a virtual machine.  That's annoying.  Most of them never touched a Linux box and likely won't be ready to patch, compile and install Dosemu manually (that's still a challenging job for me, and I have gained at least a bit of experience over the past few years I have been using Linux more or less frequently).

If I can help with further information, logs etc., then please let me know.

Thomas W.
________________________________________________________________
Neu: WEB.DE Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://produkte.web.de/go/02/

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: MIDI input patch
  2009-07-12  0:15 x.zupftom
@ 2009-07-12  1:20 ` Samuel Bronson
  0 siblings, 0 replies; 12+ messages in thread
From: Samuel Bronson @ 2009-07-12  1:20 UTC (permalink / raw)
  To: x.zupftom; +Cc: linux-msdos

On Sat, Jul 11, 2009 at 8:15 PM, <x.zupftom@web.de> wrote:
> Hi,
>
> a year ago (crazy, it's actually to the day a year ago) I sent a patch to the list that Stas Sergeev sent me which fixed a MIDI input problem.  Today I've been installing Dosemu on another machine and found the patch hasn't been applied to the repository.  After applying it manually, everything works fine.  Any reason why it didn't make it into the SVN repository? > Would be great if someone could do it!

Do you know what exactly all this actually does?
--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* MIDI input patch
@ 2009-07-12  0:41 x.zupftom
  0 siblings, 0 replies; 12+ messages in thread
From: x.zupftom @ 2009-07-12  0:41 UTC (permalink / raw)
  To: linux-msdos

Hi,

a year ago (crazy, it's actually to the day a year ago) I sent a patch to the list that Stas Sergeev sent me which fixed a MIDI input problem. Today I've been installing Dosemu on another machine and found the patch hasn't been applied to the repository. After applying it manually, everything works fine. Any reason why it didn't make it into the SVN repository? Would be great if someone could do it!

Thomas W.



Here is the patch:


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");
________________________________________________________________
Neu: WEB.DE Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://produkte.web.de/go/02/

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* MIDI input patch
@ 2009-07-12  0:15 x.zupftom
  2009-07-12  1:20 ` Samuel Bronson
  0 siblings, 1 reply; 12+ messages in thread
From: x.zupftom @ 2009-07-12  0:15 UTC (permalink / raw)
  To: linux-msdos

Hi,

a year ago (crazy, it's actually to the day a year ago) I sent a patch to the list that Stas Sergeev sent me which fixed a MIDI input problem.  Today I've been installing Dosemu on another machine and found the patch hasn't been applied to the repository.  After applying it manually, everything works fine.  Any reason why it didn't make it into the SVN repository?  Would be great if someone could do it!

Thomas W.



Here is the patch:


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");







______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-07-17 11:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-12 17:03 MIDI input patch x.zupftom
  -- strict thread matches above, loose matches on Subject: below --
2009-07-17 11:10 x.zupftom
2009-07-17  9:56 x.zupftom
2009-07-13  6:28 x.zupftom
2009-07-12 17:49 x.zupftom
2009-07-12 21:56 ` Bart Oldeman
2009-07-12 12:49 x.zupftom
2009-07-12 14:19 ` Samuel Bronson
2009-07-12 14:30   ` Dave Phillips
2009-07-12  0:41 x.zupftom
2009-07-12  0:15 x.zupftom
2009-07-12  1:20 ` Samuel Bronson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.