AO waveform bug (more)

I managed to get the analog output to work. Apparently, the
handle_b_interrupt function was resetting the analog output registers when
there was still an interrupt pending after trying to fill the output fifo.
The attached patch will disable fifo interrupts if there is not enough data
to fill the fifo. this patch is applied to the cvs snapshot from
2002-July-29.

--- SNIP ------------------------------
diff -u2 comedi/comedi/drivers/ni_mio_common.c comedi-rhk/comedi/drivers/ni_mio_common.c
--- comedi/comedi/drivers/ni_mio_common.c	2002-07-25 19:45:33.000000000 -0400
+++ comedi-rhk/comedi/drivers/ni_mio_common.c	2002-08-01 12:44:19.000000000 -0400
_at__at_ -584,5 +584,11 _at__at_
 
 	if(b_status&AO_FIFO_Request_St)
-		ni_ao_fifo_half_empty(dev,s);
+	{
+		if (!ni_ao_fifo_half_empty(dev,s))
+		{
+			ni_set_bits(dev, Interrupt_B_Enable_Register,
+				AO_FIFO_Interrupt_Enable|AO_Error_Interrupt_Enable, 0);
+		}
+	}
 
 	b_status=win_in(AO_Status_1_Register);
--- SNIP ------------------------------

So I have moved on to getting simultaneous input and output working, and
have a problem with the input portion. Apparently, input is also dropping
samples. The analog input code worked in comedi-0.7.65, but with the current
cvs version it drop samples.

I occasionally get this error in the kernel log:

ni_mio_common: BUG: DMA overwrite of free area

I have put a copy of the code I am using to test this at:

http://www.newimage.com/~rhk/aiotest.tar.gz

-Ray

Received on 2002-08-01Z16:50:40