Hang in AnalogInputPort.read() on BBB

21 views
Skip to first unread message

Richard Sewell

unread,
Mar 20, 2015, 1:16:19 PM3/20/15
to libbu...@googlegroups.com
I've got what seems to be a hang in AnalogInputPort.read() on a BBB after a few hours of runtime.

I'm reading from several threads, but with a synchronized( synchronizer )  round each read to prevent contention. 

I'm just looking for ideas, really. Could this be a problem inside read() somehow ? Is there any way it can hang up ?

Thanks,

Richard

Richard Sewell

unread,
Mar 20, 2015, 2:24:48 PM3/20/15
to libbu...@googlegroups.com
The stack at the point of the hang is:
NativeAdc.fetchSamples()
BBAnalogInput.sample()
BBBAnalogInput.read()

Richard Sewell

unread,
Mar 22, 2015, 2:52:12 AM3/22/15
to libbu...@googlegroups.com
By way of an update, I reworked the code that used these inputs to poll all the ADCs from a single thread on a deterministic schedule, on the presumption that the underlying problem was some kind of low-level timing malarkey to do with two reads being too close together.

That has either fixed it or made the interval between lockups much longer.

I'd still be interested to know how NativeAdc.fetchSamples() can hang up, but it's not an immediate problem.

R.

Datenheld

unread,
Mar 22, 2015, 7:21:02 AM3/22/15
to libbu...@googlegroups.com
Hi Richard,

sorry for the late reply. The ADC is driven by native code of the BBBIO library. It has various problems and my expertise is not high enough and I haven't invested the time yet to debug its problems. Particulary with higher sampling rates there can be problems. That said, yes I do think that it can hang.

If all you need is a slow read every now and then, you can try to use LinuxDigitalInput, which is just a sysfs wrapper.

HTH

Datenheld

unread,
Mar 22, 2015, 7:26:48 AM3/22/15
to libbu...@googlegroups.com
Sorry, need to correct this. LinuxDigitalInput won't help much I guess and there's yet no wrapper for an AnalogInput.
Reply all
Reply to author
Forward
0 new messages