Problems with comedi/libcomedi on Kubuntu 18.04

22 views
Skip to first unread message

Will Hardiman

unread,
Feb 8, 2021, 10:35:14 AM2/8/21
to Comedi: Linux Control and Measurement Device Interface
Hi all,

I've been struggling to get comedi working again after a fresh install of Kubuntu. I currently have an NI-6220 in the machine, although I've mostly been testing this with an NI-6221, and getting the same problem. I don't think this is a problem with the card because I've tried this with two cards which have not been problematic before, and get the same behaviour.

I will put the output from comedi_test at the bottom of this message.

I'm using the kernel module Comedi which was installed by default, the only configuration I've changed is the read-buffer size. I'm currently using libcomedi from here: https://launchpad.net/~delmic-soft/+archive/ubuntu/odemis/ although this behaviour was the same when using the default libcomedi and when I built libcomedi from the git source.

I have my card connected and channel AI0 is short circuited.

When I run the tutorial programs 1 or 2, they give me an out of range error. When I run tutorial program 3 (asynchronous acquisition), I mostly just get -10.0000V as the reading, although sometimes (I can't work out what causes this) it will give me readings between -10V and +10V, always drifting towards one end of the range or the other, before saturating. Running tutorial program 2 also gives the out of range error when program 3 is giving me non- -10V values.

I noticed the following from `dmesg | grep comedi`: "[  939.491184] comedi comedi0: mite: DMA overwrite of free area" repeated 7 times over the course of 0.1s. I will include all the lines from dmesg below this message.

I would really appreciate any help with figuring out what is going on and how to fix it!



comedi_test:


I: Comedi version: 0.7.76
I: Comedilib version: unknown =)
I: driver name: ni_pcimio
I: device name: pci-6220
I:
I: subdevice 0
I: testing info...
rev 1
I: subdevice type: 1 (analog input)
 number of channels: 16
 max data value: 65535
 ranges:
   all chans: [-10,10] [-5,5] [-1,1] [-0.2,0.2]
I: testing insn_read...
rev 1
comedi_do_insn returned 1, good
I: testing insn_read_0...
comedi_do_insn returned 0, good
I: testing insn_read_time...
rev 1
comedi_do_insn: 3
read time: 16 us
I: testing cmd_no_cmd...
not applicable
I: testing cmd_probe_src_mask...
rev 1
command source mask:
 start: now|ext|int
 scan_begin: timer|ext
 convert: timer|ext
 scan_end: count
 stop: none|count
I: testing cmd_probe_fast_1chan...
command fast 1chan:
 start: now 0
 scan_begin: timer 4000
 convert: timer 4000
 scan_end: count 1
 stop: count 2
I: testing cmd_read_fast_1chan...
I: testing cmd_write_fast_1chan...
not applicable
I: testing cmd_logic_bug...
rev 1
command_test returned 1, good
I: testing cmd_fifo_depth_check...
64, 1
128, 1
256, 1
512, 1
1024, 1
2048, 1
4096, 2
8192, 4
16384, 8
32768, 16
I: testing cmd_start_inttrig...
I: testing mmap...
0x7f0876df7000 ok
0x7f0876df8000 ok
0x7f0876df9000 ok
0x7f0876dfa000 ok
0x7f0876dfb000 ok
compare ok
0x7f0876df7000 segfaulted (ok)
0x7f0876df8000 segfaulted (ok)
0x7f0876df9000 segfaulted (ok)
0x7f0876dfa000 segfaulted (ok)
0x7f0876dfb000 segfaulted (ok)
I: testing read_select...
I: testing bufconfig...
buffer size 131072
max buffer size 131072
setting buffer size to 4096
buffer size set to 4096
buffer size now at 4096
setting buffer size past limit, 135168
got EPERM, good
setting buffer size to max, 131072
buffer size now at 131072
I:
I: subdevice 1
I: testing info...
rev 1
I: subdevice type: 0 (unused)
I: testing insn_read...
rev 1
comedi_do_insn: EIO, good
I: testing insn_read_0...
not applicable
I: testing insn_read_time...
rev 1
not applicable
I: testing cmd_no_cmd...
got EIO, good
I: testing cmd_probe_src_mask...
not applicable
I: testing cmd_probe_fast_1chan...
not applicable
I: testing cmd_read_fast_1chan...
not applicable
I: testing cmd_write_fast_1chan...
not applicable
I: testing cmd_logic_bug...
not applicable
I: testing cmd_fifo_depth_check...
not applicable
I: testing cmd_start_inttrig...
not applicable
I: testing mmap...
not applicable
I: testing read_select...
not applicable
I: testing bufconfig...
buffer length is 0, good
I:
I: subdevice 2
I: testing info...
rev 1
I: subdevice type: 5 (digital I/O)
 number of channels: 8
 max data value: 1
 ranges:
   all chans: [0,5]
