All of lore.kernel.org
 help / color / mirror / Atom feed
* HDSP midi debugged
@ 2003-06-27 16:20 Marcus Andersson
  2003-06-27 16:52 ` Jaroslav Kysela
  0 siblings, 1 reply; 3+ messages in thread
From: Marcus Andersson @ 2003-06-27 16:20 UTC (permalink / raw)
  To: alsa-devel

Hi,

I have found the reason for the loss of input bytes on the hdsp midi,
but I don't know how to correctly fix it.

The function snd_hdsp_midi_input_trigger() is repeatedly called with
up==true. This results in the input being flushed. Definitely not good.

Can someone tell me what this function is supposed to do? What does 'up'
mean? Why is the input flushed here?

Marcus


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php

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

* Re: HDSP midi debugged
  2003-06-27 16:20 HDSP midi debugged Marcus Andersson
@ 2003-06-27 16:52 ` Jaroslav Kysela
  2003-06-29 13:22   ` Marcus Andersson
  0 siblings, 1 reply; 3+ messages in thread
From: Jaroslav Kysela @ 2003-06-27 16:52 UTC (permalink / raw)
  To: Marcus Andersson; +Cc: alsa-devel@lists.sourceforge.net

On Fri, 27 Jun 2003, Marcus Andersson wrote:

> Hi,
> 
> I have found the reason for the loss of input bytes on the hdsp midi,
> but I don't know how to correctly fix it.
> 
> The function snd_hdsp_midi_input_trigger() is repeatedly called with
> up==true. This results in the input being flushed. Definitely not good.
> 
> Can someone tell me what this function is supposed to do? What does 'up'
> mean? Why is the input flushed here?

The input should be flushed only when the input was not triggered before.
The input is triggered constantly, because there is some polled hardware 
available.

This patch should fix this problem (commited also to CVS):

Index: hdsp.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/rme9652/hdsp.c,v
retrieving revision 1.36
diff -u -r1.36 hdsp.c
--- hdsp.c	14 Jun 2003 07:56:02 -0000	1.36
+++ hdsp.c	27 Jun 2003 16:52:32 -0000
@@ -1137,21 +1137,19 @@
 	hdsp_t *hdsp;
 	hdsp_midi_t *hmidi;
 	unsigned long flags;
+	u32 ie;
 
 	hmidi = (hdsp_midi_t *) substream->rmidi->private_data;
 	hdsp = hmidi->hdsp;
+	ie = hmidi->id ? HDSP_Midi1InterruptEnable : HDSP_Midi0InterruptEnable;
 	spin_lock_irqsave (&hdsp->lock, flags);
 	if (up) {
-		snd_hdsp_flush_midi_input (hdsp, hmidi->id);
-		if (hmidi->id) 
-			hdsp->control_register |= HDSP_Midi1InterruptEnable;
-		else 
-			hdsp->control_register |= HDSP_Midi0InterruptEnable;
+		if (!(hdsp->control_register & ie)) {
+			snd_hdsp_flush_midi_input (hdsp, hmidi->id);
+			hdsp->control_register |= ie;
+		}
 	} else {
-		if (hmidi->id) 
-			hdsp->control_register &= ~HDSP_Midi1InterruptEnable;
-		else 
-			hdsp->control_register &= ~HDSP_Midi0InterruptEnable;
+		hdsp->control_register &= ~ie;
 	}
 
 	hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
 

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php

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

* Re: HDSP midi debugged
  2003-06-27 16:52 ` Jaroslav Kysela
@ 2003-06-29 13:22   ` Marcus Andersson
  0 siblings, 0 replies; 3+ messages in thread
From: Marcus Andersson @ 2003-06-29 13:22 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel@lists.sourceforge.net

Jaroslav Kysela wrote:
> 
> On Fri, 27 Jun 2003, Marcus Andersson wrote:
> 
> > Hi,
> >
> > I have found the reason for the loss of input bytes on the hdsp midi,
> > but I don't know how to correctly fix it.
> >
> > The function snd_hdsp_midi_input_trigger() is repeatedly called with
> > up==true. This results in the input being flushed. Definitely not good.
> >
> > Can someone tell me what this function is supposed to do? What does 'up'
> > mean? Why is the input flushed here?
> 
> The input should be flushed only when the input was not triggered before.
> The input is triggered constantly, because there is some polled hardware
> available.
> 
> This patch should fix this problem (commited also to CVS):

Thank you. It solves all my midi problems with the hdsp.

Marcus


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01

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

end of thread, other threads:[~2003-06-29 13:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-27 16:20 HDSP midi debugged Marcus Andersson
2003-06-27 16:52 ` Jaroslav Kysela
2003-06-29 13:22   ` Marcus Andersson

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.