* [Xenomai-core] Analogy DIO speed @ 2010-02-17 21:23 Stefan Schaal 2010-02-18 22:34 ` Alexis Berlemont 0 siblings, 1 reply; 10+ messages in thread From: Stefan Schaal @ 2010-02-17 21:23 UTC (permalink / raw) To: xenomai; +Cc: Peter Pastor Sampedro Thanks to Alexis's Analogy development, digital I/O is possible with Xenomai using National Instrument DAQs. While the basic DIO functionality works in the most current xenomai-head, I am wondering how to achieve maximal I/O speed with the 32 bit digital I/O sub-device on my NI6259 card. The options are 1) single acquisition with a4l_sync_dio() 2) instructions and instruction lists using a4l_snd_insnlist() and a4l_snd_insn() 3) streaming acquisition with commands (e.g., a4l_snd_command() and related functions) My question concerns how many 32-bit DIO instructions per second I should be able to achieve with the various options. For instance, option 1) seems to take about 5000 nanoseconds on my Ubuntu 8 core i386 computer (3Ghz processors). Is this normal? Or should it be faster? Option 2) seems to give me about 50% speed up, i.e., roughly 3500 nanoseconds per DIO. Would option 3) give me a massive speed up and get me closer to the 20Mhz processing power of the NI 6259 board? I have some problems with implementing commands on my NI6259 so far. Thanks a lot for any help! -Stefan ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] Analogy DIO speed 2010-02-17 21:23 [Xenomai-core] Analogy DIO speed Stefan Schaal @ 2010-02-18 22:34 ` Alexis Berlemont 2010-02-18 22:48 ` Thomas Lockhart 2010-02-19 5:43 ` Stefan Schaal 0 siblings, 2 replies; 10+ messages in thread From: Alexis Berlemont @ 2010-02-18 22:34 UTC (permalink / raw) To: Stefan Schaal; +Cc: Peter Pastor Sampedro, xenomai Hi, Stefan Schaal wrote: > Thanks to Alexis's Analogy development, digital I/O is possible with Xenomai using National Instrument DAQs. While the basic DIO functionality works in the most current xenomai-head, I am wondering how to achieve maximal I/O speed with the 32 bit digital I/O sub-device on my NI6259 card. > > The options are > > 1) single acquisition with a4l_sync_dio() > 2) instructions and instruction lists using a4l_snd_insnlist() and a4l_snd_insn() > 3) streaming acquisition with commands (e.g., a4l_snd_command() and related functions) > > My question concerns how many 32-bit DIO instructions per second I > should be able to achieve with the various options. > > For instance, option 1) seems to take about 5000 nanoseconds on my > Ubuntu 8 core i386 computer (3Ghz processors). > Is this normal? Or should it be faster? > > Option 2) seems to give me about 50% speed up, i.e., roughly 3500 > nanoseconds per DIO. With a4l_sync_dio and/or instructions, you perform one ioctl for each acquisition. With instruction lists, you perform less syscalls but the count of copies (user <-> kernel space) is the same. So 3.5 µs for: - switching from user to kernel space - copying a little structure from user space - calling the suitable insn_bits handler - performing PCI I/O - copying data back (few bytes) to user space - switching back to user space It is not that bad, no ? Does anybody have an accurate idea on the duration of a common ioctl on such a powerful machine ? Wasting 1.5 more µs in a4l_sync_dio() is annoying. You already have noticed that a4l_sync_dio() is a wrapper function which relies on the instruction ioctl. This function does not make any more ioctl, it just computes some pointers. > > Would option 3) give me a massive speed up and get me closer to the > 20Mhz processing power of the NI 6259 board? Yes. Instead of making one syscall per acquisition, you would get a far more sensible ratio. With a4l_mmap, you would even be able to save copies from kernel space: instead of using a4l_async_read, your user process would get direct access on the kernel buffer where PCI DMA shots arrive. I have some problems with > implementing commands on my NI6259 so far. Could you remind me what was the problem ? > > Thanks a lot for any help! > > -Stefan > > _______________________________________________ > Xenomai-core mailing list > Xenomai-core@domain.hid > https://mail.gna.org/listinfo/xenomai-core > Alexis. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] Analogy DIO speed 2010-02-18 22:34 ` Alexis Berlemont @ 2010-02-18 22:48 ` Thomas Lockhart 2010-02-19 5:43 ` Stefan Schaal 1 sibling, 0 replies; 10+ messages in thread From: Thomas Lockhart @ 2010-02-18 22:48 UTC (permalink / raw) To: Alexis Berlemont; +Cc: Peter Pastor Sampedro, xenomai@xenomai.org > It is not that bad, no ? Does anybody have an accurate idea on the > duration of a common ioctl on such a powerful machine ? Yikes! My limited and possibly out of date understanding of the PCI bus would say that you risk a much larger latency and jitter in just getting access to the bus. I'd be happy with anything in the 1us range (1-5?) which afaicr is what it takes to negotiate the bus and to write one or a few longwords to a device. This is without something already on the bus doing DMA or some other block transfer which could push up the latency much higher since a block transfer is not required to give up the bus for some larger amount of time (please excuse my possible mangled use of terms which may have other specific meaning in the PCI spec). If folks expect much better performance (perhaps from modern revs of PCI??) I'd like to hear of their experience... - Tom ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] Analogy DIO speed 2010-02-18 22:34 ` Alexis Berlemont 2010-02-18 22:48 ` Thomas Lockhart @ 2010-02-19 5:43 ` Stefan Schaal 2010-02-23 23:22 ` Alexis Berlemont 1 sibling, 1 reply; 10+ messages in thread From: Stefan Schaal @ 2010-02-19 5:43 UTC (permalink / raw) To: Alexis Berlemont; +Cc: Peter Pastor Sampedro, xenomai Hi Alexis, On Feb 18, 2010, at 14:34, Alexis Berlemont wrote: > I have some problems with >> implementing commands on my NI6259 so far. > Could you remind me what was the problem ? See the print-outs below for the problem we have. Thanks so much for looking into this! -Stefan Using the cmd_write() function that you provide in analogy, we get the following problem: root@domain.hid# ./cmd_write -v cmd_write: device analogy0 opened (fd=0) cmd_write: basic descriptor retrieved subdevices count = 14 read subdevice index = 0 write subdevice index = 1 cmd_write: complex descriptor retrieved cmd_write: channel 0 ranges count = 3 range's size = 16 (bits) cmd_write: channel 1 ranges count = 3 range's size = 16 (bits) cmd_write: scan size = 4 cmd_write: size to write = 400 cmd_write: command successfully sent cmd_write: triggering failed (ret=-32) root@domain.hid# dmesg -c [133345.213865] Analogy: analogy_ni_pcimio: ni_mio_common: interrupt: b_status=0002 m1_status=80a80000 [133345.332719] Analogy: analogy_ni_pcimio: ni_ao_wait_for_dma_load: timed out waiting for dma load<3>Analogy: a4l_do_special_insn: execution of the instruction failed (err=-32) Another problem we have is with the --mmap option: root@domain.hid# ./cmd_write -v --mmap cmd_write: device analogy0 opened (fd=0) cmd_write: basic descriptor retrieved subdevices count = 14 read subdevice index = 0 write subdevice index = 1 cmd_write: complex descriptor retrieved cmd_write: channel 0 ranges count = 3 range's size = 16 (bits) cmd_write: channel 1 ranges count = 3 range's size = 16 (bits) cmd_write: scan size = 4 cmd_write: size to write = 400 cmd_write: buffer size = 65536 bytes cmd_write: a4l_mmap() failed (ret=-22) root@domain.hid# dmesg -c [133408.942998] Analogy: a4l_ioctl_mmap: mmap not allowed on this subdevice ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] Analogy DIO speed 2010-02-19 5:43 ` Stefan Schaal @ 2010-02-23 23:22 ` Alexis Berlemont 2010-03-01 0:24 ` Alexis Berlemont 0 siblings, 1 reply; 10+ messages in thread From: Alexis Berlemont @ 2010-02-23 23:22 UTC (permalink / raw) To: Stefan Schaal; +Cc: Peter Pastor Sampedro, xenomai Hi, Stefan Schaal wrote: > Hi Alexis, > > On Feb 18, 2010, at 14:34, Alexis Berlemont wrote: > >> I have some problems with >>> implementing commands on my NI6259 so far. >> Could you remind me what was the problem ? > > See the print-outs below for the problem we have. > > Thanks so much for looking into this! > > -Stefan > > > > > Using the cmd_write() function that you provide in analogy, we get the following problem: > I am currently trying to fix this bug, which is not that easy. I just have one question (that I remember I have already asked you in some way, but I just want to be sure): Does this bug occur the very first time you launched cmd_write (I mean after a reboot) ? > root@domain.hid# ./cmd_write -v > cmd_write: device analogy0 opened (fd=0) > cmd_write: basic descriptor retrieved > subdevices count = 14 > read subdevice index = 0 > write subdevice index = 1 > cmd_write: complex descriptor retrieved > cmd_write: channel 0 > ranges count = 3 > range's size = 16 (bits) > cmd_write: channel 1 > ranges count = 3 > range's size = 16 (bits) > cmd_write: scan size = 4 > cmd_write: size to write = 400 > cmd_write: command successfully sent > cmd_write: triggering failed (ret=-32) > > root@domain.hid# dmesg -c > [133345.213865] Analogy: analogy_ni_pcimio: ni_mio_common: interrupt: b_status=0002 m1_status=80a80000 > [133345.332719] Analogy: analogy_ni_pcimio: ni_ao_wait_for_dma_load: timed out waiting for dma load<3>Analogy: a4l_do_special_insn: execution of the instruction failed (err=-32) > > > Another problem we have is with the --mmap option: > > root@domain.hid# ./cmd_write -v --mmap > cmd_write: device analogy0 opened (fd=0) > cmd_write: basic descriptor retrieved > subdevices count = 14 > read subdevice index = 0 > write subdevice index = 1 > cmd_write: complex descriptor retrieved > cmd_write: channel 0 > ranges count = 3 > range's size = 16 (bits) > cmd_write: channel 1 > ranges count = 3 > range's size = 16 (bits) > cmd_write: scan size = 4 > cmd_write: size to write = 400 > cmd_write: buffer size = 65536 bytes > cmd_write: a4l_mmap() failed (ret=-22) > > > root@domain.hid# dmesg -c > [133408.942998] Analogy: a4l_ioctl_mmap: mmap not allowed on this subdevice > > Alexis. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] Analogy DIO speed 2010-02-23 23:22 ` Alexis Berlemont @ 2010-03-01 0:24 ` Alexis Berlemont 2010-03-02 18:00 ` Stefan Schaal 0 siblings, 1 reply; 10+ messages in thread From: Alexis Berlemont @ 2010-03-01 0:24 UTC (permalink / raw) To: Stefan Schaal; +Cc: Peter Pastor Sampedro, xenomai Alexis Berlemont wrote: > Hi, > > Stefan Schaal wrote: >> Hi Alexis, >> >> On Feb 18, 2010, at 14:34, Alexis Berlemont wrote: >> >>> I have some problems with >>>> implementing commands on my NI6259 so far. >>> Could you remind me what was the problem ? >> >> See the print-outs below for the problem we have. >> >> Thanks so much for looking into this! >> >> -Stefan >> >> >> >> >> Using the cmd_write() function that you provide in analogy, we get the >> following problem: >> > I am currently trying to fix this bug, which is not that easy. I just > have one question (that I remember I have already asked you in some way, > but I just want to be sure): > Does this bug occur the very first time you launched cmd_write (I mean > after a reboot) ? > I managed at last to fix the bug you were facing (at least I hope so). The problem was located in the trigger callback which waited for a bit-status (fifo half full) before going further; however, sometimes the DMA interrupt already occurred and cleaned everything behind your back. I have not made a pull request because the current implementation is not perfect. If you have some time, could you clone my git repository (branch: analogy) and check that a simple call to cmd_write does not trigger the bug anymore ? Many thanks. >> root@domain.hid# ./cmd_write -v >> cmd_write: device analogy0 opened (fd=0) >> cmd_write: basic descriptor retrieved >> subdevices count = 14 >> read subdevice index = 0 >> write subdevice index = 1 >> cmd_write: complex descriptor retrieved >> cmd_write: channel 0 >> ranges count = 3 >> range's size = 16 (bits) >> cmd_write: channel 1 >> ranges count = 3 >> range's size = 16 (bits) >> cmd_write: scan size = 4 >> cmd_write: size to write = 400 >> cmd_write: command successfully sent >> cmd_write: triggering failed (ret=-32) >> >> root@domain.hid# dmesg -c >> [133345.213865] Analogy: analogy_ni_pcimio: ni_mio_common: interrupt: >> b_status=0002 m1_status=80a80000 >> [133345.332719] Analogy: analogy_ni_pcimio: ni_ao_wait_for_dma_load: >> timed out waiting for dma load<3>Analogy: a4l_do_special_insn: >> execution of the instruction failed (err=-32) >> >> >> Another problem we have is with the --mmap option: >> >> root@domain.hid# ./cmd_write -v --mmap >> cmd_write: device analogy0 opened (fd=0) >> cmd_write: basic descriptor retrieved >> subdevices count = 14 >> read subdevice index = 0 >> write subdevice index = 1 >> cmd_write: complex descriptor retrieved >> cmd_write: channel 0 >> ranges count = 3 >> range's size = 16 (bits) >> cmd_write: channel 1 >> ranges count = 3 >> range's size = 16 (bits) >> cmd_write: scan size = 4 >> cmd_write: size to write = 400 >> cmd_write: buffer size = 65536 bytes >> cmd_write: a4l_mmap() failed (ret=-22) >> >> >> root@domain.hid# dmesg -c >> [133408.942998] Analogy: a4l_ioctl_mmap: mmap not allowed on this >> subdevice >> >> > > Alexis. Alexis. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] Analogy DIO speed 2010-03-01 0:24 ` Alexis Berlemont @ 2010-03-02 18:00 ` Stefan Schaal 2010-03-03 23:58 ` Alexis Berlemont 0 siblings, 1 reply; 10+ messages in thread From: Stefan Schaal @ 2010-03-02 18:00 UTC (permalink / raw) To: Alexis Berlemont; +Cc: Peter Pastor Sampedro, xenomai Hi Alexis, we pulled your analogy branch, and now cmd_write works. Great, and thanks a lot! Next, I tried to use commands with the digital IO subdevice on our board (subdevice #2), but the get an error message: [ 2482.771913] Analogy: a4l_check_cmddesc: scan_begin_src, trigger unsupported Is there just missing support for the DIO subdevices using commands? Best wishes, -Stefan ps.: feel free to use our machine for debugging -- it now has the latest version of your software installed with linux kernel 2.6.29.5. On Feb 28, 2010, at 16:24, Alexis Berlemont wrote: > Alexis Berlemont wrote: >> Hi, >> Stefan Schaal wrote: >>> Hi Alexis, >>> >>> On Feb 18, 2010, at 14:34, Alexis Berlemont wrote: >>> >>>> I have some problems with >>>>> implementing commands on my NI6259 so far. >>>> Could you remind me what was the problem ? >>> >>> See the print-outs below for the problem we have. >>> >>> Thanks so much for looking into this! >>> >>> -Stefan >>> >>> >>> >>> >>> Using the cmd_write() function that you provide in analogy, we get the following problem: >>> >> I am currently trying to fix this bug, which is not that easy. I just >> have one question (that I remember I have already asked you in some way, >> but I just want to be sure): >> Does this bug occur the very first time you launched cmd_write (I mean >> after a reboot) ? >> > I managed at last to fix the bug you were facing (at least I hope so). > The problem was located in the trigger callback which waited for a > bit-status (fifo half full) before going further; however, sometimes the > DMA interrupt already occurred and cleaned everything behind your back. > > I have not made a pull request because the current implementation is not > perfect. > > If you have some time, could you clone my git repository (branch: > analogy) and check that a simple call to cmd_write does not trigger the > bug anymore ? > > Many thanks. >>> root@domain.hid# ./cmd_write -v >>> cmd_write: device analogy0 opened (fd=0) >>> cmd_write: basic descriptor retrieved >>> subdevices count = 14 >>> read subdevice index = 0 >>> write subdevice index = 1 >>> cmd_write: complex descriptor retrieved >>> cmd_write: channel 0 >>> ranges count = 3 >>> range's size = 16 (bits) >>> cmd_write: channel 1 >>> ranges count = 3 >>> range's size = 16 (bits) >>> cmd_write: scan size = 4 >>> cmd_write: size to write = 400 >>> cmd_write: command successfully sent >>> cmd_write: triggering failed (ret=-32) >>> >>> root@domain.hid# dmesg -c >>> [133345.213865] Analogy: analogy_ni_pcimio: ni_mio_common: interrupt: b_status=0002 m1_status=80a80000 >>> [133345.332719] Analogy: analogy_ni_pcimio: ni_ao_wait_for_dma_load: timed out waiting for dma load<3>Analogy: a4l_do_special_insn: execution of the instruction failed (err=-32) >>> >>> >>> Another problem we have is with the --mmap option: >>> >>> root@domain.hid# ./cmd_write -v --mmap >>> cmd_write: device analogy0 opened (fd=0) >>> cmd_write: basic descriptor retrieved >>> subdevices count = 14 >>> read subdevice index = 0 >>> write subdevice index = 1 >>> cmd_write: complex descriptor retrieved >>> cmd_write: channel 0 >>> ranges count = 3 >>> range's size = 16 (bits) >>> cmd_write: channel 1 >>> ranges count = 3 >>> range's size = 16 (bits) >>> cmd_write: scan size = 4 >>> cmd_write: size to write = 400 >>> cmd_write: buffer size = 65536 bytes >>> cmd_write: a4l_mmap() failed (ret=-22) >>> >>> >>> root@domain.hid# dmesg -c >>> [133408.942998] Analogy: a4l_ioctl_mmap: mmap not allowed on this subdevice >>> >>> >> Alexis. > Alexis. > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] Analogy DIO speed 2010-03-02 18:00 ` Stefan Schaal @ 2010-03-03 23:58 ` Alexis Berlemont 2010-03-04 0:54 ` Stefan Schaal 0 siblings, 1 reply; 10+ messages in thread From: Alexis Berlemont @ 2010-03-03 23:58 UTC (permalink / raw) To: Stefan Schaal; +Cc: Peter Pastor Sampedro, xenomai Hi Stefan, Sorry for the late reply, I was unavailable yesterday. Stefan Schaal wrote: > Hi Alexis, > > we pulled your analogy branch, and now cmd_write works. Great, and thanks a lot! Next, I tried to use commands with the digital IO subdevice on our board (subdevice #2), but the get an error message: > > > [ 2482.771913] Analogy: a4l_check_cmddesc: scan_begin_src, trigger unsupported Unfortunately, cmd_write was not designed to work with digital subdevices; the command's fields are not appropriate, I am trying to make it work quite quickly. > > > Is there just missing support for the DIO subdevices using commands? > > Best wishes, > > -Stefan > > > ps.: feel free to use our machine for debugging -- it now has the latest version of your software installed with linux kernel 2.6.29.5. > > > > > > On Feb 28, 2010, at 16:24, Alexis Berlemont wrote: > >> Alexis Berlemont wrote: >>> Hi, >>> Stefan Schaal wrote: >>>> Hi Alexis, >>>> >>>> On Feb 18, 2010, at 14:34, Alexis Berlemont wrote: >>>> >>>>> I have some problems with >>>>>> implementing commands on my NI6259 so far. >>>>> Could you remind me what was the problem ? >>>> See the print-outs below for the problem we have. >>>> >>>> Thanks so much for looking into this! >>>> >>>> -Stefan >>>> >>>> >>>> >>>> >>>> Using the cmd_write() function that you provide in analogy, we get the following problem: >>>> >>> I am currently trying to fix this bug, which is not that easy. I just >>> have one question (that I remember I have already asked you in some way, >>> but I just want to be sure): >>> Does this bug occur the very first time you launched cmd_write (I mean >>> after a reboot) ? >>> >> I managed at last to fix the bug you were facing (at least I hope so). >> The problem was located in the trigger callback which waited for a >> bit-status (fifo half full) before going further; however, sometimes the >> DMA interrupt already occurred and cleaned everything behind your back. >> >> I have not made a pull request because the current implementation is not >> perfect. >> >> If you have some time, could you clone my git repository (branch: >> analogy) and check that a simple call to cmd_write does not trigger the >> bug anymore ? >> >> Many thanks. >>>> root@domain.hid# ./cmd_write -v >>>> cmd_write: device analogy0 opened (fd=0) >>>> cmd_write: basic descriptor retrieved >>>> subdevices count = 14 >>>> read subdevice index = 0 >>>> write subdevice index = 1 >>>> cmd_write: complex descriptor retrieved >>>> cmd_write: channel 0 >>>> ranges count = 3 >>>> range's size = 16 (bits) >>>> cmd_write: channel 1 >>>> ranges count = 3 >>>> range's size = 16 (bits) >>>> cmd_write: scan size = 4 >>>> cmd_write: size to write = 400 >>>> cmd_write: command successfully sent >>>> cmd_write: triggering failed (ret=-32) >>>> >>>> root@domain.hid# dmesg -c >>>> [133345.213865] Analogy: analogy_ni_pcimio: ni_mio_common: interrupt: b_status=0002 m1_status=80a80000 >>>> [133345.332719] Analogy: analogy_ni_pcimio: ni_ao_wait_for_dma_load: timed out waiting for dma load<3>Analogy: a4l_do_special_insn: execution of the instruction failed (err=-32) >>>> >>>> >>>> Another problem we have is with the --mmap option: >>>> >>>> root@domain.hid# ./cmd_write -v --mmap >>>> cmd_write: device analogy0 opened (fd=0) >>>> cmd_write: basic descriptor retrieved >>>> subdevices count = 14 >>>> read subdevice index = 0 >>>> write subdevice index = 1 >>>> cmd_write: complex descriptor retrieved >>>> cmd_write: channel 0 >>>> ranges count = 3 >>>> range's size = 16 (bits) >>>> cmd_write: channel 1 >>>> ranges count = 3 >>>> range's size = 16 (bits) >>>> cmd_write: scan size = 4 >>>> cmd_write: size to write = 400 >>>> cmd_write: buffer size = 65536 bytes >>>> cmd_write: a4l_mmap() failed (ret=-22) >>>> >>>> >>>> root@domain.hid# dmesg -c >>>> [133408.942998] Analogy: a4l_ioctl_mmap: mmap not allowed on this subdevice >>>> >>>> >>> Alexis. >> Alexis. >> > > Alexis. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] Analogy DIO speed 2010-03-03 23:58 ` Alexis Berlemont @ 2010-03-04 0:54 ` Stefan Schaal 2010-03-04 8:37 ` Alexis Berlemont 0 siblings, 1 reply; 10+ messages in thread From: Stefan Schaal @ 2010-03-04 0:54 UTC (permalink / raw) To: Alexis Berlemont; +Cc: Peter Pastor Sampedro, xenomai Hi Alexis, thanks a lot or the reply. Just to check: is it possible to use commands with digital subdevices at all? I am not sure whether I understood your comment below correctly. Are your *currently* working to enable commands for DIO subdevices? Thanks a lot! -Stefan On Mar 3, 2010, at 15:58, Alexis Berlemont wrote: > Hi Stefan, > > Sorry for the late reply, I was unavailable yesterday. > > Stefan Schaal wrote: >> Hi Alexis, >> we pulled your analogy branch, and now cmd_write works. Great, and thanks a lot! Next, I tried to use commands with the digital IO subdevice on our board (subdevice #2), but the get an error message: >> [ 2482.771913] Analogy: a4l_check_cmddesc: scan_begin_src, trigger unsupported > Unfortunately, cmd_write was not designed to work with digital > subdevices; the command's fields are not appropriate, I am trying to > make it work quite quickly. > >> Is there just missing support for the DIO subdevices using commands? >> Best wishes, >> -Stefan >> ps.: feel free to use our machine for debugging -- it now has the latest version of your software installed with linux kernel 2.6.29.5. >> On Feb 28, 2010, at 16:24, Alexis Berlemont wrote: >>> Alexis Berlemont wrote: >>>> Hi, >>>> Stefan Schaal wrote: >>>>> Hi Alexis, >>>>> >>>>> On Feb 18, 2010, at 14:34, Alexis Berlemont wrote: >>>>> >>>>>> I have some problems with >>>>>>> implementing commands on my NI6259 so far. >>>>>> Could you remind me what was the problem ? >>>>> See the print-outs below for the problem we have. >>>>> >>>>> Thanks so much for looking into this! >>>>> >>>>> -Stefan >>>>> >>>>> >>>>> >>>>> >>>>> Using the cmd_write() function that you provide in analogy, we get the following problem: >>>>> >>>> I am currently trying to fix this bug, which is not that easy. I just >>>> have one question (that I remember I have already asked you in some way, >>>> but I just want to be sure): >>>> Does this bug occur the very first time you launched cmd_write (I mean >>>> after a reboot) ? >>>> >>> I managed at last to fix the bug you were facing (at least I hope so). >>> The problem was located in the trigger callback which waited for a >>> bit-status (fifo half full) before going further; however, sometimes the >>> DMA interrupt already occurred and cleaned everything behind your back. >>> >>> I have not made a pull request because the current implementation is not >>> perfect. >>> >>> If you have some time, could you clone my git repository (branch: >>> analogy) and check that a simple call to cmd_write does not trigger the >>> bug anymore ? >>> >>> Many thanks. >>>>> root@domain.hid# ./cmd_write -v >>>>> cmd_write: device analogy0 opened (fd=0) >>>>> cmd_write: basic descriptor retrieved >>>>> subdevices count = 14 >>>>> read subdevice index = 0 >>>>> write subdevice index = 1 >>>>> cmd_write: complex descriptor retrieved >>>>> cmd_write: channel 0 >>>>> ranges count = 3 >>>>> range's size = 16 (bits) >>>>> cmd_write: channel 1 >>>>> ranges count = 3 >>>>> range's size = 16 (bits) >>>>> cmd_write: scan size = 4 >>>>> cmd_write: size to write = 400 >>>>> cmd_write: command successfully sent >>>>> cmd_write: triggering failed (ret=-32) >>>>> >>>>> root@domain.hid# dmesg -c >>>>> [133345.213865] Analogy: analogy_ni_pcimio: ni_mio_common: interrupt: b_status=0002 m1_status=80a80000 >>>>> [133345.332719] Analogy: analogy_ni_pcimio: ni_ao_wait_for_dma_load: timed out waiting for dma load<3>Analogy: a4l_do_special_insn: execution of the instruction failed (err=-32) >>>>> >>>>> >>>>> Another problem we have is with the --mmap option: >>>>> >>>>> root@domain.hid# ./cmd_write -v --mmap >>>>> cmd_write: device analogy0 opened (fd=0) >>>>> cmd_write: basic descriptor retrieved >>>>> subdevices count = 14 >>>>> read subdevice index = 0 >>>>> write subdevice index = 1 >>>>> cmd_write: complex descriptor retrieved >>>>> cmd_write: channel 0 >>>>> ranges count = 3 >>>>> range's size = 16 (bits) >>>>> cmd_write: channel 1 >>>>> ranges count = 3 >>>>> range's size = 16 (bits) >>>>> cmd_write: scan size = 4 >>>>> cmd_write: size to write = 400 >>>>> cmd_write: buffer size = 65536 bytes >>>>> cmd_write: a4l_mmap() failed (ret=-22) >>>>> >>>>> >>>>> root@domain.hid# dmesg -c >>>>> [133408.942998] Analogy: a4l_ioctl_mmap: mmap not allowed on this subdevice >>>>> >>>>> >>>> Alexis. >>> Alexis. >>> > Alexis. > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] Analogy DIO speed 2010-03-04 0:54 ` Stefan Schaal @ 2010-03-04 8:37 ` Alexis Berlemont 0 siblings, 0 replies; 10+ messages in thread From: Alexis Berlemont @ 2010-03-04 8:37 UTC (permalink / raw) To: Stefan Schaal; +Cc: Peter Pastor Sampedro, xenomai Hi, On Thu, Mar 4, 2010 at 1:54 AM, Stefan Schaal <sschaal@domain.hid> wrote: > Hi Alexis, > > thanks a lot or the reply. Just to check: is it possible to use commands with digital subdevices at all? I am not sure whether I understood your comment below correctly. Are your *currently* working to enable commands for DIO subdevices? Commands are possible with DIO subdevices. The main problem is my test application which does not handle all the cases. > > Thanks a lot! > > -Stefan > > > On Mar 3, 2010, at 15:58, Alexis Berlemont wrote: > >> Hi Stefan, >> >> Sorry for the late reply, I was unavailable yesterday. >> >> Stefan Schaal wrote: >>> Hi Alexis, >>> we pulled your analogy branch, and now cmd_write works. Great, and thanks a lot! Next, I tried to use commands with the digital IO subdevice on our board (subdevice #2), but the get an error message: >>> [ 2482.771913] Analogy: a4l_check_cmddesc: scan_begin_src, trigger unsupported >> Unfortunately, cmd_write was not designed to work with digital >> subdevices; the command's fields are not appropriate, I am trying to >> make it work quite quickly. >> >>> Is there just missing support for the DIO subdevices using commands? >>> Best wishes, >>> -Stefan >>> ps.: feel free to use our machine for debugging -- it now has the latest version of your software installed with linux kernel 2.6.29.5. >>> On Feb 28, 2010, at 16:24, Alexis Berlemont wrote: >>>> Alexis Berlemont wrote: >>>>> Hi, >>>>> Stefan Schaal wrote: >>>>>> Hi Alexis, >>>>>> >>>>>> On Feb 18, 2010, at 14:34, Alexis Berlemont wrote: >>>>>> >>>>>>> I have some problems with >>>>>>>> implementing commands on my NI6259 so far. >>>>>>> Could you remind me what was the problem ? >>>>>> See the print-outs below for the problem we have. >>>>>> >>>>>> Thanks so much for looking into this! >>>>>> >>>>>> -Stefan >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Using the cmd_write() function that you provide in analogy, we get the following problem: >>>>>> >>>>> I am currently trying to fix this bug, which is not that easy. I just >>>>> have one question (that I remember I have already asked you in some way, >>>>> but I just want to be sure): >>>>> Does this bug occur the very first time you launched cmd_write (I mean >>>>> after a reboot) ? >>>>> >>>> I managed at last to fix the bug you were facing (at least I hope so). >>>> The problem was located in the trigger callback which waited for a >>>> bit-status (fifo half full) before going further; however, sometimes the >>>> DMA interrupt already occurred and cleaned everything behind your back. >>>> >>>> I have not made a pull request because the current implementation is not >>>> perfect. >>>> >>>> If you have some time, could you clone my git repository (branch: >>>> analogy) and check that a simple call to cmd_write does not trigger the >>>> bug anymore ? >>>> >>>> Many thanks. >>>>>> root@domain.hid# ./cmd_write -v >>>>>> cmd_write: device analogy0 opened (fd=0) >>>>>> cmd_write: basic descriptor retrieved >>>>>> subdevices count = 14 >>>>>> read subdevice index = 0 >>>>>> write subdevice index = 1 >>>>>> cmd_write: complex descriptor retrieved >>>>>> cmd_write: channel 0 >>>>>> ranges count = 3 >>>>>> range's size = 16 (bits) >>>>>> cmd_write: channel 1 >>>>>> ranges count = 3 >>>>>> range's size = 16 (bits) >>>>>> cmd_write: scan size = 4 >>>>>> cmd_write: size to write = 400 >>>>>> cmd_write: command successfully sent >>>>>> cmd_write: triggering failed (ret=-32) >>>>>> >>>>>> root@domain.hid# dmesg -c >>>>>> [133345.213865] Analogy: analogy_ni_pcimio: ni_mio_common: interrupt: b_status=0002 m1_status=80a80000 >>>>>> [133345.332719] Analogy: analogy_ni_pcimio: ni_ao_wait_for_dma_load: timed out waiting for dma load<3>Analogy: a4l_do_special_insn: execution of the instruction failed (err=-32) >>>>>> >>>>>> >>>>>> Another problem we have is with the --mmap option: >>>>>> >>>>>> root@domain.hid# ./cmd_write -v --mmap >>>>>> cmd_write: device analogy0 opened (fd=0) >>>>>> cmd_write: basic descriptor retrieved >>>>>> subdevices count = 14 >>>>>> read subdevice index = 0 >>>>>> write subdevice index = 1 >>>>>> cmd_write: complex descriptor retrieved >>>>>> cmd_write: channel 0 >>>>>> ranges count = 3 >>>>>> range's size = 16 (bits) >>>>>> cmd_write: channel 1 >>>>>> ranges count = 3 >>>>>> range's size = 16 (bits) >>>>>> cmd_write: scan size = 4 >>>>>> cmd_write: size to write = 400 >>>>>> cmd_write: buffer size = 65536 bytes >>>>>> cmd_write: a4l_mmap() failed (ret=-22) >>>>>> >>>>>> >>>>>> root@domain.hid# dmesg -c >>>>>> [133408.942998] Analogy: a4l_ioctl_mmap: mmap not allowed on this subdevice >>>>>> >>>>>> >>>>> Alexis. >>>> Alexis. >>>> >> Alexis. >> > > > Alexis. ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-03-04 8:37 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-02-17 21:23 [Xenomai-core] Analogy DIO speed Stefan Schaal 2010-02-18 22:34 ` Alexis Berlemont 2010-02-18 22:48 ` Thomas Lockhart 2010-02-19 5:43 ` Stefan Schaal 2010-02-23 23:22 ` Alexis Berlemont 2010-03-01 0:24 ` Alexis Berlemont 2010-03-02 18:00 ` Stefan Schaal 2010-03-03 23:58 ` Alexis Berlemont 2010-03-04 0:54 ` Stefan Schaal 2010-03-04 8:37 ` Alexis Berlemont
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.