I: testing insn_read...
rev 1
comedi_do_insn returned 1, good
I: testing insn_read_0...
comedi_do_insn returned 0, good
I: testing insn_read_time...
rev 1
comedi_do_insn: 3
read time: 1 us
I: testing cmd_no_cmd...
not applicable
I: testing cmd_probe_src_mask...
rev 1
command source mask:
 start: int
 scan_begin: ext
 convert: now
 scan_end: count
 stop: none
I: testing cmd_probe_fast_1chan...
command fast 1chan:
 not supported
I: testing cmd_read_fast_1chan...
not applicable
I: testing cmd_write_fast_1chan...
 not supported
I: testing cmd_logic_bug...
rev 1
not applicable (no source choices)
I: testing cmd_fifo_depth_check...
not applicable
I: testing cmd_start_inttrig...
not applicable
I: testing mmap...
not applicable
I: testing read_select...
not applicable
I: testing bufconfig...
buffer size 0
max buffer size 20971520
setting buffer size to 4096
buffer size set to 4096
buffer size now at 4096
setting buffer size past limit, 20975616
got EPERM, good
setting buffer size to max, 20971520
E: comedi_set_buffer_size: Cannot allocate memory
I:
I: subdevice 3
I: testing info...
rev 1
I: subdevice type: 0 (unused)
I: testing insn_read...
rev 1
comedi_do_insn: EIO, good
I: testing insn_read_0...
not applicable
I: testing insn_read_time...
rev 1
not applicable
I: testing cmd_no_cmd...
got EIO, good
I: testing cmd_probe_src_mask...
not applicable
I: testing cmd_probe_fast_1chan...
not applicable
I: testing cmd_read_fast_1chan...
not applicable
I: testing cmd_write_fast_1chan...
not applicable
I: testing cmd_logic_bug...
not applicable
I: testing cmd_fifo_depth_check...
not applicable
I: testing cmd_start_inttrig...
not applicable
I: testing mmap...
not applicable
I: testing read_select...
not applicable
I: testing bufconfig...
buffer length is 0, good
I:
I: subdevice 4
I: testing info...
rev 1
I: subdevice type: 0 (unused)
I: testing insn_read...
rev 1
comedi_do_insn: EIO, good
I: testing insn_read_0...
not applicable
I: testing insn_read_time...
rev 1
not applicable
I: testing cmd_no_cmd...
got EIO, good
I: testing cmd_probe_src_mask...
not applicable
I: testing cmd_probe_fast_1chan...
not applicable
I: testing cmd_read_fast_1chan...
not applicable
I: testing cmd_write_fast_1chan...
not applicable
I: testing cmd_logic_bug...
not applicable
I: testing cmd_fifo_depth_check...
not applicable
I: testing cmd_start_inttrig...
not applicable
I: testing mmap...
not applicable
I: testing read_select...
not applicable
I: testing bufconfig...
buffer length is 0, good
I:
I: subdevice 5
I: testing info...
rev 1
I: subdevice type: 9 (calibration)
 number of channels: 1
 max data value: 0
 ranges:
   all chans: [0,1]
I: testing insn_read...
rev 1
E: comedi_do_insn: Invalid argument
I: testing insn_read_0...
E: comedi_do_insn: Invalid argument
I: testing insn_read_time...
rev 1
comedi_do_insn: -1
W: comedi_do_insn: errno=22 Invalid argument
W: comedi_do_insn: returned -1 (expected 3)
read time: -1612798425915191 us
I: testing cmd_no_cmd...
got EIO, good
I: testing cmd_probe_src_mask...
not applicable
I: testing cmd_probe_fast_1chan...
not applicable
I: testing cmd_read_fast_1chan...
not applicable
I: testing cmd_write_fast_1chan...
not applicable
I: testing cmd_logic_bug...
not applicable
I: testing cmd_fifo_depth_check...
not applicable
I: testing cmd_start_inttrig...
not applicable
I: testing mmap...
not applicable
I: testing read_select...
not applicable
I: testing bufconfig...
buffer length is 0, good
I:
I: subdevice 6
I: testing info...
rev 1
I: subdevice type: 8 (memory)
 number of channels: 1024
 max data value: 255
 ranges:
   all chans: [0,1]
