mmap vs cmd

Hi!

I'm completely new to comedi _AND_ data acquisition in general
but I've managed to set up comedi-0.7.65 and comedilib-0.7.19 under
RH 7.3. I'm using a NI pci-6023e card and can get data out
of it using the comedilib-0.7.19/demo/cmd command.
The next thing I wanted to do was to use the mmap command
but it just prints out "0" for all channels. The reason for
wanting to use mmap is that I thought it would be faster, and
thus to be able to sample at full 200ks (with cmd, I get
"read: Input/output error" once I crank up frequency and number
of samples). So, basically I want see if my setup can sample at
200ks (top speed for the pci6023e card) without having to write
any code myself, once I'm convinced I'd spend some time to play
comedi:-)

But alas, the mmap command doesn't give me any sensible output.
I tried to strace it and found the address mismatch between the
two mmap2 calls (below) a bit strange, but maybe that's not the problem:
strace ./mmap -c 3 -n 1 -N 10 -F 10 -v
execve("./mmap", ["./mmap", "-c", "3", "-n", "1", "-N", "10", "-F", "10",
"-v"], [/* 34 vars */]) = 0
uname({sys="Linux", node="sensetux1", ...}) = 0
...init stuff...
write(2, "start:      now      0\n", 23start:      now      0
) = 23
write(2, "scan_begin: timer    100000000\n", 31scan_begin: timer
100000000
) = 31
write(2, "convert:    timer    3276750\n", 29convert:    timer    3276750
) = 29
write(2, "scan_end:   count    1\n", 23scan_end:   count    1
) = 23
write(2, "stop:       count    10\n", 24stop:       count    10
) = 24
ioctl(3, 0x80406409, 0xbffff830)        = 0
ioctl(3, 0xc02c640e, 0xbffff7a0)        = 0
write(2, "front = 0, back = 0\n", 20front = 0, back = 0
)   = 20
nanosleep({0, 10000000}, NULL)          = 0
...lots of naps...
ioctl(3, 0xc02c640e, 0xbffff7a0)        = 0
write(2, "front = 0, back = 0\n", 20front = 0, back = 0
)   = 20
nanosleep({0, 10000000}, NULL)          = 0
ioctl(3, 0xc02c640e, 0xbffff7a0)        = 0
write(2, "front = 20, back = 0\n", 21front = 20, back = 0
)  = 21
fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 1), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x40018000
write(1, "0 \n", 30
)                     = 3
write(1, "0 \n", 30
)                     = 3
write(1, "0 \n", 30
)                     = 3
write(1, "0 \n", 30
)                     = 3
write(1, "0 \n", 30
)                     = 3
write(1, "0 \n", 30
)                     = 3
write(1, "0 \n", 30
)                     = 3
write(1, "0 \n", 30
)                     = 3
write(1, "0 \n", 30
)                     = 3
write(1, "0 \n", 30
)                     = 3
ioctl(3, 0xc02c640e, 0xbffff7c0)        = 0
ioctl(3, 0xc02c640e, 0xbffff7a0)        = 0
write(2, "front = 20, back = 20\n", 22front = 20, back = 20
) = 22
nanosleep({0, 10000000}, NULL)          = 0
...etc...

Is it not correct that the read(comedi_fileno(dev),...) actually
has to do a copy from the device to its own buffer while the
mmap method should allow one to read directly from the buffer
used by comedi (presumably the buffer that the driver tells the
card to use for DMA)?

I'd very much appreciate your help with clearing up my
fuzzy understanding of these matters.

Best regards, Össi.
--
Örnólfur E. Rögnvaldsson
Specialist, Sensor Innovation
FORCE Technology, Park Alle 345, DK-2605 Brřndby, Denmark
+45 4326 7411  -  oer_at_force.dk  -  www.force.dk

Received on 2002-09-03Z11:43:53