Re: Multi-channel receive
Brought to you by:
aeb,
bencollins
From: Chris Wj <chr...@gm...> - 2012-03-30 12:18:21
|
On Thursday, March 29, 2012, Stefan Richter <st...@s5...> wrote: > On Mar 29 Chris Wj wrote: >> With the new firewire-core (Juju) modules, I am no longer limited by the >> system's pagesize, correct? I am expecting S800 8K packets and the page >> size of the x86_64 system is set to 4K. > > This should indeed work. IIRC there are libdc1394 users who do actually > capture video streams with packets larger than 4 kiB. > > So our software supports that, but be warned that Texas Instruments > controllers will not work for you. They have a too small isochronous > reception FIFO and will inevitably give you corruption due to dropped (or > maybe incomplete?) packets. > > You are going to need Agere FW643E or FW643E2 controllers for this; they > have suitably large FIFOs. > > Also make sure that the two simultaneous streams won't overuse the > available bus bandwidth. Here are two tables with the constraints: > http://damien.douxchamps.net/ieee1394/libdc1394/v2.x/faq/#How_can_I_work_out_the_frame_rate_from_the_packet_size > E.g. if you divided the overall isochronous bandwidth of an S800 bus > equally between two streams and keep a constant data rate throughout each > cycle, each stream's packets could be at most 75 MiB/s / 2 * 125 µs = 4.8 > kiB large. But I suppose the designer of the device and of its stream > format took this into account. > >> While I will not use it, I am curious about the multi-channel receive mode. >> Is it part of a specification? Is it basically creating a single contiguous >> buffer from the data from multiple channels? > > It is defined by OHCI-1394 v1.1 and also by its predecessor OHCI-1394 > v1.0. https://ieee1394.wiki.kernel.org/ has a page with links to various > specifications, among them "1394 Open Host Controller Interface > Specification" vulgo OHCI-1394 which is available at no cost. > > Multi-channel IR DMA is a variant of buffer-fill IR DMA. You find it > described in sections 10.2.1 and 10.6.1 of the spec. > > In your initial post you wrote that you want to process the two streams > separately and possibly in two threads. Multi-channel IR DMA is not a > good choice for this since the controller would just stuff all packets (of > all streams to which this DMA is told to listen to) into the reception > buffer in order of arrival. An application like yours would have to > separate the streams again before or during processing. > >>> I noticed that the libraw1394 code does not implement multi-channel >>> reception yet. > > The fact that libraw1394 does not implement multi-channel reception via > the current firewire kernel drivers is just a libraw1394 bug of the > fixable, missing-feature kind. When multi-channel reception was > implemented in the firewire kernel drivers, I started to write the > matching libraw1394 code but got distracted at 33 % completion. > > That said, libraw1394 is generally not recommended for new development. > This is not mant as a general deprecation of libraw1394; it will be > available and maintained for as long as there is FireWire support on > Linux. But libraw1394's API is lower-level than necessary and > than desirable in almost any application domain. Sure enough, the > alternative which would be the <linux/firewire-cdev.h> API, being an > ioctl(2)/read(2) based API, is naturally ugly and low-level too, but it > nevertheless is actually higher-level than <libraw1394/raw1394.h> in a few > respects. On the other hand, <linux/firewire-cdev.h> may provide more > control than <libraw1394/raw1394.h> to those who are keen on more control. > -- > Stefan Richter > -=====-===-- --== ====- > http://arcgraph.de/sr/ > Thank you very much for the helpful information. Time to get coding! Do you have any pointers to some example code that I can study? Best, -Chris |