All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about rawmidi input trigger
@ 2006-06-28 18:06 Lee Revell
  2006-06-28 18:16 ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Lee Revell @ 2006-06-28 18:06 UTC (permalink / raw)
  To: alsa-devel

I'm writing a MIDI driver for hardware that is not available yet, so for
now I'm just doing simulation.  To simulate MIDI input I just use a
timer that calls snd_rawmidi_receive(substream_input, &dummy_data, 1).

Is it normal for the MIDI input trigger callback to be called over and
over in a loop when I run "arecordmidi"?  Or should it only be called
once, when the stream is opened?

Lee


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

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

* Re: Question about rawmidi input trigger
  2006-06-28 18:06 Question about rawmidi input trigger Lee Revell
@ 2006-06-28 18:16 ` Takashi Iwai
  2006-06-28 18:23   ` Lee Revell
  0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2006-06-28 18:16 UTC (permalink / raw)
  To: Lee Revell; +Cc: alsa-devel

At Wed, 28 Jun 2006 14:06:59 -0400,
Lee Revell wrote:
> 
> I'm writing a MIDI driver for hardware that is not available yet, so for
> now I'm just doing simulation.  To simulate MIDI input I just use a
> timer that calls snd_rawmidi_receive(substream_input, &dummy_data, 1).
> 
> Is it normal for the MIDI input trigger callback to be called over and
> over in a loop when I run "arecordmidi"?  Or should it only be called
> once, when the stream is opened?

It's normal.  The driver should remember that the device was already
triggered and just ignore the succeeding trigger call or do some
useful thing (for example, mpu401_uart peeks the input FIFO for
hardwares that don't support proper input irq). 


Takashi

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

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

* Re: Question about rawmidi input trigger
  2006-06-28 18:16 ` Takashi Iwai
@ 2006-06-28 18:23   ` Lee Revell
  2006-06-28 18:27     ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Lee Revell @ 2006-06-28 18:23 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Wed, 2006-06-28 at 20:16 +0200, Takashi Iwai wrote:
> At Wed, 28 Jun 2006 14:06:59 -0400,
> Lee Revell wrote:
> > 
> > I'm writing a MIDI driver for hardware that is not available yet, so for
> > now I'm just doing simulation.  To simulate MIDI input I just use a
> > timer that calls snd_rawmidi_receive(substream_input, &dummy_data, 1).
> > 
> > Is it normal for the MIDI input trigger callback to be called over and
> > over in a loop when I run "arecordmidi"?  Or should it only be called
> > once, when the stream is opened?
> 
> It's normal.  The driver should remember that the device was already
> triggered and just ignore the succeeding trigger call or do some
> useful thing (for example, mpu401_uart peeks the input FIFO for
> hardwares that don't support proper input irq). 

OK, great.

I ask because I am working off of emumpu401.c as an example, which does:

static void
snd_emu10k1_midi_input_trigger(struct snd_rawmidi_substream *substream,
int up) 
{
[...]
        if (up)
                snd_emu10k1_intr_enable(emu, midi->rx_enable);
        else
                snd_emu10k1_intr_disable(emu, midi->rx_enable);
}

And it seemed kind of wrong that the EMU driver would enable RX
interrupts over and over while recording.

I guess it just means the EMU driver is not as efficient as it could
be?  ;-)

Lee


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

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

* Re: Question about rawmidi input trigger
  2006-06-28 18:23   ` Lee Revell
@ 2006-06-28 18:27     ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2006-06-28 18:27 UTC (permalink / raw)
  To: Lee Revell; +Cc: alsa-devel

At Wed, 28 Jun 2006 14:23:23 -0400,
Lee Revell wrote:
> 
> On Wed, 2006-06-28 at 20:16 +0200, Takashi Iwai wrote:
> > At Wed, 28 Jun 2006 14:06:59 -0400,
> > Lee Revell wrote:
> > > 
> > > I'm writing a MIDI driver for hardware that is not available yet, so for
> > > now I'm just doing simulation.  To simulate MIDI input I just use a
> > > timer that calls snd_rawmidi_receive(substream_input, &dummy_data, 1).
> > > 
> > > Is it normal for the MIDI input trigger callback to be called over and
> > > over in a loop when I run "arecordmidi"?  Or should it only be called
> > > once, when the stream is opened?
> > 
> > It's normal.  The driver should remember that the device was already
> > triggered and just ignore the succeeding trigger call or do some
> > useful thing (for example, mpu401_uart peeks the input FIFO for
> > hardwares that don't support proper input irq). 
> 
> OK, great.
> 
> I ask because I am working off of emumpu401.c as an example, which does:
> 
> static void
> snd_emu10k1_midi_input_trigger(struct snd_rawmidi_substream *substream,
> int up) 
> {
> [...]
>         if (up)
>                 snd_emu10k1_intr_enable(emu, midi->rx_enable);
>         else
>                 snd_emu10k1_intr_disable(emu, midi->rx_enable);
> }
> 
> And it seemed kind of wrong that the EMU driver would enable RX
> interrupts over and over while recording.
> 
> I guess it just means the EMU driver is not as efficient as it could
> be?  ;-)

Yeah, it can be optimized to check the current value :)


Takashi

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

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

end of thread, other threads:[~2006-06-28 18:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-28 18:06 Question about rawmidi input trigger Lee Revell
2006-06-28 18:16 ` Takashi Iwai
2006-06-28 18:23   ` Lee Revell
2006-06-28 18:27     ` Takashi Iwai

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.