Yes, my code derives from generic-buffer, at least in part, as I first had to
fix problems in generic-buffer, and then get problems fixed in the sensor hub
drivers. For quite some time the only way to get the code to work at all was
to do everything each time, so I just kept doing it that way.
There appears to be lots of improvements in the drivers so a better solution
is certainly possible now.
peter
On 07/09/2014 03:16 PM, Bastien Nocera wrote:
Hey Peter,
On Wed, 2014-07-09 at 16:54 +0200, Peter Meerwald wrote:
Hello Bastian,
We did also have a uinput based approach at one point but it was fairly clunky.
That took data from iio buffers and pushed it back into the kernel via inputs
userspace driver support. Not particularly nice but I thought I'd best mention
it!
This is how I went in the end:
https://github.com/hadess/iio-sensor-proxy/
It's still far too resource hungry compared to the amount of work it's
doing (1 full percent of CPU!), and the rotation is too sensitive.
if I read the code correctly, prepare_output() configures the trigger,
enables the buffer, then performs one read, before undoing everything FOR
EACH SAMPLE
I based that code off Peter F. Patel-Schneider, and his yoga utilities,
and he probably got the idea from the generic_buffer.c example. It's not
clear what needs to be done there.
this is probably not the way it should be done; I'd suggest to set up the
IIO buffer and then poll() or block on /dev/iio:deviceX -- however, this
uses the IIO device exclusively (might be an issue)
I've now pushed a version that will do the setup once, and open/close
the iio device when needed, in the timeout.
The daemon still shows up in top, but I couldn't make it register
enough activity to show up in sysprof, so I'm guessing that top just
isn't measuring the CPU usage accurately.
I still have to fix the overeagerness to switch orientations, and I'll
be done for now I think.
Cheers
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html