I: testing insn_read...
rev 1
comedi_do_insn returned 1, good
I: testing insn_read_0...
comedi_do_insn returned 0, good
I: testing insn_read_time...
rev 1
comedi_do_insn: 3
read time: 0 us
I: testing cmd_no_cmd...
got EIO, good
I: testing cmd_probe_src_mask...
not applicable
I: testing cmd_probe_fast_1chan...
not applicable
I: testing cmd_read_fast_1chan...
not applicable
I: testing cmd_write_fast_1chan...
not applicable
I: testing cmd_logic_bug...
not applicable
I: testing cmd_fifo_depth_check...
not applicable
I: testing cmd_start_inttrig...
not applicable
I: testing mmap...
not applicable
I: testing read_select...
not applicable
I: testing bufconfig...
buffer length is 0, good
I:
I: subdevice 7
I: testing info...
rev 1
I: subdevice type: 5 (digital I/O)
 number of channels: 16
 max data value: 1
 ranges:
   all chans: [0,1]
I: testing insn_read...
rev 1
comedi_do_insn returned 1, good
I: testing insn_read_0...
comedi_do_insn returned 0, good
I: testing insn_read_time...
rev 1
comedi_do_insn: 3
read time: 1 us
I: testing cmd_no_cmd...
got EIO, good
I: testing cmd_probe_src_mask...
not applicable
I: testing cmd_probe_fast_1chan...
not applicable
I: testing cmd_read_fast_1chan...
not applicable
I: testing cmd_write_fast_1chan...
not applicable
I: testing cmd_logic_bug...
not applicable
I: testing cmd_fifo_depth_check...
not applicable
I: testing cmd_start_inttrig...
not applicable
I: testing mmap...
not applicable
I: testing read_select...
not applicable
I: testing bufconfig...
buffer length is 0, good
I:
I: subdevice 8
I: testing info...
rev 1
I: subdevice type: 0 (unused)
I: testing insn_read...
rev 1
comedi_do_insn: EIO, good
I: testing insn_read_0...
not applicable
I: testing insn_read_time...
rev 1
not applicable
I: testing cmd_no_cmd...
got EIO, good
I: testing cmd_probe_src_mask...
not applicable
I: testing cmd_probe_fast_1chan...
not applicable
I: testing cmd_read_fast_1chan...
not applicable
I: testing cmd_write_fast_1chan...
not applicable
I: testing cmd_logic_bug...
not applicable
I: testing cmd_fifo_depth_check...
not applicable
I: testing cmd_start_inttrig...
not applicable
I: testing mmap...
not applicable
I: testing read_select...
not applicable
I: testing bufconfig...
buffer length is 0, good
I:
I: subdevice 9
I: testing info...
rev 1
I: subdevice type: 11 (serial)
 number of channels: 1
 max data value: 255
 ranges:
   all chans: [0,1]
I: testing insn_read...
rev 1
E: comedi_do_insn: Invalid argument
I: testing insn_read_0...
E: comedi_do_insn: Invalid argument
I: testing insn_read_time...
rev 1
comedi_do_insn: -1
W: comedi_do_insn: errno=22 Invalid argument
W: comedi_do_insn: returned -1 (expected 3)
read time: -1612798425915862 us
I: testing cmd_no_cmd...
got EIO, good
I: testing cmd_probe_src_mask...
not applicable
I: testing cmd_probe_fast_1chan...
not applicable
I: testing cmd_read_fast_1chan...
not applicable
I: testing cmd_write_fast_1chan...
not applicable
I: testing cmd_logic_bug...
not applicable
I: testing cmd_fifo_depth_check...
not applicable
I: testing cmd_start_inttrig...
not applicable
I: testing mmap...
not applicable
I: testing read_select...
not applicable
I: testing bufconfig...
buffer length is 0, good
I:
I: subdevice 10
I: testing info...
rev 1
I: subdevice type: 5 (digital I/O)
 number of channels: 8
 max data value: 1
 ranges:
   all chans: [0,1]
