All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Experimenting with Analogy. Bugs found?
@ 2010-03-11 15:40 Daniele Nicolodi
  2010-03-12  0:07 ` [Xenomai-core] " Daniele Nicolodi
  2010-03-13  0:42 ` Alexis Berlemont
  0 siblings, 2 replies; 8+ messages in thread
From: Daniele Nicolodi @ 2010-03-11 15:40 UTC (permalink / raw)
  To: xenomai

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,
-- 
Daniele


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Xenomai-core] [Xenomai-help] Experimenting with Analogy. Bugs found?
  2010-03-11 15:40 [Xenomai-help] Experimenting with Analogy. Bugs found? Daniele Nicolodi
@ 2010-03-12  0:07 ` Daniele Nicolodi
  2010-03-12 16:05   ` Daniele Nicolodi
  2010-03-13  0:42 ` Alexis Berlemont
  1 sibling, 1 reply; 8+ messages in thread
From: Daniele Nicolodi @ 2010-03-12  0:07 UTC (permalink / raw)
  To: xenomai

Hello,

> 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.

Looks like this has already been solved in the Alex's git tree. Thanks
Simon for the suggestion of looking there for fixes.

> 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.

This is still a problem.

Thanks. Cheers,
-- 
Daniele



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Xenomai-core] [Xenomai-help] Experimenting with Analogy. Bugs found?
  2010-03-12  0:07 ` [Xenomai-core] " Daniele Nicolodi
@ 2010-03-12 16:05   ` Daniele Nicolodi
  2010-03-13  0:46     ` Alexis Berlemont
  0 siblings, 1 reply; 8+ messages in thread
From: Daniele Nicolodi @ 2010-03-12 16:05 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 470 bytes --]

Daniele Nicolodi wrote:
>> 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.

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,
-- 
Daniele


[-- Attachment #2: analogy01.patch --]
[-- Type: text/x-diff, Size: 1043 bytes --]

diff --git a/include/analogy/buffer.h b/include/analogy/buffer.h
index 0e8f279..e7b2416 100644
--- a/include/analogy/buffer.h
+++ b/include/analogy/buffer.h
@@ -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;

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Xenomai-help] Experimenting with Analogy. Bugs found?
  2010-03-11 15:40 [Xenomai-help] Experimenting with Analogy. Bugs found? Daniele Nicolodi
  2010-03-12  0:07 ` [Xenomai-core] " Daniele Nicolodi
@ 2010-03-13  0:42 ` Alexis Berlemont
  2010-03-15  8:49   ` Daniele Nicolodi
       [not found]   ` <4B9FF458.4050908@domain.hid>
  1 sibling, 2 replies; 8+ messages in thread
From: Alexis Berlemont @ 2010-03-13  0:42 UTC (permalink / raw)
  To: Daniele Nicolodi; +Cc: xenomai

Hi,

Daniele Nicolodi wrote:
> 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 ?

> 
> 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.
I thought I fixed this bug a few weeks ago. I have to make a pull request.

Author: Alexis Berlemont <alexis.berlemont@domain.hid>  2010-02-06 23:00:54
Committer: Alexis Berlemont <alexis.berlemont@domain.hid>  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


> 
> 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.
I will have a look at that soon.

> 
> Thanks. Cheers,

Alexis.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Xenomai-core] [Xenomai-help] Experimenting with Analogy. Bugs found?
  2010-03-12 16:05   ` Daniele Nicolodi
@ 2010-03-13  0:46     ` Alexis Berlemont
  0 siblings, 0 replies; 8+ messages in thread
From: Alexis Berlemont @ 2010-03-13  0:46 UTC (permalink / raw)
  To: Daniele Nicolodi; +Cc: xenomai, xenomai

Hi,

Daniele Nicolodi wrote:
> Daniele Nicolodi wrote:
>>> 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.
> 
> 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.

> Cheers,
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core

Alexis.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Xenomai-help] Experimenting with Analogy. Bugs found?
  2010-03-13  0:42 ` Alexis Berlemont
@ 2010-03-15  8:49   ` Daniele Nicolodi
       [not found]   ` <4B9FF458.4050908@domain.hid>
  1 sibling, 0 replies; 8+ messages in thread
From: Daniele Nicolodi @ 2010-03-15  8:49 UTC (permalink / raw)
  To: Alexis Berlemont; +Cc: xenomai

Alexis Berlemont wrote:
> Hi,
> 
> Daniele Nicolodi wrote:
>> 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 ?


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,
-- 
Daniele



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Xenomai-help] Experimenting with Analogy. Bugs found?
       [not found]   ` <4B9FF458.4050908@domain.hid>
@ 2010-03-18 23:32     ` Alexis Berlemont
  2010-03-18 23:37       ` Daniele Nicolodi
  0 siblings, 1 reply; 8+ messages in thread
From: Alexis Berlemont @ 2010-03-18 23:32 UTC (permalink / raw)
  To: Daniele Nicolodi, xenomai@xenomai.org

Daniele Nicolodi wrote:
> Alexis Berlemont wrote:
>> Hi,
>>
>> Daniele Nicolodi wrote:
>>> 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 ?
> 
> 
> 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.
> 
OK I fixed the documentation.
> And there are no other mentions of it in the documentation.
> 
> Cheers,

Alexis.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Xenomai-help] Experimenting with Analogy. Bugs found?
  2010-03-18 23:32     ` Alexis Berlemont
@ 2010-03-18 23:37       ` Daniele Nicolodi
  0 siblings, 0 replies; 8+ messages in thread
From: Daniele Nicolodi @ 2010-03-18 23:37 UTC (permalink / raw)
  To: Alexis Berlemont; +Cc: xenomai@xenomai.org

Alexis Berlemont wrote:
>> 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.
>>
> OK I fixed the documentation.

Thank you!

-- 
Daniele



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-03-18 23:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-11 15:40 [Xenomai-help] Experimenting with Analogy. Bugs found? Daniele Nicolodi
2010-03-12  0:07 ` [Xenomai-core] " Daniele Nicolodi
2010-03-12 16:05   ` Daniele Nicolodi
2010-03-13  0:46     ` Alexis Berlemont
2010-03-13  0:42 ` Alexis Berlemont
2010-03-15  8:49   ` Daniele Nicolodi
     [not found]   ` <4B9FF458.4050908@domain.hid>
2010-03-18 23:32     ` Alexis Berlemont
2010-03-18 23:37       ` Daniele Nicolodi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.