Attaching 1394 buffers

Hi all,

I’ve been trying to rewrite my 1394 camera driver in order to
accomodate the maximum buffer size of 1 MB under Vista 64.
The scheme is to chunk the image size (2.2 MB) in pieces of
500k or less using IOAllocateMDL and IOBuildPartialMDL from
my Irp->MDLAddress and attach 2 buffers. When the first is filled,
I detach it and attach the next one and so on.

This works only, if I am using the exact same size for each of the
chunks. If I use differing chunk sizes, attaching fails with
insufficient resources.

Any ideas?

Udo Lenz, CCD Videometrie

Can RESOURCE_VARIABLE_ISOCH_PAYLOAD help?


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> Hi all,
>
> I’ve been trying to rewrite my 1394 camera driver in order to
> accomodate the maximum buffer size of 1 MB under Vista 64.
> The scheme is to chunk the image size (2.2 MB) in pieces of
> 500k or less using IOAllocateMDL and IOBuildPartialMDL from
> my Irp->MDLAddress and attach 2 buffers. When the first is filled,
> I detach it and attach the next one and so on.
>
> This works only, if I am using the exact same size for each of the
> chunks. If I use differing chunk sizes, attaching fails with
> insufficient resources.
>
> Any ideas?
>
> Udo Lenz, CCD Videometrie
>
>
>

On Mon, 17 Mar 2008 21:12:44 +0300, “Maxim S. Shatskih”
wrote:

It looks to me that RESOURCE_VARIABLE_ISOCH_PAYLOAD refers to variable
size packets, not variable size buffers. Do you agree?

> Can RESOURCE_VARIABLE_ISOCH_PAYLOAD help?
>
>–
>Maxim Shatskih, Windows DDK MVP
>StorageCraft Corporation
>xxxxx@storagecraft.com
>http://www.storagecraft.com
>
> wrote in message news:xxxxx@ntdev…
>> Hi all,
>>
>> I’ve been trying to rewrite my 1394 camera driver in order to
>> accomodate the maximum buffer size of 1 MB under Vista 64.
>> The scheme is to chunk the image size (2.2 MB) in pieces of
>> 500k or less using IOAllocateMDL and IOBuildPartialMDL from
>> my Irp->MDLAddress and attach 2 buffers. When the first is filled,
>> I detach it and attach the next one and so on.
>>
>> This works only, if I am using the exact same size for each of the
>> chunks. If I use differing chunk sizes, attaching fails with
>> insufficient resources.
>>
>> Any ideas?
>>
>> Udo Lenz, CCD Videometrie
>>
>>
>>
>

On Tue, 18 Mar 2008 14:21:41 GMT, xxxxx@compuserve.com wrote:

I’ve finally found the reason for the strange behaviour. When keeping
several isoch buffers attached, the bounce buffer (map registers) will
become fragmented. If the attached buffers have variable size, the
bounce buffer might have enough space left but not in a contiguous
chunk. So attaching will fail.

I think MS implementation of this is pretty goofy, since the
controller has scatter gather capabilities.

Udo Lenz

> Can RESOURCE_VARIABLE_ISOCH_PAYLOAD help?
>
>–
>Maxim Shatskih, Windows DDK MVP
>StorageCraft Corporation
>xxxxx@storagecraft.com
>http://www.storagecraft.com
>
> wrote in message news:xxxxx@ntdev…
>>> Hi all,
>>>
>>> I’ve been trying to rewrite my 1394 camera driver in order to
>>> accomodate the maximum buffer size of 1 MB under Vista 64.
>>> The scheme is to chunk the image size (2.2 MB) in pieces of
>>> 500k or less using IOAllocateMDL and IOBuildPartialMDL from
>>> my Irp->MDLAddress and attach 2 buffers. When the first is filled,
>>> I detach it and attach the next one and so on.
>>>
>>> This works only, if I am using the exact same size for each of the
>>> chunks. If I use differing chunk sizes, attaching fails with
>>> insufficient resources.
>>>
>>> Any ideas?
>>>
>>> Udo Lenz, CCD Videometrie
>>>
>>>
>>>
>>
>
>

> I think MS implementation of this is pretty goofy, since the

controller has scatter gather capabilities.

…but not above 4GB?

I did some work related to OHCI1394 controller in around 1999, and I do not
remember it using DMA bounce buffers.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

IIRC 1394 is spec’d at below 4gb only.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Thursday, March 20, 2008 9:33 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Attaching 1394 buffers

I think MS implementation of this is pretty goofy, since the
controller has scatter gather capabilities.

…but not above 4GB?

I did some work related to OHCI1394 controller in around 1999, and I do
not
remember it using DMA bounce buffers.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

I believe the system resorts to bounce buffers because the controller
can’t address more than 32 bits. So bounce buffers are provided, which
are guaranteed to lie below the 4 GB boundary. Scatter gather should
be technically possible there.

Udo Lenz, CCD Videometrie

> I think MS implementation of this is pretty goofy, since the
> controller has scatter gather capabilities.

…but not above 4GB?

I did some work related to OHCI1394 controller in around 1999, and I do not
remember it using DMA bounce buffers.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com