I: testing insn_read...
rev 1
comedi_do_insn returned 1, good
I: testing insn_read_0...
comedi_do_insn returned 0, good
I: testing insn_read_time...
rev 1
comedi_do_insn: 3
read time: 0 us
I: testing cmd_no_cmd...
got EIO, good
I: testing cmd_probe_src_mask...
not applicable
I: testing cmd_probe_fast_1chan...
not applicable
I: testing cmd_read_fast_1chan...
not applicable
I: testing cmd_write_fast_1chan...
not applicable
I: testing cmd_logic_bug...
not applicable
I: testing cmd_fifo_depth_check...
not applicable
I: testing cmd_start_inttrig...
not applicable
I: testing mmap...
not applicable
I: testing read_select...
not applicable
I: testing bufconfig...
buffer length is 0, good
I:
I: subdevice 11
I: testing info...
rev 1
I: subdevice type: 6 (counter)
 number of channels: 3
 max data value: -1
 ranges:
   all chans: [0,1]
I: testing insn_read...
rev 1
comedi_do_insn returned 1, good
I: testing insn_read_0...
comedi_do_insn returned 0, good
I: testing insn_read_time...
rev 1
comedi_do_insn: 3
read time: 4 us
I: testing cmd_no_cmd...
not applicable
I: testing cmd_probe_src_mask...
rev 1
command source mask:
 start: now|ext|int
 scan_begin: follow|ext
 convert: now|ext
 scan_end: count
 stop: none
I: testing cmd_probe_fast_1chan...
command fast 1chan:
 not supported
I: testing cmd_read_fast_1chan...
 not supported
I: testing cmd_write_fast_1chan...
not applicable
I: testing cmd_logic_bug...
rev 1
command_test returned 1, good
I: testing cmd_fifo_depth_check...
 not supported
64, 0
 not supported
128, 0
 not supported
256, 0
 not supported
512, 0
 not supported
1024, 0
 not supported
2048, 0
 not supported
4096, 0
 not supported
8192, 0
 not supported
16384, 0
 not supported
32768, 0
I: testing cmd_start_inttrig...
 not supported
I: testing mmap...
E: comedi_get_cmd_generic_timed failed
I: testing read_select...
E: comedi_get_cmd_generic_timed failed
I: testing bufconfig...
buffer size 0
max buffer size 20971520
setting buffer size to 4096
buffer size set to 4096
buffer size now at 4096
setting buffer size past limit, 20975616
got EPERM, good
setting buffer size to max, 20971520
E: comedi_set_buffer_size: Cannot allocate memory
I:
I: subdevice 12
I: testing info...
rev 1
I: subdevice type: 6 (counter)
 number of channels: 3
 max data value: -1
 ranges:
   all chans: [0,1]
I: testing insn_read...
rev 1
comedi_do_insn returned 1, good
I: testing insn_read_0...
comedi_do_insn returned 0, good
I: testing insn_read_time...
rev 1
comedi_do_insn: 3
read time: 3 us
I: testing cmd_no_cmd...
not applicable
I: testing cmd_probe_src_mask...
rev 1
command source mask:
 start: now|ext|int
 scan_begin: follow|ext
 convert: now|ext
 scan_end: count
 stop: none
I: testing cmd_probe_fast_1chan...
command fast 1chan:
 not supported
I: testing cmd_read_fast_1chan...
 not supported
I: testing cmd_write_fast_1chan...
not applicable
I: testing cmd_logic_bug...
rev 1
command_test returned 1, good
I: testing cmd_fifo_depth_check...
 not supported
64, 0
 not supported
128, 0
 not supported
256, 0
 not supported
512, 0
 not supported
1024, 0
 not supported
2048, 0
 not supported
4096, 0
 not supported
8192, 0
 not supported
16384, 0
 not supported
32768, 0
I: testing cmd_start_inttrig...
 not supported
