Drivers QCI



  1. Drivers Circle Budget
  2. Drivers Quiz Test

Author: Robert Jarzmik <robert.jarzmik@free.fr>

24.1. Constraints¶

Drivers quiz test
  1. Image size for YUV422P formatAll YUV422P images are enforced to have width x height % 16 = 0.This is due to DMA constraints, which transfers only planes of 8 bytemultiples.

24.2. Global video workflow¶

QCI 4 is intended for non-conversational video (buffered streaming), with a priority of 5. This QCI is also video in nature. Although it is buffered, it is admitted, being associated to a GBR. QCI 4 as a lower priority than QCI 67 and QCI 2, and a larger delay budget (300 ms vs 150/100). However, its packet loss tolerance is low (10.E-6). On this page, you can find the official Elements Terra 7 QCI USB Driver, which allows you to connect the device during the flashing process or while generally connecting the device to the computer. There is one driver available for the device, i.e., ADB Driver.

  1. QCI stoppedInitialy, the QCI interface is stopped.When a buffer is queued (pxa_videobuf_ops->buf_queue), the QCI starts.

  2. QCI startedMore buffers can be queued while the QCI is started without halting thecapture. The new buffers are “appended” at the tail of the DMA chain, andsmoothly captured one frame after the other.

    Once a buffer is filled in the QCI interface, it is marked as “DONE” andremoved from the active buffers list. It can be then requeud or dequeued byuserland application.

    Once the last buffer is filled in, the QCI interface stops.

  3. Capture global finite state machine schema

Drivers Circle Budget

24.3. DMA usage¶

  1. DMA flow
    • first buffer queued for captureOnce a first buffer is queued for capture, the QCI is started, but datatransfer is not started. On “End Of Frame” interrupt, the irq handlerstarts the DMA chain.
    • capture of one videobufferThe DMA chain starts transferring data into videobuffer RAM pages.When all pages are transferred, the DMA irq is raised on “ENDINTR” status
    • finishing one videobufferThe DMA irq handler marks the videobuffer as “done”, and removes it fromthe active running queueMeanwhile, the next videobuffer (if there is one), is transferred by DMA
    • finishing the last videobufferOn the DMA irq of the last videobuffer, the QCI is stopped.
  2. DMA prepared buffer will have this structure

This structure is pointed by dma->sg_cpu.The descriptors are used as follows:

  • desc-sg[i]: i-th descriptor, transferring the i-th sgelement to the video buffer scatter gather
  • finisher: has ddadr=DADDR_STOP, dcmd=ENDIRQEN
  • linker: has ddadr= desc-sg[0] of next video buffer, dcmd=0

For the next schema, let’s assume d0=desc-sg[0] .. dN=desc-sg[N],“f” stands for finisher and “l” for linker.A typical running chain is :

After the chaining is finished, the chain looks like :

  1. DMA hot chaining timeslice issue

Drivers Quiz Test

As DMA chaining is done while DMA _is_ running, the linking may be donewhile the DMA jumps from one Videobuffer to another. On the schema, thatwould be a problem if the following sequence is encountered :

Drivers QCIDrivers
  • DMA chain is Videobuffer1 + Videobuffer2
  • pxa_videobuf_queue() is called to queue Videobuffer3
  • DMA controller finishes Videobuffer2, and DMA stops
Drivers
  • pxa_dma_add_tail_buf() is called, the Videobuffer2 “finisher” isreplaced by a “linker” to Videobuffer3 (creation of new_link)
  • pxa_videobuf_queue() finishes
  • the DMA irq handler is called, which terminates Videobuffer2
  • Videobuffer3 capture is not scheduled on DMA chain (as it stopped !!!)
  • pxa_camera_check_link_miss() is calledThis checks if the DMA is finished and a buffer is still on thepcdev->capture list. If that’s the case, the capture will be restarted,and Videobuffer3 is scheduled on DMA chain.
  • the DMA irq handler finishes

Note

Drivers QCI

If DMA stops just after pxa_camera_check_link_miss() reads DDADR()value, we have the guarantee that the DMA irq handler will be called backwhen the DMA will finish the buffer, and pxa_camera_check_link_miss() willbe called again, to reschedule Videobuffer3.

The absolute encoders provide high-accuracy, subarcsecond feedback to the motion of the mount. The absolute encoders render the axes “live” and free to react also to any external forces like wind and vibrations or accidental contact. Furthermore, this feedback is provided regardless of any zeroing or homing procedure.
This means that the electronics will always know the position of the mount. You may move around the mount with the clutches unlocked and the electronics powered off, lock the clutches in any position and switch on the mount: the electronics will know where the telescope is looking. You may effectively use the mount as a Dobsonian telescope with manual pointing, retaining the full, sub- arcsecond accuracy of the encoders.
This means ease of use when operating in the field, since the setup procedure is much faster.

With regard to the right ascension axis, virtually all the mechanical error from the reduction gearing is eliminated. Not only the so-called “Periodic Error”, which comprises the periodic irregularities due to imperfection in the manufacturing and assembling of the worm, but also the non-periodic errors due to imperfections in the wormwheel, bearings, belts and so on.

With regard to the declination axis, it may seem that the encoder system is less important, since there is no sidereal tracking motion. The reality is that the declination axis is critical to sidereal tracking. If you want to compensate for refraction, telescope and mount flexure and so on, you will have to move the declination axis at very small speeds. Furthermore, while the right ascension axis works always at the same speed (plus or minus small corrections), the declination axis works always at near-zero speeds, with the occasional inversion of the direction of motion. This means that mechanical backlash, belt flexure and friction forces show in the declination axis, and you can’t count on any “Periodic Error Correction” to compensate for them. Tricks for minimizing the effect of these forces in traditional mounts require having very small preload on the worm, with the risk of uncontrolled motion when the telescope is subjected to even small external forces, because of the disengaging of the worm from the wormwheel; painstakingly calibrating software backlash compensation procedures; manually adjusting the meshing of gears. Or, maybe, introducing forcefully small alignment errors, to force autoguide corrections always in the same direction. So, having an encoder mounted directly on-axis is at least as important in declination as in right ascension.