On 20/12/2019 08:00, Dmytro Fil wrote:
> Hello!
> I have analogue input card Advantech PCI-1713. I read analog data using
> function /comedi_data_read()./
> The data from channels 0-15 is correctly read, but the signals of
> channels 16-31 duplicate the values of channels 0-15. For example when I
> send a signal from the calibrator to channel 0, then I see the same
> signals on channel 0 and 15. When I send a signal from calibrator to
> channel 15, then I don't see any changes. Same story with another pair
> of signals.
>
> How to read all data from my card?
>
> OS: Ubuntu 18.04.3 LTS
> Kernel: 5.0.0-37-generic
> Comedi version 0.7.76
> Card info:
>
> /overall info:
> version code: 0x00074c
> driver name: adv_pci1710
> board name: pci1713
> number of subdevices: 1
> subdevice 0:
> type: 1 (analog input)
> flags: 0x00519000
> SDF_CMD_READ:can do asynchronous input commands
> SDF_READABLE:subdevice can be read
> SDF_GROUND:can do aref=ground
> SDF_DIFF:aref=diff
> number of channels: 32
> max data value: 4095/
Hi,
I've tracked this down to a small bug in the driver introduced in kernel
version 4.5. The channel number is being AND'ed with a bit-mask of 0xf,
causing channels 16-31 to be treated as aliases of channels 0-15.
I've sent a patch to the Linux "staging" development list (and Cc'ed a
copy to you), and marked it for inclusion in older "stable" kernels.
Hopefully, the Ubuntu kernel team will apply the patch to their stable
kernels eventually, but this may take a few weeks.
--
-=( Ian Abbott <
abb...@mev.co.uk> || Web:
www.mev.co.uk )=-
-=( MEV Ltd. is a company registered in England & Wales. )=-
-=( Registered number: 02862268. Registered address: )=-
-=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-