I: testing mmap...
E: comedi_get_cmd_generic_timed failed
I: testing read_select...
E: comedi_get_cmd_generic_timed failed
I: testing bufconfig...
buffer size 0
max buffer size 20971520
setting buffer size to 4096
buffer size set to 4096
buffer size now at 4096
setting buffer size past limit, 20975616
got EPERM, good
setting buffer size to max, 20971520
E: comedi_set_buffer_size: Cannot allocate memory
I:
I: subdevice 13
I: testing info...
rev 1
I: subdevice type: 6 (counter)
 number of channels: 1
 max data value: 15
 ranges:
   all chans: [0,1]
I: testing insn_read...
rev 1
comedi_do_insn returned 1, good
I: testing insn_read_0...
comedi_do_insn returned 0, good
I: testing insn_read_time...
rev 1
comedi_do_insn: 3
read time: 0 us
I: testing cmd_no_cmd...
got EIO, good
I: testing cmd_probe_src_mask...
not applicable
I: testing cmd_probe_fast_1chan...
not applicable
I: testing cmd_read_fast_1chan...
not applicable
I: testing cmd_write_fast_1chan...
not applicable
I: testing cmd_logic_bug...
not applicable
I: testing cmd_fifo_depth_check...
not applicable
I: testing cmd_start_inttrig...
not applicable
I: testing mmap...
not applicable
I: testing read_select...
not applicable
I: testing bufconfig...
buffer length is 0, good



dmesg | grep comedi:

[   22.516611] comedi: module is from the staging directory, the quality is unknown, you have been warned.
[   22.516672] comedi: module verification failed: signature and/or required key missing - tainting kernel
[   22.517544] comedi: version 0.7.76 - http://www.comedi.org
[   22.591294] comedi_8255: module is from the staging directory, the quality is unknown, you have been warned.
[   22.727474] comedi_pci: module is from the staging directory, the quality is unknown, you have been warned.
[   23.085128] comedi comedi0: driver 'ni_pcimio' has successfully auto-configured 'pci-6220'.
[  234.716860] Modules linked in: rpcsec_gss_krb5 nfsv4 nfs fscache snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio intel_powerclamp snd_hda_intel snd_intel_dspcfg snd_hda_codec uvcvideo pl2303 videob
uf2_vmalloc snd_usb_audio snd_hda_core snd_usbmidi_lib videobuf2_memops usbserial snd_hwdep coretemp videobuf2_v4l2 videobuf2_common snd_pcm videodev mc snd_seq_midi snd_seq_midi_event snd_rawmidi gpio_ich snd_
seq input_leds snd_seq_device ni_pcimio(CE) snd_timer kvm_intel serio_raw ni_tiocmd(CE) snd kvm soundcore mite(CE) intel_cstate comedi_pci(CE) ni_routing(CE) ni_tio(CE) comedi_8255(CE) comedi(CE) i7core_edac i5
500_temp lpc_ich mac_hid sch_fq_codel nfsd auth_rpcgss nfs_acl parport_pc lockd ppdev grace sunrpc lp parport ip_tables x_tables autofs4 nouveau video i2c_algo_bit ttm drm_kms_helper syscopyarea sysfillrect hid
_generic mxm_wmi ahci sysimgblt firewire_ohci fb_sys_fops psmouse usbhid pata_via libahci pata_acpi r8169 firewire_core drm hid realtek crc_itu_t wmi
[  234.716913] CPU: 1 PID: 1609 Comm: comedi_test Tainted: G         CI E     5.4.0-65-generic #73~18.04.1-Ubuntu
[  234.716957]  comedi_buf_alloc+0x1e6/0x370 [comedi]
[  234.716962]  resize_async_buffer+0xb8/0x120 [comedi]
[  234.716966]  comedi_unlocked_ioctl+0xf62/0x1490 [comedi]
[  939.491184] comedi comedi0: mite: DMA overwrite of free area
[  939.518387] comedi comedi0: mite: DMA overwrite of free area
[  939.527357] comedi comedi0: mite: DMA overwrite of free area
[  939.536292] comedi comedi0: mite: DMA overwrite of free area
[  939.545231] comedi comedi0: mite: DMA overwrite of free area
[  939.554756] comedi comedi0: mite: DMA overwrite of free area
[  939.563702] comedi comedi0: mite: DMA overwrite of free area


Reply all
Reply to author
Forward
0 new messages