comedi and interrupts

Hi,

i'm trying to enhance the command support for the adv_pci1710 so that it
supports scan_begin_src = TRIG_EXT.

Do do this i use TRIG_WAKE_EOS and count the number of samples. When the end
of on scan is reached, i switch back from pacer to external trigger. On the
next interrupt i switch back to using the pacer.

Now what happens is that i seem to loose interrupts. Sometimes the on-board
fifo is not empty after reading the one sample that should be there.

This even happens with (as i think) moderate sampling frequencies - i have
an external source for the external trigger with 1kHz and set the internal
pacer to 100000ns (10kHz) and do two samples per scan.

As i understand it interrupt_pci1710_every_sample() is the real ISR for this
board - it runs with all other interrupts disabled, so there should only be a
small delay between the interrupt and the calling of my the function. The
irq i'm using (IRQ 7) is not shared with any other board. Also, i'm not
doing any fancy stuff in there - my version is not much different from what
is in CVS.

Still, i get "A/D data dropout" messages all of the time. I've tried
compiling Comedi with RTAI and running an RTAI-enabled kernel, but it didn't
change anything.

It would be nice if anyone could share insight on the following speculations
on what is going wrong:

 * interrupt_pci1710_every_sample() is not really the ISR but is executed as
   the bottom-half (tasklet or softirq)
   
 * my hardware is too slow (P4 2.4GHz with i854d chipset and 512MB dual-ddr
   memory).
 
 * modern hardware with APICs has bad interrupt behaviour with respect to
   lots of interrupts per second
   
 * my interrupt routine is too slow (calling comedi_event() and
   comedi_putbuf() nearly every interrupt)
   
 * i'm stupid and have missed (or completely misunderstood) something
 

thanks,

Nils

Received on 2003-12-08Z15:06:08