Experimenting with Analogy. Bugs found?
Hello. I'm testing Analogy on my x86 system with a NI 6251 ADC board (I can test with other NI ADCs if it useful to someone).
The lack of overview documentation is making my progress slow, but I have a couple of acquisition routines working quite well.
So far I have discovered that the TRI_WAKE_EOS flags works quite ok on my hardware, despite being indicates as unsupported in the documentation. Messing with the drivers I also discovered that a4l_mmap() is also working. There is just a bug to iron out (I can provide more details on my hacking if someone is interested in helping my track down the issue).
At the moment I'm facing two problems:
1. I setup an asynchronous acquisition. I then use a loop to a4l_sys_read() the acquired data. When the acquisition command is over, as configured with the .stop_src and .stop_arg in the command data structure, the a4l_sys_read() returns an ENOENT error. The comedi way of signaling the acquisition command end is to return 0, as is done for files to signal the end of file. I think this is an API deficiency but I haven't looked at how much work is to fix it.
2. Looks like it is not possible to setup an endless acquisition. If I set .stop_src = TRIG_NONE and .stop_arg = 0, the command submission goes fine, but I obtain an ENOENT error at the first a4l_sys_read(). I have no idea on where to look to track down this issue.
Thanks. Cheers,
Signature · 1 line
Daniele
Hello,
Quoted 7 lines
1. I setup an asynchronous acquisition. I then use a loop to
a4l_sys_read()the acquired data. When the acquisition command is over, as configured with the .stop_src and .stop_arg in the command data structure, thea4l_sys_read()returns an ENOENT error. The comedi way of signaling the acquisition command end is to return 0, as is done for files to signal the end of file. I think this is an API deficiency but I haven't looked at how much work is to fix it.
Looks like this has already been solved in the Alex's git tree. Thanks Simon for the suggestion of looking there for fixes.
Quoted 4 lines
2. Looks like it is not possible to setup an endless acquisition. If I set .stop_src =
TRIG_NONEand .stop_arg = 0, the command submission goes fine, but I obtain an ENOENT error at the firsta4l_sys_read(). I have no idea on where to look to track down this issue.
This is still a problem.
Thanks. Cheers,
Signature · 1 line
Daniele
Quoted 4 lines · Daniele Nicolodi
Quoted 4 lines
2. Looks like it is not possible to setup an endless acquisition. If I set .stop_src =
TRIG_NONEand .stop_arg = 0, the command submission goes fine, but I obtain an ENOENT error at the firsta4l_sys_read(). I have no idea on where to look to track down this issue.
The attached patch (against Alex git three) fixes the problem, in the case of analog input. I haven't test the same condition for analog output.
Cheers,
Signature · 1 line
Daniele
include/analogy/buffer.h +10 -4
@@ -253,7 +253,8 @@ static inline int __abs_put(a4l_buf_t * buf, unsigned long count)if ((old / buf->size) != (count / buf->size))set_bit (A4L_BUF_EOBUF_NR , &buf->evt_flags); -if (count >= buf->end_count) +/* In the case of continuos acquisition end_count is zero */ +if ((buf->end_count !=0 ) && (count >= buf->end_count))set_bit (A4L_BUF_EOA_NR , &buf->evt_flags);return 0 ;
@@ -303,10 +304,15 @@ static inline unsigned long __count_to_get(a4l_buf_t * buf) {unsigned long ret; -if (buf->end_count !=0 && (buf->end_count > buf->prd_count)) +/* In the case of continuos acquisition end_count is zero */ +if (buf->end_count !=0 ) { +if (buf->end_count > buf->prd_count) + ret = buf->prd_count; +else + ret = buf->end_count; + }else { ret = buf->prd_count; -else - ret = buf->end_count; + }if (ret > buf->cns_count) ret -= buf->cns_count;
Hi,
Quoted 9 lines · Daniele Nicolodi
Quoted 4 lines · Daniele Nicolodi
Quoted 4 lines
2. Looks like it is not possible to setup an endless acquisition. If I set .stop_src =
TRIG_NONEand .stop_arg = 0, the command submission goes fine, but I obtain an ENOENT error at the firsta4l_sys_read(). I have no idea on where to look to track down this issue.The attached patch (against Alex git three) fixes the problem, in the case of analog input. I haven't test the same condition for analog output.
Sorry, I answered your former mail instead of this one. I will integrate your patch soon. I will check analog output.
Many thanks for digging into this.
Quoted 9 lines
Cheers,
------------------------------------------------------------------------
_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Alexis.
Hi,
Quoted 5 lines · Daniele Nicolodi
Hello. I'm testing Analogy on my x86 system with a NI 6251 ADC board (I can test with other NI ADCs if it useful to someone).
The lack of overview documentation is making my progress slow, but I have a couple of acquisition routines working quite well.
Which documentation are talking about ? For me the docs are:
- the Doxygen doc (Xenomai API -> modules -> Analogy API):
http://www.xenomai.org/documentation/xenomai-2.5/html/api/index.html
- the wiki pages in the section "Device Drivers':
http://www.xenomai.org/index.php/Driver_documentation
Are you talking about these ones. Where did you see TRI_WAKE_EOS was not supported ?
Quoted 10 lines
So far I have discovered that the
TRI_WAKE_EOSflags works quite ok on my hardware, despite being indicates as unsupported in the documentation. Messing with the drivers I also discovered thata4l_mmap()is also working. There is just a bug to iron out (I can provide more details on my hacking if someone is interested in helping my track down the issue).At the moment I'm facing two problems:
Quoted 7 lines
1. I setup an asynchronous acquisition. I then use a loop to
a4l_sys_read()the acquired data. When the acquisition command is over, as configured with the .stop_src and .stop_arg in the command data structure, thea4l_sys_read()returns an ENOENT error. The comedi way of signaling the acquisition command end is to return 0, as is done for files to signal the end of file. I think this is an API deficiency but I haven't looked at how much work is to fix it.
I thought I fixed this bug a few weeks ago. I have to make a pull request.
Author: Alexis Berlemont <[email protected]> 2010-02-06 23:00:54
Committer: Alexis Berlemont <[email protected]> 2010-02-06 23:55:11
Parent: 1e4f9f3524bfc8ad84f92dfba5cbfc7f07652e7f (analogy: add a4l_flush_sync())
Child: 527ed184265ba494c080af940b099bb537c0e9fe (analogy: reinitialize events flags before accepting commands)
Branches: analogy, master, remotes/origin/analogy, remotes/xenomai-head/master
Follows: v2.5.1
Precedes:
analogy: read() and poll() return no more -ENOENT when acquisition
is over
Quoted 5 lines
2. Looks like it is not possible to setup an endless acquisition. If I set .stop_src =
TRIG_NONEand .stop_arg = 0, the command submission goes fine, but I obtain an ENOENT error at the firsta4l_sys_read(). I have no idea on where to look to track down this issue.
I will have a look at that soon.
Quoted 2 lines
Thanks. Cheers,
Alexis.
Quoted 9 lines · Alexis Berlemont
Hi,
Quoted 5 lines · Daniele Nicolodi
Hello. I'm testing Analogy on my x86 system with a NI 6251 ADC board (I can test with other NI ADCs if it useful to someone).
The lack of overview documentation is making my progress slow, but I have a couple of acquisition routines working quite well.
Quoted 8 lines
Which documentation are talking about ? For me the docs are:
- the Doxygen doc (Xenomai API -> modules -> Analogy API):
http://www.xenomai.org/documentation/xenomai-2.5/html/api/index.html
- the wiki pages in the section "Device Drivers':
http://www.xenomai.org/index.php/Driver_documentationAre you talking about these ones. Where did you see
TRI_WAKE_EOSwas not supported ?
Hi, I'm refering exactly to this documentation. When I say that overview documentation is missing I'm referring to the fact that there isn't a document that describes which are the steps you need to perform to set up an acquisition, and why you need to do so. I think that the most under documented API section is the one about getting devices, subdevices and channels properties and capabilities. I can try to find some spare time to help on this.
About the TRIG_WAKE_EOS, I'm referring to this page:
http://www.xenomai.org/documentation/xenomai-2.5/html/api/group__async1__lib.html
It says:
#define TRIG_WAKE_EOS 0x0020
Trigger not implemented yet.
And there are no other mentions of it in the documentation.
Cheers,
Signature · 1 line
Daniele
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 26 lines · Daniele Nicolodi
Quoted 8 lines · Alexis Berlemont
Hi,
Quoted 5 lines · Daniele Nicolodi
Hello. I'm testing Analogy on my x86 system with a NI 6251 ADC board (I can test with other NI ADCs if it useful to someone).
The lack of overview documentation is making my progress slow, but I have a couple of acquisition routines working quite well.
Quoted 7 lines
Which documentation are talking about ? For me the docs are:
- the Doxygen doc (Xenomai API -> modules -> Analogy API):
http://www.xenomai.org/documentation/xenomai-2.5/html/api/index.html
- the wiki pages in the section "Device Drivers':
http://www.xenomai.org/index.php/Driver_documentationAre you talking about these ones. Where did you see
TRI_WAKE_EOSwas not supported ?Hi, I'm refering exactly to this documentation. When I say that overview documentation is missing I'm referring to the fact that there isn't a document that describes which are the steps you need to perform to set up an acquisition, and why you need to do so. I think that the most under documented API section is the one about getting devices, subdevices and channels properties and capabilities. I can try to find some spare time to help on this.
Quoted 9 lines
About the
TRIG_WAKE_EOS, I'm referring to this page:http://www.xenomai.org/documentation/xenomai-2.5/html/api/group__async1__lib.html
It says:
#define
TRIG_WAKE_EOS0x0020
Trigger not implemented yet.
OK I fixed the documentation.
Quoted 3 lines
And there are no other mentions of it in the documentation.
Cheers,
Alexis.
Quoted 10 lines · Alexis Berlemont
Quoted 9 lines
About the
TRIG_WAKE_EOS, I'm referring to this page:http://www.xenomai.org/documentation/xenomai-2.5/html/api/group__async1__lib.html
It says:
#define
TRIG_WAKE_EOS0x0020
Trigger not implemented yet.OK I fixed the documentation.
Thank you!
Signature · 1 line
Daniele