Re: [PATCH Comedilib] comedi_test: test_cmd_write_fast_1chan writes too much data

On Wednesday 23 February 2005 11:57 am, Ian Abbott wrote:
> I was running "comedi_test -v" on my new analog output driver and
> noticed that it was getting stuck in a loop during the
> "cmd_write_fast_1_chan" test.
>
> It turned out that the test had written more data to the buffer than was
> required to complete the acquisition (it was using cmd->stop_src =
> TRIG_COUNT) and then got stuck in a loop waiting for the buffer to
> empty.
>
> The attached patch stops the test_cmd_write_fast_1chan function writing
> more data than is required to complete the acquisition.

I applied your patch.  Really though, what is needed is for comedilib to 
provide an easy way check if a subdevice is busy, since just knowing that 
the card has read all the bytes out of the buffer is not enough in general 
(although perhaps it doesn't matter much for the purposes of the test), 
since the samples may still be sitting in the board's hardware fifo 
waiting to be output.  comedi_get_subdevice_flags() almost works, since 
the COMEDI_SUBDINFO ioctl does return the SDF_BUSY and SDF_BUSY_OWNER 
flags.  However, comedi_get_subdevice_flags() just returns a cached 
version of the flags that were read when the device was opened.  So I'm 
thinking comedi_get_subdevice_flags() should not cache but do the real 
ioctl each time it is called.

-- 
Frank

Received on 2005-02-27Z22:51:02