Isochronous transfers

bridged with qdn.public.ddk.usb
Pano

Re: Isochronous transfers

Post by Pano » Thu Mar 20, 2003 7:19 am

I'll post the snippets and informations when I'll come back home (around
5.30 pm)...

"Henry Van Dyke" <henry@93.com> a écrit dans le message de news:
b5aoep$1e6$1@nntp.qnx.com...
Hercot Jean-Yves (fa063821@skynet.be) wrote:
: I have tried and it doesn't work :-(.

: I have checked my code with Peter's one and it seems similar. When I
setup
: an isochronous I receive the callback (even if I don't enable Isoch
: transfers on the cam) but the urb_status is set to 0x02040932.

This doesn't like a valid urb_status at all.

What USB controller chip are you running on.
Could you post code snippets of where you are
enqueuing the urbs ?

: The results of usb -vvv seems correct and the cam works well under
windows
: on the same computer.

: I have noticed that the value returned by usbd_pipe_endpoint is 0 for
the
: control pipe and 129 for the Isoch/in pipe (it should be 1). It also
: returns 129 with the other alternate settings.

129 = 0x81

upper 4bits give direction(In) and lower 4 bits are the endpoint number.


: Help me!!!! :-p

: "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message news:
: b5abul$f7k$1@inn.qnx.com...
: > Henry > I'll test all you have said about the isochronous transfers.
I'll
: > post my question here if it doesn't work... ;-)
:
: > Thanx
:
: > "Henry Van Dyke" <henry@93.com> a écrit dans le message news:
: > b5acdd$ni0$1@nntp.qnx.com...
: > > Peter (nospam@nospam.at.all) wrote:
: > > : Ohhhh, yeah....now its working.
:
: > > Thats good to hear
:
: > > : damn I was looking over the code again and again and the doc says
: > > : 'one of these flags'....but of course, the setup needs a
direction.
: > > : Henry, thank you very much for your help, you are my hero :-)
: > > : cheers, peter
:
: > > Your welcome..
: > > I'm glad it didn't turn out to be anything too serious 8-)
:
:
:
: > > : "Henry Van Dyke" <henry@93.com> schrieb im Newsbeitrag
: > > : news:b5a8v9$l6k$1@nntp.qnx.com...
: > > : > Peter (nospam@nospam.at.all) wrote:
: > > : > : INIT:
: > > : > : for (i = 0; i < MAX_ISO_BUFS; i++)
: > > : > : {
: > > : > : urb = pdev->sbuf.urb;
: > > : > : usbd_setup_isochronous(urb, URB_ISOCH_ASAP, 0,
pdev->sbuf.data,
: > > : > : pdev->vmax_packet_size);
: > > : > : usbd_io(urb, pdev->ep_iso_pipe, pwc_isoc_handler,
: > pdev->sbuf.data,
: > > : > : USBD_TIME_INFINITY);
: > > : > : }
: > > :
: > > : > Try setting the direction flag URB_DIR_IN
: > > :
: > > :
: > > :
: > > : > : // callback
: > > : > : static void
: > > : > : pwc_isoc_handler(struct usbd_urb *urb, struct usbd_pipe *pipe,
: void
: > > : *hdl) {
: > > : > : usbd_urb_status( urb, &fst, &flen );
: > > : > : if( ( fst & USBD_URB_STATUS_MASK ) != USBD_STATUS_CMP )
: > > : > : {
: > > : > : // check for a stall condition and clear it
: > > : > : if( ( fst & USBD_USB_STATUS_MASK ) == USBD_STATUS_STALL )
: > > : > : {
: > > : > : usbd_reset_pipe( pipe );
: > > : > : if( cam.verbose )
: > > : > : Trace("pwc_isoc_handler: STALL ustatus %x, %d", fst, flen);
: > > : > : }
: > > : > : if( cam.verbose )
: > > : > : Trace("pwc_isoc_handler: ustatus %x, %d", fst, flen );
: > > : > : return;
: > > : > : }
: > > : > : .....
: > > : > : usbd_setup_isochronous(urb, URB_ISOCH_ASAP, 0, hdl,
: > > : pdev->vmax_packet_size);
: > > : > : usbd_io(urb, pdev->ep_iso_pipe, pwc_isoc_handler, hdl,
: > > : USBD_TIME_INFINITY);
: > > : > : }
: > > :
: > > :
:
:
:
:


Peter

Re: Isochronous transfers

Post by Peter » Thu Mar 20, 2003 12:42 pm

have a look to the mouse_parse_descriptors() in the DDK mouse example.
to get/test the endpoint number use ep = bEndpointAddress & 0xF.

"Hercot Jean-Yves" <fa063821@skynet.be> schrieb im Newsbeitrag
news:b5ajj2$n6o$1@inn.qnx.com...
I have tried and it doesn't work :-(.

I have checked my code with Peter's one and it seems similar. When I
setup
an isochronous I receive the callback (even if I don't enable Isoch
transfers on the cam) but the urb_status is set to 0x02040932.

The results of usb -vvv seems correct and the cam works well under windows
on the same computer.

I have noticed that the value returned by usbd_pipe_endpoint is 0 for the
control pipe and 129 for the Isoch/in pipe (it should be 1). It also
returns 129 with the other alternate settings.

Help me!!!! :-p

"Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message news:
b5abul$f7k$1@inn.qnx.com...
Henry > I'll test all you have said about the isochronous transfers.
I'll
post my question here if it doesn't work... ;-)

Thanx

"Henry Van Dyke" <henry@93.com> a écrit dans le message news:
b5acdd$ni0$1@nntp.qnx.com...
Peter (nospam@nospam.at.all) wrote:
: Ohhhh, yeah....now its working.

Thats good to hear

: damn I was looking over the code again and again and the doc says
: 'one of these flags'....but of course, the setup needs a direction.
: Henry, thank you very much for your help, you are my hero :-)
: cheers, peter

Your welcome..
I'm glad it didn't turn out to be anything too serious 8-)



: "Henry Van Dyke" <henry@93.com> schrieb im Newsbeitrag
: news:b5a8v9$l6k$1@nntp.qnx.com...
: > Peter (nospam@nospam.at.all) wrote:
: > : INIT:
: > : for (i = 0; i < MAX_ISO_BUFS; i++)
: > : {
: > : urb = pdev->sbuf.urb;
: > : usbd_setup_isochronous(urb, URB_ISOCH_ASAP, 0,
pdev->sbuf.data,
: > : pdev->vmax_packet_size);
: > : usbd_io(urb, pdev->ep_iso_pipe, pwc_isoc_handler,
pdev->sbuf.data,
: > : USBD_TIME_INFINITY);
: > : }
:
: > Try setting the direction flag URB_DIR_IN
:
:
:
: > : // callback
: > : static void
: > : pwc_isoc_handler(struct usbd_urb *urb, struct usbd_pipe *pipe,
void
: *hdl) {
: > : usbd_urb_status( urb, &fst, &flen );
: > : if( ( fst & USBD_URB_STATUS_MASK ) != USBD_STATUS_CMP )
: > : {
: > : // check for a stall condition and clear it
: > : if( ( fst & USBD_USB_STATUS_MASK ) == USBD_STATUS_STALL )
: > : {
: > : usbd_reset_pipe( pipe );
: > : if( cam.verbose )
: > : Trace("pwc_isoc_handler: STALL ustatus %x, %d", fst, flen);
: > : }
: > : if( cam.verbose )
: > : Trace("pwc_isoc_handler: ustatus %x, %d", fst, flen );
: > : return;
: > : }
: > : .....
: > : usbd_setup_isochronous(urb, URB_ISOCH_ASAP, 0, hdl,
: pdev->vmax_packet_size);
: > : usbd_io(urb, pdev->ep_iso_pipe, pwc_isoc_handler, hdl,
: USBD_TIME_INFINITY);
: > : }
:
:






Hercot Jean-Yves

Re: Isochronous transfers

Post by Hercot Jean-Yves » Thu Mar 20, 2003 5:53 pm

have a look to the mouse_parse_descriptors() in the DDK mouse example.
to get/test the endpoint number use ep = bEndpointAddress & 0xF.
I get the correct value :-) (1)
What USB controller chip are you running on.
VIA VT83C572

+

Opti 82C861 Firelink (Pci-to-usb bridge)
Could you post code snippets of where you are
enqueuing the urbs ?
spca->urbIso = usbd_alloc_urb(NULL);
spca->frameBuffer = usbd_alloc(MAX_FRAME_SIZE_PER_DESC);
error =
usbd_setup_isochronous(spca->urbIso,URB_DIR_IN|URB_ISOCH_ASAP,0,spca->frameB
uffer,MAX_FRAME_SIZE_PER_DESC);
if (error)
{
printf("usbd_setup_isochronous error: %d\n",error);
}
else
printf("usbd_setup_isochronous ok\n");
error =
usbd_io(spca->urbIso,spca->IsoPipe,isoc_irq,spca,USBD_TIME_INFINITY);
if (error)
{
printf("usbd_io error: %d\n",error);
}

--> the pipe is correctly initialized I think.


"Peter" <nospam@nospam.at.all> a écrit dans le message news:
b5cbel$mn9$1@inn.qnx.com...
have a look to the mouse_parse_descriptors() in the DDK mouse example.
to get/test the endpoint number use ep = bEndpointAddress & 0xF.

"Hercot Jean-Yves" <fa063821@skynet.be> schrieb im Newsbeitrag
news:b5ajj2$n6o$1@inn.qnx.com...
I have tried and it doesn't work :-(.

I have checked my code with Peter's one and it seems similar. When I
setup
an isochronous I receive the callback (even if I don't enable Isoch
transfers on the cam) but the urb_status is set to 0x02040932.

The results of usb -vvv seems correct and the cam works well under
windows
on the same computer.

I have noticed that the value returned by usbd_pipe_endpoint is 0 for
the
control pipe and 129 for the Isoch/in pipe (it should be 1). It also
returns 129 with the other alternate settings.

Help me!!!! :-p

"Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message news:
b5abul$f7k$1@inn.qnx.com...
Henry > I'll test all you have said about the isochronous transfers.
I'll
post my question here if it doesn't work... ;-)

Thanx

"Henry Van Dyke" <henry@93.com> a écrit dans le message news:
b5acdd$ni0$1@nntp.qnx.com...
Peter (nospam@nospam.at.all) wrote:
: Ohhhh, yeah....now its working.

Thats good to hear

: damn I was looking over the code again and again and the doc says
: 'one of these flags'....but of course, the setup needs a
direction.
: Henry, thank you very much for your help, you are my hero :-)
: cheers, peter

Your welcome..
I'm glad it didn't turn out to be anything too serious 8-)



: "Henry Van Dyke" <henry@93.com> schrieb im Newsbeitrag
: news:b5a8v9$l6k$1@nntp.qnx.com...
: > Peter (nospam@nospam.at.all) wrote:
: > : INIT:
: > : for (i = 0; i < MAX_ISO_BUFS; i++)
: > : {
: > : urb = pdev->sbuf.urb;
: > : usbd_setup_isochronous(urb, URB_ISOCH_ASAP, 0,
pdev->sbuf.data,
: > : pdev->vmax_packet_size);
: > : usbd_io(urb, pdev->ep_iso_pipe, pwc_isoc_handler,
pdev->sbuf.data,
: > : USBD_TIME_INFINITY);
: > : }
:
: > Try setting the direction flag URB_DIR_IN
:
:
:
: > : // callback
: > : static void
: > : pwc_isoc_handler(struct usbd_urb *urb, struct usbd_pipe *pipe,
void
: *hdl) {
: > : usbd_urb_status( urb, &fst, &flen );
: > : if( ( fst & USBD_URB_STATUS_MASK ) != USBD_STATUS_CMP )
: > : {
: > : // check for a stall condition and clear it
: > : if( ( fst & USBD_USB_STATUS_MASK ) == USBD_STATUS_STALL )
: > : {
: > : usbd_reset_pipe( pipe );
: > : if( cam.verbose )
: > : Trace("pwc_isoc_handler: STALL ustatus %x, %d", fst, flen);
: > : }
: > : if( cam.verbose )
: > : Trace("pwc_isoc_handler: ustatus %x, %d", fst, flen );
: > : return;
: > : }
: > : .....
: > : usbd_setup_isochronous(urb, URB_ISOCH_ASAP, 0, hdl,
: pdev->vmax_packet_size);
: > : usbd_io(urb, pdev->ep_iso_pipe, pwc_isoc_handler, hdl,
: USBD_TIME_INFINITY);
: > : }
:
:








Henry Van Dyke

Re: Isochronous transfers

Post by Henry Van Dyke » Thu Mar 20, 2003 7:40 pm

Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > have a look to the mouse_parse_descriptors() in the DDK mouse example.
: > to get/test the endpoint number use ep = bEndpointAddress & 0xF.

: I get the correct value :-) (1)

: >What USB controller chip are you running on.

: VIA VT83C572

: +

: Opti 82C861 Firelink (Pci-to-usb bridge)

: >Could you post code snippets of where you are
: >enqueuing the urbs ?

: spca->urbIso = usbd_alloc_urb(NULL);
: spca->frameBuffer = usbd_alloc(MAX_FRAME_SIZE_PER_DESC);
: error =
: usbd_setup_isochronous(spca->urbIso,URB_DIR_IN|URB_ISOCH_ASAP,0,spca->frameB
: uffer,MAX_FRAME_SIZE_PER_DESC);
: if (error)
: {
: printf("usbd_setup_isochronous error: %d\n",error);
: }
: else
: printf("usbd_setup_isochronous ok\n");
: error =
: usbd_io(spca->urbIso,spca->IsoPipe,isoc_irq,spca,USBD_TIME_INFINITY);
: if (error)
: {
: printf("usbd_io error: %d\n",error);
: }

: --> the pipe is correctly initialized I think.


Have you initialized the camera to get it start
capturing frames.

I can't see anything obviously wrong with the above code.

Is MAX_FRAME_SIZE_PER_DESC equal to the endpoint size ?

In your callback function to do you continously get the
same error reported in the the call to usbd_urb_status() ?



: "Peter" <nospam@nospam.at.all> a écrit dans le message news:
: b5cbel$mn9$1@inn.qnx.com...
: > have a look to the mouse_parse_descriptors() in the DDK mouse example.
: > to get/test the endpoint number use ep = bEndpointAddress & 0xF.
: >
: > "Hercot Jean-Yves" <fa063821@skynet.be> schrieb im Newsbeitrag
: > news:b5ajj2$n6o$1@inn.qnx.com...
: > > I have tried and it doesn't work :-(.
: > >
: > > I have checked my code with Peter's one and it seems similar. When I
: > setup
: > > an isochronous I receive the callback (even if I don't enable Isoch
: > > transfers on the cam) but the urb_status is set to 0x02040932.
: > >
: > > The results of usb -vvv seems correct and the cam works well under
: windows
: > > on the same computer.
: > >
: > > I have noticed that the value returned by usbd_pipe_endpoint is 0 for
: the
: > > control pipe and 129 for the Isoch/in pipe (it should be 1). It also
: > > returns 129 with the other alternate settings.
: > >
: > > Help me!!!! :-p
: > >
: > > "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message news:
: > > b5abul$f7k$1@inn.qnx.com...
: > > > Henry > I'll test all you have said about the isochronous transfers.
: > I'll
: > > > post my question here if it doesn't work... ;-)
: > > >
: > > > Thanx

[snip]

Hercot Jean-Yves

Re: Isochronous transfers

Post by Hercot Jean-Yves » Thu Mar 20, 2003 7:58 pm

Have you initialized the camera to get it start
capturing frames.
Yes. But I also receive the call back if I don't initialize the camera to
get it start capturing frames. :-s
Is MAX_FRAME_SIZE_PER_DESC equal to the >endpoint size ?
Yes. 1023 exactly.
In your callback function to do you continously get the
same error reported in the the call to usbd_urb_status() ?
Always the same status : 0x02040932

Tomorrow I'll try the webcam on an other computer to see if status keeps the
same value.

But I can say I'am sure it is not a hardware problem because the cam works
very well under windows....

"Henry Van Dyke" <henry@93.com> a écrit dans le message news:
b5d5g7$j2n$1@nntp.qnx.com...
Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > have a look to the mouse_parse_descriptors() in the DDK mouse example.
: > to get/test the endpoint number use ep = bEndpointAddress & 0xF.

: I get the correct value :-) (1)

: >What USB controller chip are you running on.

: VIA VT83C572

: +

: Opti 82C861 Firelink (Pci-to-usb bridge)

: >Could you post code snippets of where you are
: >enqueuing the urbs ?

: spca->urbIso = usbd_alloc_urb(NULL);
: spca->frameBuffer = usbd_alloc(MAX_FRAME_SIZE_PER_DESC);
: error =
:
usbd_setup_isochronous(spca->urbIso,URB_DIR_IN|URB_ISOCH_ASAP,0,spca->frameB
: uffer,MAX_FRAME_SIZE_PER_DESC);
: if (error)
: {
: printf("usbd_setup_isochronous error: %d\n",error);
: }
: else
: printf("usbd_setup_isochronous ok\n");
: error =
: usbd_io(spca->urbIso,spca->IsoPipe,isoc_irq,spca,USBD_TIME_INFINITY);
: if (error)
: {
: printf("usbd_io error: %d\n",error);
: }

: --> the pipe is correctly initialized I think.


Have you initialized the camera to get it start
capturing frames.

I can't see anything obviously wrong with the above code.

Is MAX_FRAME_SIZE_PER_DESC equal to the endpoint size ?

In your callback function to do you continously get the
same error reported in the the call to usbd_urb_status() ?



: "Peter" <nospam@nospam.at.all> a écrit dans le message news:
: b5cbel$mn9$1@inn.qnx.com...
: > have a look to the mouse_parse_descriptors() in the DDK mouse example.
: > to get/test the endpoint number use ep = bEndpointAddress & 0xF.
:
: > "Hercot Jean-Yves" <fa063821@skynet.be> schrieb im Newsbeitrag
: > news:b5ajj2$n6o$1@inn.qnx.com...
: > > I have tried and it doesn't work :-(.
:
: > > I have checked my code with Peter's one and it seems similar. When
I
: > setup
: > > an isochronous I receive the callback (even if I don't enable Isoch
: > > transfers on the cam) but the urb_status is set to 0x02040932.
:
: > > The results of usb -vvv seems correct and the cam works well under
: windows
: > > on the same computer.
:
: > > I have noticed that the value returned by usbd_pipe_endpoint is 0
for
: the
: > > control pipe and 129 for the Isoch/in pipe (it should be 1). It
also
: > > returns 129 with the other alternate settings.
:
: > > Help me!!!! :-p
:
: > > "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message
news:
: > > b5abul$f7k$1@inn.qnx.com...
: > > > Henry > I'll test all you have said about the isochronous
transfers.
: > I'll
: > > > post my question here if it doesn't work... ;-)
:
: > > > Thanx

[snip]

Hercot Jean-Yves

Re: Isochronous transfers

Post by Hercot Jean-Yves » Thu Mar 20, 2003 9:36 pm

I find out something... I explain.

I was doing that in the insertion callback:

usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
ce.iface,7,&nod);

Now I have written that and put the buffer size to 0 (size for alternate 0):

inter =
usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
ce.iface,spca->instance.alternate,&nod)

And after that status look like: 0x02000005

I think it means the device doesn't respond. Perhaps because of packet size
0...

Could you tell me how to do to get the alternate 7 properly?

"Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message news:
b5d5ff$ltm$1@inn.qnx.com...
Have you initialized the camera to get it start
capturing frames.

Yes. But I also receive the call back if I don't initialize the camera to
get it start capturing frames. :-s

Is MAX_FRAME_SIZE_PER_DESC equal to the >endpoint size ?

Yes. 1023 exactly.

In your callback function to do you continously get the
same error reported in the the call to usbd_urb_status() ?

Always the same status : 0x02040932

Tomorrow I'll try the webcam on an other computer to see if status keeps
the
same value.

But I can say I'am sure it is not a hardware problem because the cam works
very well under windows....

"Henry Van Dyke" <henry@93.com> a écrit dans le message news:
b5d5g7$j2n$1@nntp.qnx.com...
Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > have a look to the mouse_parse_descriptors() in the DDK mouse
example.
: > to get/test the endpoint number use ep = bEndpointAddress & 0xF.

: I get the correct value :-) (1)

: >What USB controller chip are you running on.

: VIA VT83C572

: +

: Opti 82C861 Firelink (Pci-to-usb bridge)

: >Could you post code snippets of where you are
: >enqueuing the urbs ?

: spca->urbIso = usbd_alloc_urb(NULL);
: spca->frameBuffer = usbd_alloc(MAX_FRAME_SIZE_PER_DESC);
: error =
:

usbd_setup_isochronous(spca->urbIso,URB_DIR_IN|URB_ISOCH_ASAP,0,spca->frameB
: uffer,MAX_FRAME_SIZE_PER_DESC);
: if (error)
: {
: printf("usbd_setup_isochronous error: %d\n",error);
: }
: else
: printf("usbd_setup_isochronous ok\n");
: error =
: usbd_io(spca->urbIso,spca->IsoPipe,isoc_irq,spca,USBD_TIME_INFINITY);
: if (error)
: {
: printf("usbd_io error: %d\n",error);
: }

: --> the pipe is correctly initialized I think.


Have you initialized the camera to get it start
capturing frames.

I can't see anything obviously wrong with the above code.

Is MAX_FRAME_SIZE_PER_DESC equal to the endpoint size ?

In your callback function to do you continously get the
same error reported in the the call to usbd_urb_status() ?



: "Peter" <nospam@nospam.at.all> a écrit dans le message news:
: b5cbel$mn9$1@inn.qnx.com...
: > have a look to the mouse_parse_descriptors() in the DDK mouse
example.
: > to get/test the endpoint number use ep = bEndpointAddress & 0xF.
:
: > "Hercot Jean-Yves" <fa063821@skynet.be> schrieb im Newsbeitrag
: > news:b5ajj2$n6o$1@inn.qnx.com...
: > > I have tried and it doesn't work :-(.
:
: > > I have checked my code with Peter's one and it seems similar.
When
I
: > setup
: > > an isochronous I receive the callback (even if I don't enable
Isoch
: > > transfers on the cam) but the urb_status is set to 0x02040932.
:
: > > The results of usb -vvv seems correct and the cam works well under
: windows
: > > on the same computer.
:
: > > I have noticed that the value returned by usbd_pipe_endpoint is 0
for
: the
: > > control pipe and 129 for the Isoch/in pipe (it should be 1). It
also
: > > returns 129 with the other alternate settings.
:
: > > Help me!!!! :-p
:
: > > "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message
news:
: > > b5abul$f7k$1@inn.qnx.com...
: > > > Henry > I'll test all you have said about the isochronous
transfers.
: > I'll
: > > > post my question here if it doesn't work... ;-)
:
: > > > Thanx

[snip]


Peter

Re: Isochronous transfers

Post by Peter » Fri Mar 21, 2003 2:57 pm

Read out the correct vMaxPacketSize for the endpoint and use this (and only
this) value
for your setup_isoch....(). The size changes for each alternate.
cheers, peter
"Hercot Jean-Yves" <fa063821@skynet.be> schrieb im Newsbeitrag
news:b5db24$rs6$1@inn.qnx.com...
I find out something... I explain.

I was doing that in the insertion callback:


usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
ce.iface,7,&nod);

Now I have written that and put the buffer size to 0 (size for alternate
0):

inter =

usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
ce.iface,spca->instance.alternate,&nod)

And after that status look like: 0x02000005

I think it means the device doesn't respond. Perhaps because of packet
size
0...

Could you tell me how to do to get the alternate 7 properly?

"Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message news:
b5d5ff$ltm$1@inn.qnx.com...
Have you initialized the camera to get it start
capturing frames.

Yes. But I also receive the call back if I don't initialize the camera
to
get it start capturing frames. :-s

Is MAX_FRAME_SIZE_PER_DESC equal to the >endpoint size ?

Yes. 1023 exactly.

In your callback function to do you continously get the
same error reported in the the call to usbd_urb_status() ?

Always the same status : 0x02040932

Tomorrow I'll try the webcam on an other computer to see if status keeps
the
same value.

But I can say I'am sure it is not a hardware problem because the cam
works
very well under windows....

"Henry Van Dyke" <henry@93.com> a écrit dans le message news:
b5d5g7$j2n$1@nntp.qnx.com...
Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > have a look to the mouse_parse_descriptors() in the DDK mouse
example.
: > to get/test the endpoint number use ep = bEndpointAddress & 0xF.

: I get the correct value :-) (1)

: >What USB controller chip are you running on.

: VIA VT83C572

: +

: Opti 82C861 Firelink (Pci-to-usb bridge)

: >Could you post code snippets of where you are
: >enqueuing the urbs ?

: spca->urbIso = usbd_alloc_urb(NULL);
: spca->frameBuffer = usbd_alloc(MAX_FRAME_SIZE_PER_DESC);
: error =
:


usbd_setup_isochronous(spca->urbIso,URB_DIR_IN|URB_ISOCH_ASAP,0,spca->frameB
: uffer,MAX_FRAME_SIZE_PER_DESC);
: if (error)
: {
: printf("usbd_setup_isochronous error: %d\n",error);
: }
: else
: printf("usbd_setup_isochronous ok\n");
: error =
:
usbd_io(spca->urbIso,spca->IsoPipe,isoc_irq,spca,USBD_TIME_INFINITY);
: if (error)
: {
: printf("usbd_io error: %d\n",error);
: }

: --> the pipe is correctly initialized I think.


Have you initialized the camera to get it start
capturing frames.

I can't see anything obviously wrong with the above code.

Is MAX_FRAME_SIZE_PER_DESC equal to the endpoint size ?

In your callback function to do you continously get the
same error reported in the the call to usbd_urb_status() ?



: "Peter" <nospam@nospam.at.all> a écrit dans le message news:
: b5cbel$mn9$1@inn.qnx.com...
: > have a look to the mouse_parse_descriptors() in the DDK mouse
example.
: > to get/test the endpoint number use ep = bEndpointAddress & 0xF.
:
: > "Hercot Jean-Yves" <fa063821@skynet.be> schrieb im Newsbeitrag
: > news:b5ajj2$n6o$1@inn.qnx.com...
: > > I have tried and it doesn't work :-(.
:
: > > I have checked my code with Peter's one and it seems similar.
When
I
: > setup
: > > an isochronous I receive the callback (even if I don't enable
Isoch
: > > transfers on the cam) but the urb_status is set to 0x02040932.
:
: > > The results of usb -vvv seems correct and the cam works well
under
: windows
: > > on the same computer.
:
: > > I have noticed that the value returned by usbd_pipe_endpoint is
0
for
: the
: > > control pipe and 129 for the Isoch/in pipe (it should be 1). It
also
: > > returns 129 with the other alternate settings.
:
: > > Help me!!!! :-p
:
: > > "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message
news:
: > > b5abul$f7k$1@inn.qnx.com...
: > > > Henry > I'll test all you have said about the isochronous
transfers.
: > I'll
: > > > post my question here if it doesn't work... ;-)
:
: > > > Thanx

[snip]




Henry Van Dyke

Re: Isochronous transfers

Post by Henry Van Dyke » Fri Mar 21, 2003 3:55 pm

Hercot Jean-Yves (fa063821@skynet.be) wrote:
: I find out something... I explain.

: I was doing that in the insertion callback:

: usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: ce.iface,7,&nod);

: Now I have written that and put the buffer size to 0 (size for alternate 0):

: inter =
: usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: ce.iface,spca->instance.alternate,&nod)

: And after that status look like: 0x02000005

: I think it means the device doesn't respond. Perhaps because of packet size
: 0...

: Could you tell me how to do to get the alternate 7 properly?

have you done a :

usbd_select_interface( spca->ptrdevice, spca->instance.iface, 7 );


: "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message news:
: b5d5ff$ltm$1@inn.qnx.com...
: > > Have you initialized the camera to get it start
: > > capturing frames.
: >
: > Yes. But I also receive the call back if I don't initialize the camera to
: > get it start capturing frames. :-s
: >
: > > Is MAX_FRAME_SIZE_PER_DESC equal to the >endpoint size ?
: >
: > Yes. 1023 exactly.
: >
: > > In your callback function to do you continously get the
: > > same error reported in the the call to usbd_urb_status() ?
: >
: > Always the same status : 0x02040932
: >
: > Tomorrow I'll try the webcam on an other computer to see if status keeps
: the
: > same value.
: >
: > But I can say I'am sure it is not a hardware problem because the cam works
: > very well under windows....
: >
: > "Henry Van Dyke" <henry@93.com> a écrit dans le message news:
: > b5d5g7$j2n$1@nntp.qnx.com...
: > > Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > > : > have a look to the mouse_parse_descriptors() in the DDK mouse
: example.
: > > : > to get/test the endpoint number use ep = bEndpointAddress & 0xF.
: > >
: > > : I get the correct value :-) (1)
: > >
: > > : >What USB controller chip are you running on.
: > >
: > > : VIA VT83C572
: > >
: > > : +
: > >
: > > : Opti 82C861 Firelink (Pci-to-usb bridge)
: > >
: > > : >Could you post code snippets of where you are
: > > : >enqueuing the urbs ?
: > >
: > > : spca->urbIso = usbd_alloc_urb(NULL);
: > > : spca->frameBuffer = usbd_alloc(MAX_FRAME_SIZE_PER_DESC);
: > > : error =
: > > :
: >
: usbd_setup_isochronous(spca->urbIso,URB_DIR_IN|URB_ISOCH_ASAP,0,spca->frameB
: > > : uffer,MAX_FRAME_SIZE_PER_DESC);
: > > : if (error)
: > > : {
: > > : printf("usbd_setup_isochronous error: %d\n",error);
: > > : }
: > > : else
: > > : printf("usbd_setup_isochronous ok\n");
: > > : error =
: > > : usbd_io(spca->urbIso,spca->IsoPipe,isoc_irq,spca,USBD_TIME_INFINITY);
: > > : if (error)
: > > : {
: > > : printf("usbd_io error: %d\n",error);
: > > : }
: > >
: > > : --> the pipe is correctly initialized I think.
: > >
: > >
: > > Have you initialized the camera to get it start
: > > capturing frames.
: > >
: > > I can't see anything obviously wrong with the above code.
: > >
: > > Is MAX_FRAME_SIZE_PER_DESC equal to the endpoint size ?
: > >
: > > In your callback function to do you continously get the
: > > same error reported in the the call to usbd_urb_status() ?
: > >
: > >
: > >
: > > : "Peter" <nospam@nospam.at.all> a écrit dans le message news:
: > > : b5cbel$mn9$1@inn.qnx.com...
: > > : > have a look to the mouse_parse_descriptors() in the DDK mouse
: example.
: > > : > to get/test the endpoint number use ep = bEndpointAddress & 0xF.
: > > : >
: > > : > "Hercot Jean-Yves" <fa063821@skynet.be> schrieb im Newsbeitrag
: > > : > news:b5ajj2$n6o$1@inn.qnx.com...
: > > : > > I have tried and it doesn't work :-(.
: > > : > >
: > > : > > I have checked my code with Peter's one and it seems similar.
: When
: > I
: > > : > setup
: > > : > > an isochronous I receive the callback (even if I don't enable
: Isoch
: > > : > > transfers on the cam) but the urb_status is set to 0x02040932.
: > > : > >
: > > : > > The results of usb -vvv seems correct and the cam works well under
: > > : windows
: > > : > > on the same computer.
: > > : > >
: > > : > > I have noticed that the value returned by usbd_pipe_endpoint is 0
: > for
: > > : the
: > > : > > control pipe and 129 for the Isoch/in pipe (it should be 1). It
: > also
: > > : > > returns 129 with the other alternate settings.
: > > : > >
: > > : > > Help me!!!! :-p
: > > : > >
: > > : > > "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message
: > news:
: > > : > > b5abul$f7k$1@inn.qnx.com...
: > > : > > > Henry > I'll test all you have said about the isochronous
: > transfers.
: > > : > I'll
: > > : > > > post my question here if it doesn't work... ;-)
: > > : > > >
: > > : > > > Thanx
: > >
: > > [snip]
: > >
: >
: >

Hercot Jean-Yves

Re: Isochronous transfers

Post by Hercot Jean-Yves » Fri Mar 21, 2003 4:33 pm

have you done a :

usbd_select_interface( spca->ptrdevice, spca->instance.iface, 7 );
I don't think I have done that. :-) This time it should be allright. I'll
test it immediatly and give you feedback as soon as possible.

Thanks


"Henry Van Dyke" <henry@93.com> a écrit dans le message news:
b5fcl3$2oq$1@nntp.qnx.com...
Hercot Jean-Yves (fa063821@skynet.be) wrote:
: I find out something... I explain.

: I was doing that in the insertion callback:

:
usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: ce.iface,7,&nod);

: Now I have written that and put the buffer size to 0 (size for alternate
0):

: inter =
:
usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: ce.iface,spca->instance.alternate,&nod)

: And after that status look like: 0x02000005

: I think it means the device doesn't respond. Perhaps because of packet
size
: 0...

: Could you tell me how to do to get the alternate 7 properly?

have you done a :

usbd_select_interface( spca->ptrdevice, spca->instance.iface, 7 );


: "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message news:
: b5d5ff$ltm$1@inn.qnx.com...
: > > Have you initialized the camera to get it start
: > > capturing frames.
:
: > Yes. But I also receive the call back if I don't initialize the
camera to
: > get it start capturing frames. :-s
:
: > > Is MAX_FRAME_SIZE_PER_DESC equal to the >endpoint size ?
:
: > Yes. 1023 exactly.
:
: > > In your callback function to do you continously get the
: > > same error reported in the the call to usbd_urb_status() ?
:
: > Always the same status : 0x02040932
:
: > Tomorrow I'll try the webcam on an other computer to see if status
keeps
: the
: > same value.
:
: > But I can say I'am sure it is not a hardware problem because the cam
works
: > very well under windows....
:
: > "Henry Van Dyke" <henry@93.com> a écrit dans le message news:
: > b5d5g7$j2n$1@nntp.qnx.com...
: > > Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > > : > have a look to the mouse_parse_descriptors() in the DDK mouse
: example.
: > > : > to get/test the endpoint number use ep = bEndpointAddress & 0xF.
:
: > > : I get the correct value :-) (1)
:
: > > : >What USB controller chip are you running on.
:
: > > : VIA VT83C572
:
: > > : +
:
: > > : Opti 82C861 Firelink (Pci-to-usb bridge)
:
: > > : >Could you post code snippets of where you are
: > > : >enqueuing the urbs ?
:
: > > : spca->urbIso = usbd_alloc_urb(NULL);
: > > : spca->frameBuffer = usbd_alloc(MAX_FRAME_SIZE_PER_DESC);
: > > : error =
: > > :
:
:
usbd_setup_isochronous(spca->urbIso,URB_DIR_IN|URB_ISOCH_ASAP,0,spca->frameB
: > > : uffer,MAX_FRAME_SIZE_PER_DESC);
: > > : if (error)
: > > : {
: > > : printf("usbd_setup_isochronous error: %d\n",error);
: > > : }
: > > : else
: > > : printf("usbd_setup_isochronous ok\n");
: > > : error =
: > > :
usbd_io(spca->urbIso,spca->IsoPipe,isoc_irq,spca,USBD_TIME_INFINITY);
: > > : if (error)
: > > : {
: > > : printf("usbd_io error: %d\n",error);
: > > : }
:
: > > : --> the pipe is correctly initialized I think.
:
:
: > > Have you initialized the camera to get it start
: > > capturing frames.
:
: > > I can't see anything obviously wrong with the above code.
:
: > > Is MAX_FRAME_SIZE_PER_DESC equal to the endpoint size ?
:
: > > In your callback function to do you continously get the
: > > same error reported in the the call to usbd_urb_status() ?
:
:
:
: > > : "Peter" <nospam@nospam.at.all> a écrit dans le message news:
: > > : b5cbel$mn9$1@inn.qnx.com...
: > > : > have a look to the mouse_parse_descriptors() in the DDK mouse
: example.
: > > : > to get/test the endpoint number use ep = bEndpointAddress & 0xF.
: > > :
: > > : > "Hercot Jean-Yves" <fa063821@skynet.be> schrieb im Newsbeitrag
: > > : > news:b5ajj2$n6o$1@inn.qnx.com...
: > > : > > I have tried and it doesn't work :-(.
: > > :
: > > : > > I have checked my code with Peter's one and it seems similar.
: When
: > I
: > > : > setup
: > > : > > an isochronous I receive the callback (even if I don't enable
: Isoch
: > > : > > transfers on the cam) but the urb_status is set to 0x02040932.
: > > :
: > > : > > The results of usb -vvv seems correct and the cam works well
under
: > > : windows
: > > : > > on the same computer.
: > > :
: > > : > > I have noticed that the value returned by usbd_pipe_endpoint
is 0
: > for
: > > : the
: > > : > > control pipe and 129 for the Isoch/in pipe (it should be 1).
It
: > also
: > > : > > returns 129 with the other alternate settings.
: > > :
: > > : > > Help me!!!! :-p
: > > :
: > > : > > "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le
message
: > news:
: > > : > > b5abul$f7k$1@inn.qnx.com...
: > > : > > > Henry > I'll test all you have said about the isochronous
: > transfers.
: > > : > I'll
: > > : > > > post my question here if it doesn't work... ;-)
: > > :
: > > : > > > Thanx
:
: > > [snip]
:
:
:

Hercot Jean-Yves

Re: Isochronous transfers

Post by Hercot Jean-Yves » Fri Mar 21, 2003 5:28 pm

I have put the usbd_select_interface and now usbd_io returns error 3.

Is it bad doctor?

"Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message news:
b5fdn3$9r2$1@inn.qnx.com...
have you done a :

usbd_select_interface( spca->ptrdevice, spca->instance.iface, 7 );

I don't think I have done that. :-) This time it should be allright.
I'll
test it immediatly and give you feedback as soon as possible.

Thanks


"Henry Van Dyke" <henry@93.com> a écrit dans le message news:
b5fcl3$2oq$1@nntp.qnx.com...
Hercot Jean-Yves (fa063821@skynet.be) wrote:
: I find out something... I explain.

: I was doing that in the insertion callback:

:

usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: ce.iface,7,&nod);

: Now I have written that and put the buffer size to 0 (size for
alternate
0):

: inter =
:

usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: ce.iface,spca->instance.alternate,&nod)

: And after that status look like: 0x02000005

: I think it means the device doesn't respond. Perhaps because of
packet
size
: 0...

: Could you tell me how to do to get the alternate 7 properly?

have you done a :

usbd_select_interface( spca->ptrdevice, spca->instance.iface, 7 );


: "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message news:
: b5d5ff$ltm$1@inn.qnx.com...
: > > Have you initialized the camera to get it start
: > > capturing frames.
:
: > Yes. But I also receive the call back if I don't initialize the
camera to
: > get it start capturing frames. :-s
:
: > > Is MAX_FRAME_SIZE_PER_DESC equal to the >endpoint size ?
:
: > Yes. 1023 exactly.
:
: > > In your callback function to do you continously get the
: > > same error reported in the the call to usbd_urb_status() ?
:
: > Always the same status : 0x02040932
:
: > Tomorrow I'll try the webcam on an other computer to see if status
keeps
: the
: > same value.
:
: > But I can say I'am sure it is not a hardware problem because the cam
works
: > very well under windows....
:
: > "Henry Van Dyke" <henry@93.com> a écrit dans le message news:
: > b5d5g7$j2n$1@nntp.qnx.com...
: > > Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > > : > have a look to the mouse_parse_descriptors() in the DDK mouse
: example.
: > > : > to get/test the endpoint number use ep = bEndpointAddress &
0xF.
:
: > > : I get the correct value :-) (1)
:
: > > : >What USB controller chip are you running on.
:
: > > : VIA VT83C572
:
: > > : +
:
: > > : Opti 82C861 Firelink (Pci-to-usb bridge)
:
: > > : >Could you post code snippets of where you are
: > > : >enqueuing the urbs ?
:
: > > : spca->urbIso = usbd_alloc_urb(NULL);
: > > : spca->frameBuffer = usbd_alloc(MAX_FRAME_SIZE_PER_DESC);
: > > : error =
: > > :
:
:

usbd_setup_isochronous(spca->urbIso,URB_DIR_IN|URB_ISOCH_ASAP,0,spca->frameB
: > > : uffer,MAX_FRAME_SIZE_PER_DESC);
: > > : if (error)
: > > : {
: > > : printf("usbd_setup_isochronous error: %d\n",error);
: > > : }
: > > : else
: > > : printf("usbd_setup_isochronous ok\n");
: > > : error =
: > > :
usbd_io(spca->urbIso,spca->IsoPipe,isoc_irq,spca,USBD_TIME_INFINITY);
: > > : if (error)
: > > : {
: > > : printf("usbd_io error: %d\n",error);
: > > : }
:
: > > : --> the pipe is correctly initialized I think.
:
:
: > > Have you initialized the camera to get it start
: > > capturing frames.
:
: > > I can't see anything obviously wrong with the above code.
:
: > > Is MAX_FRAME_SIZE_PER_DESC equal to the endpoint size ?
:
: > > In your callback function to do you continously get the
: > > same error reported in the the call to usbd_urb_status() ?
:
:
:
: > > : "Peter" <nospam@nospam.at.all> a écrit dans le message news:
: > > : b5cbel$mn9$1@inn.qnx.com...
: > > : > have a look to the mouse_parse_descriptors() in the DDK mouse
: example.
: > > : > to get/test the endpoint number use ep = bEndpointAddress &
0xF.
: > > :
: > > : > "Hercot Jean-Yves" <fa063821@skynet.be> schrieb im Newsbeitrag
: > > : > news:b5ajj2$n6o$1@inn.qnx.com...
: > > : > > I have tried and it doesn't work :-(.
: > > :
: > > : > > I have checked my code with Peter's one and it seems
similar.
: When
: > I
: > > : > setup
: > > : > > an isochronous I receive the callback (even if I don't
enable
: Isoch
: > > : > > transfers on the cam) but the urb_status is set to
0x02040932.
: > > :
: > > : > > The results of usb -vvv seems correct and the cam works well
under
: > > : windows
: > > : > > on the same computer.
: > > :
: > > : > > I have noticed that the value returned by usbd_pipe_endpoint
is 0
: > for
: > > : the
: > > : > > control pipe and 129 for the Isoch/in pipe (it should be 1).
It
: > also
: > > : > > returns 129 with the other alternate settings.
: > > :
: > > : > > Help me!!!! :-p
: > > :
: > > : > > "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le
message
: > news:
: > > : > > b5abul$f7k$1@inn.qnx.com...
: > > : > > > Henry > I'll test all you have said about the isochronous
: > transfers.
: > > : > I'll
: > > : > > > post my question here if it doesn't work... ;-)
: > > :
: > > : > > > Thanx
:
: > > [snip]
:
:
:



Henry Van Dyke

Re: Isochronous transfers

Post by Henry Van Dyke » Fri Mar 21, 2003 6:33 pm

Hercot Jean-Yves (fa063821@skynet.be) wrote:
: I have put the usbd_select_interface and now usbd_io returns error 3.

Ok. Is the USB stack still running after you get this error.


The pipes you open and pass to usbdi_io are valid endpoints
on the this selected interface/alternate right ?

Could you post the source your insertion callback function


: Is it bad doctor?

: "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message news:
: b5fdn3$9r2$1@inn.qnx.com...
: > > have you done a :
: > >
: > > usbd_select_interface( spca->ptrdevice, spca->instance.iface, 7 );
: >
: > I don't think I have done that. :-) This time it should be allright.
: I'll
: > test it immediatly and give you feedback as soon as possible.
: >
: > Thanks
: >
: >
: > "Henry Van Dyke" <henry@93.com> a écrit dans le message news:
: > b5fcl3$2oq$1@nntp.qnx.com...
: > > Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > > : I find out something... I explain.
: > >
: > > : I was doing that in the insertion callback:
: > >
: > > :
: >
: usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: > > : ce.iface,7,&nod);
: > >
: > > : Now I have written that and put the buffer size to 0 (size for
: alternate
: > 0):
: > >
: > > : inter =
: > > :
: >
: usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: > > : ce.iface,spca->instance.alternate,&nod)
: > >
: > > : And after that status look like: 0x02000005
: > >
: > > : I think it means the device doesn't respond. Perhaps because of
: packet
: > size
: > > : 0...
: > >
: > > : Could you tell me how to do to get the alternate 7 properly?
: > >
: > > have you done a :
: > >
: > > usbd_select_interface( spca->ptrdevice, spca->instance.iface, 7 );
: > >
: > >
: > > : "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message news:
: > > : b5d5ff$ltm$1@inn.qnx.com...
: > > : > > Have you initialized the camera to get it start
: > > : > > capturing frames.
: > > : >
: > > : > Yes. But I also receive the call back if I don't initialize the
: > camera to
: > > : > get it start capturing frames. :-s
: > > : >
: > > : > > Is MAX_FRAME_SIZE_PER_DESC equal to the >endpoint size ?
: > > : >
: > > : > Yes. 1023 exactly.
: > > : >
: > > : > > In your callback function to do you continously get the
: > > : > > same error reported in the the call to usbd_urb_status() ?
: > > : >
: > > : > Always the same status : 0x02040932
: > > : >
: > > : > Tomorrow I'll try the webcam on an other computer to see if status
: > keeps
: > > : the
: > > : > same value.
: > > : >
: > > : > But I can say I'am sure it is not a hardware problem because the cam
: > works
: > > : > very well under windows....
: > > : >
: > > : > "Henry Van Dyke" <henry@93.com> a écrit dans le message news:
: > > : > b5d5g7$j2n$1@nntp.qnx.com...
: > > : > > Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > > : > > : > have a look to the mouse_parse_descriptors() in the DDK mouse
: > > : example.
: > > : > > : > to get/test the endpoint number use ep = bEndpointAddress &
: 0xF.
: > > : > >
: > > : > > : I get the correct value :-) (1)
: > > : > >
: > > : > > : >What USB controller chip are you running on.
: > > : > >
: > > : > > : VIA VT83C572
: > > : > >
: > > : > > : +
: > > : > >
: > > : > > : Opti 82C861 Firelink (Pci-to-usb bridge)
: > > : > >
: > > : > > : >Could you post code snippets of where you are
: > > : > > : >enqueuing the urbs ?
: > > : > >
: > > : > > : spca->urbIso = usbd_alloc_urb(NULL);
: > > : > > : spca->frameBuffer = usbd_alloc(MAX_FRAME_SIZE_PER_DESC);
: > > : > > : error =
: > > : > > :
: > > : >
: > > :
: >
: usbd_setup_isochronous(spca->urbIso,URB_DIR_IN|URB_ISOCH_ASAP,0,spca->frameB
: > > : > > : uffer,MAX_FRAME_SIZE_PER_DESC);
: > > : > > : if (error)
: > > : > > : {
: > > : > > : printf("usbd_setup_isochronous error: %d\n",error);
: > > : > > : }
: > > : > > : else
: > > : > > : printf("usbd_setup_isochronous ok\n");
: > > : > > : error =
: > > : > > :
: > usbd_io(spca->urbIso,spca->IsoPipe,isoc_irq,spca,USBD_TIME_INFINITY);
: > > : > > : if (error)
: > > : > > : {
: > > : > > : printf("usbd_io error: %d\n",error);
: > > : > > : }
: > > : > >
: > > : > > : --> the pipe is correctly initialized I think.
: > > : > >
: > > : > >
: > > : > > Have you initialized the camera to get it start
: > > : > > capturing frames.
: > > : > >
: > > : > > I can't see anything obviously wrong with the above code.
: > > : > >
: > > : > > Is MAX_FRAME_SIZE_PER_DESC equal to the endpoint size ?
: > > : > >
: > > : > > In your callback function to do you continously get the
: > > : > > same error reported in the the call to usbd_urb_status() ?
: > > : > >
: > > : > >
: > > : > >
: > > : > > : "Peter" <nospam@nospam.at.all> a écrit dans le message news:
: > > : > > : b5cbel$mn9$1@inn.qnx.com...
: > > : > > : > have a look to the mouse_parse_descriptors() in the DDK mouse
: > > : example.
: > > : > > : > to get/test the endpoint number use ep = bEndpointAddress &
: 0xF.
: > > : > > : >
: > > : > > : > "Hercot Jean-Yves" <fa063821@skynet.be> schrieb im Newsbeitrag
: > > : > > : > news:b5ajj2$n6o$1@inn.qnx.com...
: > > : > > : > > I have tried and it doesn't work :-(.
: > > : > > : > >
: > > : > > : > > I have checked my code with Peter's one and it seems
: similar.
: > > : When
: > > : > I
: > > : > > : > setup
: > > : > > : > > an isochronous I receive the callback (even if I don't
: enable
: > > : Isoch
: > > : > > : > > transfers on the cam) but the urb_status is set to
: 0x02040932.
: > > : > > : > >
: > > : > > : > > The results of usb -vvv seems correct and the cam works well
: > under
: > > : > > : windows
: > > : > > : > > on the same computer.
: > > : > > : > >
: > > : > > : > > I have noticed that the value returned by usbd_pipe_endpoint
: > is 0
: > > : > for
: > > : > > : the
: > > : > > : > > control pipe and 129 for the Isoch/in pipe (it should be 1).
: > It
: > > : > also
: > > : > > : > > returns 129 with the other alternate settings.
: > > : > > : > >
: > > : > > : > > Help me!!!! :-p
: > > : > > : > >
: > > : > > : > > "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le
: > message
: > > : > news:
: > > : > > : > > b5abul$f7k$1@inn.qnx.com...
: > > : > > : > > > Henry > I'll test all you have said about the isochronous
: > > : > transfers.
: > > : > > : > I'll
: > > : > > : > > > post my question here if it doesn't work... ;-)
: > > : > > : > > >
: > > : > > : > > > Thanx
: > > : > >
: > > : > > [snip]
: > > : > >
: > > : >
: > > : >
: > >
: > >
: >
: >

Hercot Jean-Yves

Re: Isochronous transfers

Post by Hercot Jean-Yves » Sat Mar 22, 2003 10:28 pm

Ok. Is the USB stack still running after you get this error.
Yes
The pipes you open and pass to usbdi_io are valid endpoints
on the this selected interface/alternate right ?
Yes I have checked the fields of the structures. All values seem correct.
Could you post the source your insertion callback function
Here is:

void insertion(struct usbd_connection *connection, usbd_device_instance_t
*instance)
{
int eix = 0,error = 0;
usbd_interface_descriptor_t *inter;
struct usbd_device *device;
struct usbd_desc_node *nod;
printf("Insertion callback!\n");
if (!attached)
{
/* S'attache au device SPCA508A */
error = usbd_attach(connection,instance,sizeof(struct
usb_spca508),&device);
if (error)
printf("usbd_attach error: %d\n",error);
else
{
printf("usbd_attach ok\n");
spca = usbd_device_extra(device);
spca->ptrdevice = device;
spca->instance = *instance;
printf("Alternate = %d\n",spca->instance.alternate);
/* Recuperer le descripteur de l interface */
error = usbd_select_interface(spca->ptrdevice,spca->instance.iface,7);
if (error)
printf("usbd_select_interface error: %d\n",error);
inter =
usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
ce.iface,spca->instance.alternate,&nod);
if (inter)
printf("Num = %d , Alt =
%d\n",inter->bInterfaceNumber,inter->bAlternateSetting);
/* Parcourir les descripteurs de device */
usb_descriptor = (usbd_descriptors_t*)1;
while (usb_descriptor != NULL)
{
usb_descriptor =
usbd_parse_descriptors(spca->ptrdevice,nod,USB_DESC_ENDPOINT,eix,&usb_desc_n
ode);
if (usb_descriptor)
{
printf("Maxsize = %d\n",usb_descriptor->endpoint.wMaxPacketSize);
printf("Attributes = %d\n",usb_descriptor->endpoint.bmAttributes);
printf("Endpoint = %x\n",usb_descriptor->endpoint.bEndpointAddress &
0xF);
switch(usb_descriptor->endpoint.bmAttributes)
{
case USB_ATTRIB_CONTROL:
printf("Ctrl\n");
error =
usbd_open_pipe(spca->ptrdevice,usb_descriptor,&(spca->CtrlPipe));
if (error)
printf("usbd_open_pipe error:
%d\n",error);
printf("Endpoint =
%x\n",usbd_pipe_endpoint(spca->CtrlPipe));
break;
case USB_ATTRIB_ISOCHRONOUS:
printf("Iso\n");
error =
usbd_open_pipe(spca->ptrdevice,usb_descriptor,&(spca->IsoPipe));
if (error)
printf("usbd_open_pipe error:
%d\n",error);
printf("Endpoint =
%x\n",usbd_pipe_endpoint(spca->IsoPipe));
break;
}
}
eix++;
}

config_spca508(spca);

/* Set_mode */
set_mode(spca,0,ext_modes);

spca->urbIso = usbd_alloc_urb(NULL);
spca->frameBuffer = usbd_alloc(MAX_FRAME_SIZE_PER_DESC);

/* activer video ISO et drop packet */

reg_write(spca, 0, 0x8112, 0x20 | 0x10);

error =
usbd_setup_isochronous(spca->urbIso,URB_DIR_IN|URB_ISOCH_ASAP,0,spca->frameB
uffer,MAX_FRAME_SIZE_PER_DESC);
if (error)
{
printf("usbd_setup_isochronous error: %d\n",error);
}
else
printf("usbd_setup_isochronous ok\n");
error =
usbd_io(spca->urbIso,spca>IsoPipe,isoc_irq,spca,USBD_TIME_INFINITY);
if (error)
{
printf("usbd_io error: %d\n",error);
}
else
printf("usbd_io ok\n");
}
}
}

The few comments are in french (sorry) but they are not very helpfull... ;-p

Peter > Do you only access to the Usb bridge of the cam or do you also have
to configure the sensor?


"Henry Van Dyke" <henry@93.com> a écrit dans le message news:
b5flt2$8ml$1@nntp.qnx.com...
Hercot Jean-Yves (fa063821@skynet.be) wrote:
: I have put the usbd_select_interface and now usbd_io returns error 3.



The pipes you open and pass to usbdi_io are valid endpoints
on the this selected interface/alternate right ?

Could you post the source your insertion callback function


: Is it bad doctor?

: "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message news:
: b5fdn3$9r2$1@inn.qnx.com...
: > > have you done a :
:
: > > usbd_select_interface( spca->ptrdevice, spca->instance.iface, 7 );
:
: > I don't think I have done that. :-) This time it should be allright.
: I'll
: > test it immediatly and give you feedback as soon as possible.
:
: > Thanks
:
:
: > "Henry Van Dyke" <henry@93.com> a écrit dans le message news:
: > b5fcl3$2oq$1@nntp.qnx.com...
: > > Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > > : I find out something... I explain.
:
: > > : I was doing that in the insertion callback:
:
: > > :
:
:
usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: > > : ce.iface,7,&nod);
:
: > > : Now I have written that and put the buffer size to 0 (size for
: alternate
: > 0):
:
: > > : inter =
: > > :
:
:
usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: > > : ce.iface,spca->instance.alternate,&nod)
:
: > > : And after that status look like: 0x02000005
:
: > > : I think it means the device doesn't respond. Perhaps because of
: packet
: > size
: > > : 0...
:
: > > : Could you tell me how to do to get the alternate 7 properly?
:
: > > have you done a :
:
: > > usbd_select_interface( spca->ptrdevice, spca->instance.iface, 7 );
:
:
: > > : "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message
news:
: > > : b5d5ff$ltm$1@inn.qnx.com...
: > > : > > Have you initialized the camera to get it start
: > > : > > capturing frames.
: > > :
: > > : > Yes. But I also receive the call back if I don't initialize the
: > camera to
: > > : > get it start capturing frames. :-s
: > > :
: > > : > > Is MAX_FRAME_SIZE_PER_DESC equal to the >endpoint size ?
: > > :
: > > : > Yes. 1023 exactly.
: > > :
: > > : > > In your callback function to do you continously get the
: > > : > > same error reported in the the call to usbd_urb_status() ?
: > > :
: > > : > Always the same status : 0x02040932
: > > :
: > > : > Tomorrow I'll try the webcam on an other computer to see if
status
: > keeps
: > > : the
: > > : > same value.
: > > :
: > > : > But I can say I'am sure it is not a hardware problem because the
cam
: > works
: > > : > very well under windows....
: > > :
: > > : > "Henry Van Dyke" <henry@93.com> a écrit dans le message news:
: > > : > b5d5g7$j2n$1@nntp.qnx.com...
: > > : > > Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > > : > > : > have a look to the mouse_parse_descriptors() in the DDK
mouse
: > > : example.
: > > : > > : > to get/test the endpoint number use ep = bEndpointAddress
&
: 0xF.
: > > :
: > > : > > : I get the correct value :-) (1)
: > > :
: > > : > > : >What USB controller chip are you running on.
: > > :
: > > : > > : VIA VT83C572
: > > :
: > > : > > : +
: > > :
: > > : > > : Opti 82C861 Firelink (Pci-to-usb bridge)
: > > :
: > > : > > : >Could you post code snippets of where you are
: > > : > > : >enqueuing the urbs ?
: > > :
: > > : > > : spca->urbIso = usbd_alloc_urb(NULL);
: > > : > > : spca->frameBuffer = usbd_alloc(MAX_FRAME_SIZE_PER_DESC);
: > > : > > : error =
: > > : > > :
: > > :
: > > :
:
:
usbd_setup_isochronous(spca->urbIso,URB_DIR_IN|URB_ISOCH_ASAP,0,spca->frameB
: > > : > > : uffer,MAX_FRAME_SIZE_PER_DESC);
: > > : > > : if (error)
: > > : > > : {
: > > : > > : printf("usbd_setup_isochronous error: %d\n",error);
: > > : > > : }
: > > : > > : else
: > > : > > : printf("usbd_setup_isochronous ok\n");
: > > : > > : error =
: > > : > > :
: > usbd_io(spca->urbIso,spca->IsoPipe,isoc_irq,spca,USBD_TIME_INFINITY);
: > > : > > : if (error)
: > > : > > : {
: > > : > > : printf("usbd_io error: %d\n",error);
: > > : > > : }
: > > :
: > > : > > : --> the pipe is correctly initialized I think.
: > > :
: > > :
: > > : > > Have you initialized the camera to get it start
: > > : > > capturing frames.
: > > :
: > > : > > I can't see anything obviously wrong with the above code.
: > > :
: > > : > > Is MAX_FRAME_SIZE_PER_DESC equal to the endpoint size ?
: > > :
: > > : > > In your callback function to do you continously get the
: > > : > > same error reported in the the call to usbd_urb_status() ?
: > > :
: > > :
: > > :
: > > : > > : "Peter" <nospam@nospam.at.all> a écrit dans le message news:
: > > : > > : b5cbel$mn9$1@inn.qnx.com...
: > > : > > : > have a look to the mouse_parse_descriptors() in the DDK
mouse
: > > : example.
: > > : > > : > to get/test the endpoint number use ep = bEndpointAddress
&
: 0xF.
: > > : > > :
: > > : > > : > "Hercot Jean-Yves" <fa063821@skynet.be> schrieb im
Newsbeitrag
: > > : > > : > news:b5ajj2$n6o$1@inn.qnx.com...
: > > : > > : > > I have tried and it doesn't work :-(.
: > > : > > :
: > > : > > : > > I have checked my code with Peter's one and it seems
: similar.
: > > : When
: > > : > I
: > > : > > : > setup
: > > : > > : > > an isochronous I receive the callback (even if I don't
: enable
: > > : Isoch
: > > : > > : > > transfers on the cam) but the urb_status is set to
: 0x02040932.
: > > : > > :
: > > : > > : > > The results of usb -vvv seems correct and the cam works
well
: > under
: > > : > > : windows
: > > : > > : > > on the same computer.
: > > : > > :
: > > : > > : > > I have noticed that the value returned by
usbd_pipe_endpoint
: > is 0
: > > : > for
: > > : > > : the
: > > : > > : > > control pipe and 129 for the Isoch/in pipe (it should be
1).
: > It
: > > : > also
: > > : > > : > > returns 129 with the other alternate settings.
: > > : > > :
: > > : > > : > > Help me!!!! :-p
: > > : > > :
: > > : > > : > > "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le
: > message
: > > : > news:
: > > : > > : > > b5abul$f7k$1@inn.qnx.com...
: > > : > > : > > > Henry > I'll test all you have said about the
isochronous
: > > : > transfers.
: > > : > > : > I'll
: > > : > > : > > > post my question here if it doesn't work... ;-)
: > > : > > :
: > > : > > : > > > Thanx
: > > :
: > > : > > [snip]
: > > :
: > > :
: > > :
:
:
:
:

Henry Van Dyke

Re: Isochronous transfers

Post by Henry Van Dyke » Tue Mar 25, 2003 1:04 pm

can you post the output from 'usb -vvvvv' for the device.


Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > Ok. Is the USB stack still running after you get this error.>

: Yes

: > The pipes you open and pass to usbdi_io are valid endpoints
: > on the this selected interface/alternate right ?

: Yes I have checked the fields of the structures. All values seem correct.

: > Could you post the source your insertion callback function

: Here is:

: void insertion(struct usbd_connection *connection, usbd_device_instance_t
: *instance)
: {
: int eix = 0,error = 0;
: usbd_interface_descriptor_t *inter;
: struct usbd_device *device;
: struct usbd_desc_node *nod;
: printf("Insertion callback!\n");
: if (!attached)
: {
: /* S'attache au device SPCA508A */
: error = usbd_attach(connection,instance,sizeof(struct
: usb_spca508),&device);
: if (error)
: printf("usbd_attach error: %d\n",error);
: else
: {
: printf("usbd_attach ok\n");
: spca = usbd_device_extra(device);
: spca->ptrdevice = device;
: spca->instance = *instance;
: printf("Alternate = %d\n",spca->instance.alternate);
: /* Recuperer le descripteur de l interface */
: error = usbd_select_interface(spca->ptrdevice,spca->instance.iface,7);
: if (error)
: printf("usbd_select_interface error: %d\n",error);
: inter =
: usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: ce.iface,spca->instance.alternate,&nod);
: if (inter)
: printf("Num = %d , Alt =
: %d\n",inter->bInterfaceNumber,inter->bAlternateSetting);
: /* Parcourir les descripteurs de device */
: usb_descriptor = (usbd_descriptors_t*)1;
: while (usb_descriptor != NULL)
: {
: usb_descriptor =
: usbd_parse_descriptors(spca->ptrdevice,nod,USB_DESC_ENDPOINT,eix,&usb_desc_n
: ode);
: if (usb_descriptor)
: {
: printf("Maxsize = %d\n",usb_descriptor->endpoint.wMaxPacketSize);
: printf("Attributes = %d\n",usb_descriptor->endpoint.bmAttributes);
: printf("Endpoint = %x\n",usb_descriptor->endpoint.bEndpointAddress &
: 0xF);
: switch(usb_descriptor->endpoint.bmAttributes)
: {
: case USB_ATTRIB_CONTROL:
: printf("Ctrl\n");
: error =
: usbd_open_pipe(spca->ptrdevice,usb_descriptor,&(spca->CtrlPipe));
: if (error)
: printf("usbd_open_pipe error:
: %d\n",error);
: printf("Endpoint =
: %x\n",usbd_pipe_endpoint(spca->CtrlPipe));
: break;
: case USB_ATTRIB_ISOCHRONOUS:
: printf("Iso\n");
: error =
: usbd_open_pipe(spca->ptrdevice,usb_descriptor,&(spca->IsoPipe));
: if (error)
: printf("usbd_open_pipe error:
: %d\n",error);
: printf("Endpoint =
: %x\n",usbd_pipe_endpoint(spca->IsoPipe));
: break;
: }
: }
: eix++;
: }

: config_spca508(spca);

: /* Set_mode */
: set_mode(spca,0,ext_modes);

: spca->urbIso = usbd_alloc_urb(NULL);
: spca->frameBuffer = usbd_alloc(MAX_FRAME_SIZE_PER_DESC);

: /* activer video ISO et drop packet */

: reg_write(spca, 0, 0x8112, 0x20 | 0x10);

: error =
: usbd_setup_isochronous(spca->urbIso,URB_DIR_IN|URB_ISOCH_ASAP,0,spca->frameB
: uffer,MAX_FRAME_SIZE_PER_DESC);
: if (error)
: {
: printf("usbd_setup_isochronous error: %d\n",error);
: }
: else
: printf("usbd_setup_isochronous ok\n");
: error =
: usbd_io(spca->urbIso,spca>IsoPipe,isoc_irq,spca,USBD_TIME_INFINITY);
: if (error)
: {
: printf("usbd_io error: %d\n",error);
: }
: else
: printf("usbd_io ok\n");
: }
: }
: }

: The few comments are in french (sorry) but they are not very helpfull... ;-p

: Peter > Do you only access to the Usb bridge of the cam or do you also have
: to configure the sensor?


: "Henry Van Dyke" <henry@93.com> a écrit dans le message news:
: b5flt2$8ml$1@nntp.qnx.com...
: > Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > : I have put the usbd_select_interface and now usbd_io returns error 3.
: >

: >
: > The pipes you open and pass to usbdi_io are valid endpoints
: > on the this selected interface/alternate right ?
: >
: > Could you post the source your insertion callback function
: >
: >
: > : Is it bad doctor?
: >
: > : "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message news:
: > : b5fdn3$9r2$1@inn.qnx.com...
: > : > > have you done a :
: > : > >
: > : > > usbd_select_interface( spca->ptrdevice, spca->instance.iface, 7 );
: > : >
: > : > I don't think I have done that. :-) This time it should be allright.
: > : I'll
: > : > test it immediatly and give you feedback as soon as possible.
: > : >
: > : > Thanks
: > : >
: > : >
: > : > "Henry Van Dyke" <henry@93.com> a écrit dans le message news:
: > : > b5fcl3$2oq$1@nntp.qnx.com...
: > : > > Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > : > > : I find out something... I explain.
: > : > >
: > : > > : I was doing that in the insertion callback:
: > : > >
: > : > > :
: > : >
: > :
: usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: > : > > : ce.iface,7,&nod);
: > : > >
: > : > > : Now I have written that and put the buffer size to 0 (size for
: > : alternate
: > : > 0):
: > : > >
: > : > > : inter =
: > : > > :
: > : >
: > :
: usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: > : > > : ce.iface,spca->instance.alternate,&nod)
: > : > >
: > : > > : And after that status look like: 0x02000005
: > : > >
: > : > > : I think it means the device doesn't respond. Perhaps because of
: > : packet
: > : > size
: > : > > : 0...
: > : > >
: > : > > : Could you tell me how to do to get the alternate 7 properly?
: > : > >
: > : > > have you done a :
: > : > >
: > : > > usbd_select_interface( spca->ptrdevice, spca->instance.iface, 7 );
: > : > >
: > : > >
: > : > > : "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message
: news:
: > : > > : b5d5ff$ltm$1@inn.qnx.com...
: > : > > : > > Have you initialized the camera to get it start
: > : > > : > > capturing frames.
: > : > > : >
: > : > > : > Yes. But I also receive the call back if I don't initialize the
: > : > camera to
: > : > > : > get it start capturing frames. :-s
: > : > > : >
: > : > > : > > Is MAX_FRAME_SIZE_PER_DESC equal to the >endpoint size ?
: > : > > : >
: > : > > : > Yes. 1023 exactly.
: > : > > : >
: > : > > : > > In your callback function to do you continously get the
: > : > > : > > same error reported in the the call to usbd_urb_status() ?
: > : > > : >
: > : > > : > Always the same status : 0x02040932
: > : > > : >
: > : > > : > Tomorrow I'll try the webcam on an other computer to see if
: status
: > : > keeps
: > : > > : the
: > : > > : > same value.
: > : > > : >
: > : > > : > But I can say I'am sure it is not a hardware problem because the
: cam
: > : > works
: > : > > : > very well under windows....
: > : > > : >
: > : > > : > "Henry Van Dyke" <henry@93.com> a écrit dans le message news:
: > : > > : > b5d5g7$j2n$1@nntp.qnx.com...
: > : > > : > > Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > : > > : > > : > have a look to the mouse_parse_descriptors() in the DDK
: mouse
: > : > > : example.
: > : > > : > > : > to get/test the endpoint number use ep = bEndpointAddress
: &
: > : 0xF.
: > : > > : > >
: > : > > : > > : I get the correct value :-) (1)
: > : > > : > >
: > : > > : > > : >What USB controller chip are you running on.
: > : > > : > >
: > : > > : > > : VIA VT83C572
: > : > > : > >
: > : > > : > > : +
: > : > > : > >
: > : > > : > > : Opti 82C861 Firelink (Pci-to-usb bridge)
: > : > > : > >
: > : > > : > > : >Could you post code snippets of where you are
: > : > > : > > : >enqueuing the urbs ?
: > : > > : > >
: > : > > : > > : spca->urbIso = usbd_alloc_urb(NULL);
: > : > > : > > : spca->frameBuffer = usbd_alloc(MAX_FRAME_SIZE_PER_DESC);
: > : > > : > > : error =
: > : > > : > > :
: > : > > : >
: > : > > :
: > : >
: > :
: usbd_setup_isochronous(spca->urbIso,URB_DIR_IN|URB_ISOCH_ASAP,0,spca->frameB
: > : > > : > > : uffer,MAX_FRAME_SIZE_PER_DESC);
: > : > > : > > : if (error)
: > : > > : > > : {
: > : > > : > > : printf("usbd_setup_isochronous error: %d\n",error);
: > : > > : > > : }
: > : > > : > > : else
: > : > > : > > : printf("usbd_setup_isochronous ok\n");
: > : > > : > > : error =
: > : > > : > > :
: > : > usbd_io(spca->urbIso,spca->IsoPipe,isoc_irq,spca,USBD_TIME_INFINITY);
: > : > > : > > : if (error)
: > : > > : > > : {
: > : > > : > > : printf("usbd_io error: %d\n",error);
: > : > > : > > : }
: > : > > : > >
: > : > > : > > : --> the pipe is correctly initialized I think.
: > : > > : > >
: > : > > : > >
: > : > > : > > Have you initialized the camera to get it start
: > : > > : > > capturing frames.
: > : > > : > >
: > : > > : > > I can't see anything obviously wrong with the above code.
: > : > > : > >
: > : > > : > > Is MAX_FRAME_SIZE_PER_DESC equal to the endpoint size ?
: > : > > : > >
: > : > > : > > In your callback function to do you continously get the
: > : > > : > > same error reported in the the call to usbd_urb_status() ?
: > : > > : > >
: > : > > : > >
: > : > > : > >
: > : > > : > > : "Peter" <nospam@nospam.at.all> a écrit dans le message news:
: > : > > : > > : b5cbel$mn9$1@inn.qnx.com...
: > : > > : > > : > have a look to the mouse_parse_descriptors() in the DDK
: mouse
: > : > > : example.
: > : > > : > > : > to get/test the endpoint number use ep = bEndpointAddress
: &
: > : 0xF.
: > : > > : > > : >
: > : > > : > > : > "Hercot Jean-Yves" <fa063821@skynet.be> schrieb im
: Newsbeitrag
: > : > > : > > : > news:b5ajj2$n6o$1@inn.qnx.com...
: > : > > : > > : > > I have tried and it doesn't work :-(.
: > : > > : > > : > >
: > : > > : > > : > > I have checked my code with Peter's one and it seems
: > : similar.
: > : > > : When
: > : > > : > I
: > : > > : > > : > setup
: > : > > : > > : > > an isochronous I receive the callback (even if I don't
: > : enable
: > : > > : Isoch
: > : > > : > > : > > transfers on the cam) but the urb_status is set to
: > : 0x02040932.
: > : > > : > > : > >
: > : > > : > > : > > The results of usb -vvv seems correct and the cam works
: well
: > : > under
: > : > > : > > : windows
: > : > > : > > : > > on the same computer.
: > : > > : > > : > >
: > : > > : > > : > > I have noticed that the value returned by
: usbd_pipe_endpoint
: > : > is 0
: > : > > : > for
: > : > > : > > : the
: > : > > : > > : > > control pipe and 129 for the Isoch/in pipe (it should be
: 1).
: > : > It
: > : > > : > also
: > : > > : > > : > > returns 129 with the other alternate settings.
: > : > > : > > : > >
: > : > > : > > : > > Help me!!!! :-p
: > : > > : > > : > >
: > : > > : > > : > > "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le
: > : > message
: > : > > : > news:
: > : > > : > > : > > b5abul$f7k$1@inn.qnx.com...
: > : > > : > > : > > > Henry > I'll test all you have said about the
: isochronous
: > : > > : > transfers.
: > : > > : > > : > I'll
: > : > > : > > : > > > post my question here if it doesn't work... ;-)
: > : > > : > > : > > >
: > : > > : > > : > > > Thanx
: > : > > : > >
: > : > > : > > [snip]
: > : > > : > >
: > : > > : >
: > : > > : >
: > : > >
: > : > >
: > : >
: > : >
: >
: >

Hercot Jean-Yves

Re: Isochronous transfers

Post by Hercot Jean-Yves » Tue Mar 25, 2003 5:24 pm

Here is the result of usb -vvvvv :

Device Address : 2
Vendor : 0x0130
Product : 0x0130
Device Release : r1.00
USB Spec Release : v1.10
Serial Number : N/A
Class : 0x00 (Independant per interface)
Max PacketSize0 : 8
Languages : No string descriptors
Current Frame : 60903 (1024 bytes)
Configurations : 1
Configuration : 1
Attributes : 0x80 (Bus-powered)
Max Power : 100 mA
Interfaces : 1 (with 7 alternate)
Interface : 0 / 0
Class : 0xff (Vendor-specific)
Subclass : 0x00
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Isoch/IN
Max Packet Size: 0
Interval : 1 ms
Interface : 0 / 1
Class : 0xff (Vendor-specific)
Subclass : 0x00
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Isoch/IN
Max Packet Size: 128
Interval : 1 ms
Interface : 0 / 2
Class : 0xff (Vendor-specific)
Subclass : 0x00
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Isoch/IN
Max Packet Size: 384
Interval : 1 ms
Interface : 0 / 3
Class : 0xff (Vendor-specific)
Subclass : 0x00
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Isoch/IN
Max Packet Size: 512
Interval : 1 ms
Interface : 0 / 4
Class : 0xff (Vendor-specific)
Subclass : 0x00
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Isoch/IN
Max Packet Size: 640
Interval : 1 ms
Interface : 0 / 5
Class : 0xff (Vendor-specific)
Subclass : 0x00
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Isoch/IN
Max Packet Size: 768
Interval : 1 ms
Interface : 0 / 6
Class : 0xff (Vendor-specific)
Subclass : 0x00
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Isoch/IN
Max Packet Size: 896
Interval : 1 ms
Interface : 0 / 7
Class : 0xff (Vendor-specific)
Subclass : 0x00
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Isoch/IN
Max Packet Size: 1023
Interval : 1 ms

Ps: I'am going to "sniff" the windows driver to see if I don't miss
something in the sensor or bridge configuration.

"Henry Van Dyke" <henry@93.com> a écrit dans le message news:
b5pk47$ffn$1@nntp.qnx.com...
can you post the output from 'usb -vvvvv' for the device.


Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > Ok. Is the USB stack still running after you get this error.

: Yes

: > The pipes you open and pass to usbdi_io are valid endpoints
: > on the this selected interface/alternate right ?

: Yes I have checked the fields of the structures. All values seem
correct.

: > Could you post the source your insertion callback function

: Here is:

: void insertion(struct usbd_connection *connection,
usbd_device_instance_t
: *instance)
: {
: int eix = 0,error = 0;
: usbd_interface_descriptor_t *inter;
: struct usbd_device *device;
: struct usbd_desc_node *nod;
: printf("Insertion callback!\n");
: if (!attached)
: {
: /* S'attache au device SPCA508A */
: error = usbd_attach(connection,instance,sizeof(struct
: usb_spca508),&device);
: if (error)
: printf("usbd_attach error: %d\n",error);
: else
: {
: printf("usbd_attach ok\n");
: spca = usbd_device_extra(device);
: spca->ptrdevice = device;
: spca->instance = *instance;
: printf("Alternate = %d\n",spca->instance.alternate);
: /* Recuperer le descripteur de l interface */
: error =
usbd_select_interface(spca->ptrdevice,spca->instance.iface,7);
: if (error)
: printf("usbd_select_interface error: %d\n",error);
: inter =
:
usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: ce.iface,spca->instance.alternate,&nod);
: if (inter)
: printf("Num = %d , Alt =
: %d\n",inter->bInterfaceNumber,inter->bAlternateSetting);
: /* Parcourir les descripteurs de device */
: usb_descriptor = (usbd_descriptors_t*)1;
: while (usb_descriptor != NULL)
: {
: usb_descriptor =
:
usbd_parse_descriptors(spca->ptrdevice,nod,USB_DESC_ENDPOINT,eix,&usb_desc_n
: ode);
: if (usb_descriptor)
: {
: printf("Maxsize = %d\n",usb_descriptor->endpoint.wMaxPacketSize);
: printf("Attributes = %d\n",usb_descriptor->endpoint.bmAttributes);
: printf("Endpoint = %x\n",usb_descriptor->endpoint.bEndpointAddress
&
: 0xF);
: switch(usb_descriptor->endpoint.bmAttributes)
: {
: case USB_ATTRIB_CONTROL:
: printf("Ctrl\n");
: error =
: usbd_open_pipe(spca->ptrdevice,usb_descriptor,&(spca->CtrlPipe));
: if (error)
: printf("usbd_open_pipe error:
: %d\n",error);
: printf("Endpoint =
: %x\n",usbd_pipe_endpoint(spca->CtrlPipe));
: break;
: case USB_ATTRIB_ISOCHRONOUS:
: printf("Iso\n");
: error =
: usbd_open_pipe(spca->ptrdevice,usb_descriptor,&(spca->IsoPipe));
: if (error)
: printf("usbd_open_pipe error:
: %d\n",error);
: printf("Endpoint =
: %x\n",usbd_pipe_endpoint(spca->IsoPipe));
: break;
: }
: }
: eix++;
: }

: config_spca508(spca);

: /* Set_mode */
: set_mode(spca,0,ext_modes);

: spca->urbIso = usbd_alloc_urb(NULL);
: spca->frameBuffer = usbd_alloc(MAX_FRAME_SIZE_PER_DESC);

: /* activer video ISO et drop packet */

: reg_write(spca, 0, 0x8112, 0x20 | 0x10);

: error =
:
usbd_setup_isochronous(spca->urbIso,URB_DIR_IN|URB_ISOCH_ASAP,0,spca->frameB
: uffer,MAX_FRAME_SIZE_PER_DESC);
: if (error)
: {
: printf("usbd_setup_isochronous error: %d\n",error);
: }
: else
: printf("usbd_setup_isochronous ok\n");
: error =
: usbd_io(spca->urbIso,spca>IsoPipe,isoc_irq,spca,USBD_TIME_INFINITY);
: if (error)
: {
: printf("usbd_io error: %d\n",error);
: }
: else
: printf("usbd_io ok\n");
: }
: }
: }

: The few comments are in french (sorry) but they are not very helpfull...
;-p

: Peter > Do you only access to the Usb bridge of the cam or do you also
have
: to configure the sensor?


: "Henry Van Dyke" <henry@93.com> a écrit dans le message news:
: b5flt2$8ml$1@nntp.qnx.com...
: > Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > : I have put the usbd_select_interface and now usbd_io returns error
3.
:

:
: > The pipes you open and pass to usbdi_io are valid endpoints
: > on the this selected interface/alternate right ?
:
: > Could you post the source your insertion callback function
:
:
: > : Is it bad doctor?
:
: > : "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message
news:
: > : b5fdn3$9r2$1@inn.qnx.com...
: > : > > have you done a :
: > :
: > : > > usbd_select_interface( spca->ptrdevice, spca->instance.iface,
7 );
: > :
: > : > I don't think I have done that. :-) This time it should be
allright.
: > : I'll
: > : > test it immediatly and give you feedback as soon as possible.
: > :
: > : > Thanks
: > :
: > :
: > : > "Henry Van Dyke" <henry@93.com> a écrit dans le message news:
: > : > b5fcl3$2oq$1@nntp.qnx.com...
: > : > > Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > : > > : I find out something... I explain.
: > :
: > : > > : I was doing that in the insertion callback:
: > :
: > : > > :
: > :
: > :
:
usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: > : > > : ce.iface,7,&nod);
: > :
: > : > > : Now I have written that and put the buffer size to 0 (size for
: > : alternate
: > : > 0):
: > :
: > : > > : inter =
: > : > > :
: > :
: > :
:
usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: > : > > : ce.iface,spca->instance.alternate,&nod)
: > :
: > : > > : And after that status look like: 0x02000005
: > :
: > : > > : I think it means the device doesn't respond. Perhaps because
of
: > : packet
: > : > size
: > : > > : 0...
: > :
: > : > > : Could you tell me how to do to get the alternate 7 properly?
: > :
: > : > > have you done a :
: > :
: > : > > usbd_select_interface( spca->ptrdevice, spca->instance.iface,
7 );
: > :
: > :
: > : > > : "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le
message
: news:
: > : > > : b5d5ff$ltm$1@inn.qnx.com...
: > : > > : > > Have you initialized the camera to get it start
: > : > > : > > capturing frames.
: > : > > :
: > : > > : > Yes. But I also receive the call back if I don't initialize
the
: > : > camera to
: > : > > : > get it start capturing frames. :-s
: > : > > :
: > : > > : > > Is MAX_FRAME_SIZE_PER_DESC equal to the >endpoint size ?
: > : > > :
: > : > > : > Yes. 1023 exactly.
: > : > > :
: > : > > : > > In your callback function to do you continously get the
: > : > > : > > same error reported in the the call to usbd_urb_status() ?
: > : > > :
: > : > > : > Always the same status : 0x02040932
: > : > > :
: > : > > : > Tomorrow I'll try the webcam on an other computer to see if
: status
: > : > keeps
: > : > > : the
: > : > > : > same value.
: > : > > :
: > : > > : > But I can say I'am sure it is not a hardware problem because
the
: cam
: > : > works
: > : > > : > very well under windows....
: > : > > :
: > : > > : > "Henry Van Dyke" <henry@93.com> a écrit dans le message
news:
: > : > > : > b5d5g7$j2n$1@nntp.qnx.com...
: > : > > : > > Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > : > > : > > : > have a look to the mouse_parse_descriptors() in the
DDK
: mouse
: > : > > : example.
: > : > > : > > : > to get/test the endpoint number use ep =
bEndpointAddress
: &
: > : 0xF.
: > : > > :
: > : > > : > > : I get the correct value :-) (1)
: > : > > :
: > : > > : > > : >What USB controller chip are you running on.
: > : > > :
: > : > > : > > : VIA VT83C572
: > : > > :
: > : > > : > > : +
: > : > > :
: > : > > : > > : Opti 82C861 Firelink (Pci-to-usb bridge)
: > : > > :
: > : > > : > > : >Could you post code snippets of where you are
: > : > > : > > : >enqueuing the urbs ?
: > : > > :
: > : > > : > > : spca->urbIso = usbd_alloc_urb(NULL);
: > : > > : > > : spca->frameBuffer =
usbd_alloc(MAX_FRAME_SIZE_PER_DESC);
: > : > > : > > : error =
: > : > > : > > :
: > : > > :
: > : > > :
: > :
: > :
:
usbd_setup_isochronous(spca->urbIso,URB_DIR_IN|URB_ISOCH_ASAP,0,spca->frameB
: > : > > : > > : uffer,MAX_FRAME_SIZE_PER_DESC);
: > : > > : > > : if (error)
: > : > > : > > : {
: > : > > : > > : printf("usbd_setup_isochronous error: %d\n",error);
: > : > > : > > : }
: > : > > : > > : else
: > : > > : > > : printf("usbd_setup_isochronous ok\n");
: > : > > : > > : error =
: > : > > : > > :
: > :
usbd_io(spca->urbIso,spca->IsoPipe,isoc_irq,spca,USBD_TIME_INFINITY);
: > : > > : > > : if (error)
: > : > > : > > : {
: > : > > : > > : printf("usbd_io error: %d\n",error);
: > : > > : > > : }
: > : > > :
: > : > > : > > : --> the pipe is correctly initialized I think.
: > : > > :
: > : > > :
: > : > > : > > Have you initialized the camera to get it start
: > : > > : > > capturing frames.
: > : > > :
: > : > > : > > I can't see anything obviously wrong with the above code.
: > : > > :
: > : > > : > > Is MAX_FRAME_SIZE_PER_DESC equal to the endpoint size ?
: > : > > :
: > : > > : > > In your callback function to do you continously get the
: > : > > : > > same error reported in the the call to usbd_urb_status() ?
: > : > > :
: > : > > :
: > : > > :
: > : > > : > > : "Peter" <nospam@nospam.at.all> a écrit dans le message
news:
: > : > > : > > : b5cbel$mn9$1@inn.qnx.com...
: > : > > : > > : > have a look to the mouse_parse_descriptors() in the
DDK
: mouse
: > : > > : example.
: > : > > : > > : > to get/test the endpoint number use ep =
bEndpointAddress
: &
: > : 0xF.
: > : > > : > > :
: > : > > : > > : > "Hercot Jean-Yves" <fa063821@skynet.be> schrieb im
: Newsbeitrag
: > : > > : > > : > news:b5ajj2$n6o$1@inn.qnx.com...
: > : > > : > > : > > I have tried and it doesn't work :-(.
: > : > > : > > :
: > : > > : > > : > > I have checked my code with Peter's one and it seems
: > : similar.
: > : > > : When
: > : > > : > I
: > : > > : > > : > setup
: > : > > : > > : > > an isochronous I receive the callback (even if I
don't
: > : enable
: > : > > : Isoch
: > : > > : > > : > > transfers on the cam) but the urb_status is set to
: > : 0x02040932.
: > : > > : > > :
: > : > > : > > : > > The results of usb -vvv seems correct and the cam
works
: well
: > : > under
: > : > > : > > : windows
: > : > > : > > : > > on the same computer.
: > : > > : > > :
: > : > > : > > : > > I have noticed that the value returned by
: usbd_pipe_endpoint
: > : > is 0
: > : > > : > for
: > : > > : > > : the
: > : > > : > > : > > control pipe and 129 for the Isoch/in pipe (it
should be
: 1).
: > : > It
: > : > > : > also
: > : > > : > > : > > returns 129 with the other alternate settings.
: > : > > : > > :
: > : > > : > > : > > Help me!!!! :-p
: > : > > : > > :
: > : > > : > > : > > "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans
le
: > : > message
: > : > > : > news:
: > : > > : > > : > > b5abul$f7k$1@inn.qnx.com...
: > : > > : > > : > > > Henry > I'll test all you have said about the
: isochronous
: > : > > : > transfers.
: > : > > : > > : > I'll
: > : > > : > > : > > > post my question here if it doesn't work... ;-)
: > : > > : > > :
: > : > > : > > : > > > Thanx
: > : > > :
: > : > > : > > [snip]
: > : > > :
: > : > > :
: > : > > :
: > :
: > :
: > :
: > :
:
:

Hercot Jean-Yves

Re: Isochronous transfers

Post by Hercot Jean-Yves » Wed Mar 26, 2003 9:16 am

Is there a utility to check if the usb device transmit isoch packets?

"Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message de news:
b5q25r$m0r$1@inn.qnx.com...
Here is the result of usb -vvvvv :

Device Address : 2
Vendor : 0x0130
Product : 0x0130
Device Release : r1.00
USB Spec Release : v1.10
Serial Number : N/A
Class : 0x00 (Independant per interface)
Max PacketSize0 : 8
Languages : No string descriptors
Current Frame : 60903 (1024 bytes)
Configurations : 1
Configuration : 1
Attributes : 0x80 (Bus-powered)
Max Power : 100 mA
Interfaces : 1 (with 7 alternate)
Interface : 0 / 0
Class : 0xff (Vendor-specific)
Subclass : 0x00
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Isoch/IN
Max Packet Size: 0
Interval : 1 ms
Interface : 0 / 1
Class : 0xff (Vendor-specific)
Subclass : 0x00
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Isoch/IN
Max Packet Size: 128
Interval : 1 ms
Interface : 0 / 2
Class : 0xff (Vendor-specific)
Subclass : 0x00
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Isoch/IN
Max Packet Size: 384
Interval : 1 ms
Interface : 0 / 3
Class : 0xff (Vendor-specific)
Subclass : 0x00
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Isoch/IN
Max Packet Size: 512
Interval : 1 ms
Interface : 0 / 4
Class : 0xff (Vendor-specific)
Subclass : 0x00
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Isoch/IN
Max Packet Size: 640
Interval : 1 ms
Interface : 0 / 5
Class : 0xff (Vendor-specific)
Subclass : 0x00
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Isoch/IN
Max Packet Size: 768
Interval : 1 ms
Interface : 0 / 6
Class : 0xff (Vendor-specific)
Subclass : 0x00
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Isoch/IN
Max Packet Size: 896
Interval : 1 ms
Interface : 0 / 7
Class : 0xff (Vendor-specific)
Subclass : 0x00
Protocol : 0x00
Endpoints : Control + 1
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Isoch/IN
Max Packet Size: 1023
Interval : 1 ms

Ps: I'am going to "sniff" the windows driver to see if I don't miss
something in the sensor or bridge configuration.

"Henry Van Dyke" <henry@93.com> a écrit dans le message news:
b5pk47$ffn$1@nntp.qnx.com...

can you post the output from 'usb -vvvvv' for the device.


Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > Ok. Is the USB stack still running after you get this error.

: Yes

: > The pipes you open and pass to usbdi_io are valid endpoints
: > on the this selected interface/alternate right ?

: Yes I have checked the fields of the structures. All values seem
correct.

: > Could you post the source your insertion callback function

: Here is:

: void insertion(struct usbd_connection *connection,
usbd_device_instance_t
: *instance)
: {
: int eix = 0,error = 0;
: usbd_interface_descriptor_t *inter;
: struct usbd_device *device;
: struct usbd_desc_node *nod;
: printf("Insertion callback!\n");
: if (!attached)
: {
: /* S'attache au device SPCA508A */
: error = usbd_attach(connection,instance,sizeof(struct
: usb_spca508),&device);
: if (error)
: printf("usbd_attach error: %d\n",error);
: else
: {
: printf("usbd_attach ok\n");
: spca = usbd_device_extra(device);
: spca->ptrdevice = device;
: spca->instance = *instance;
: printf("Alternate = %d\n",spca->instance.alternate);
: /* Recuperer le descripteur de l interface */
: error =
usbd_select_interface(spca->ptrdevice,spca->instance.iface,7);
: if (error)
: printf("usbd_select_interface error: %d\n",error);
: inter =
:

usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: ce.iface,spca->instance.alternate,&nod);
: if (inter)
: printf("Num = %d , Alt =
: %d\n",inter->bInterfaceNumber,inter->bAlternateSetting);
: /* Parcourir les descripteurs de device */
: usb_descriptor = (usbd_descriptors_t*)1;
: while (usb_descriptor != NULL)
: {
: usb_descriptor =
:

usbd_parse_descriptors(spca->ptrdevice,nod,USB_DESC_ENDPOINT,eix,&usb_desc_n
: ode);
: if (usb_descriptor)
: {
: printf("Maxsize = %d\n",usb_descriptor->endpoint.wMaxPacketSize);
: printf("Attributes =
%d\n",usb_descriptor->endpoint.bmAttributes);
: printf("Endpoint =
%x\n",usb_descriptor->endpoint.bEndpointAddress
&
: 0xF);
: switch(usb_descriptor->endpoint.bmAttributes)
: {
: case USB_ATTRIB_CONTROL:
: printf("Ctrl\n");
: error =
: usbd_open_pipe(spca->ptrdevice,usb_descriptor,&(spca->CtrlPipe));
: if (error)
: printf("usbd_open_pipe error:
: %d\n",error);
: printf("Endpoint =
: %x\n",usbd_pipe_endpoint(spca->CtrlPipe));
: break;
: case USB_ATTRIB_ISOCHRONOUS:
: printf("Iso\n");
: error =
: usbd_open_pipe(spca->ptrdevice,usb_descriptor,&(spca->IsoPipe));
: if (error)
: printf("usbd_open_pipe error:
: %d\n",error);
: printf("Endpoint =
: %x\n",usbd_pipe_endpoint(spca->IsoPipe));
: break;
: }
: }
: eix++;
: }

: config_spca508(spca);

: /* Set_mode */
: set_mode(spca,0,ext_modes);

: spca->urbIso = usbd_alloc_urb(NULL);
: spca->frameBuffer = usbd_alloc(MAX_FRAME_SIZE_PER_DESC);

: /* activer video ISO et drop packet */

: reg_write(spca, 0, 0x8112, 0x20 | 0x10);

: error =
:

usbd_setup_isochronous(spca->urbIso,URB_DIR_IN|URB_ISOCH_ASAP,0,spca->frameB
: uffer,MAX_FRAME_SIZE_PER_DESC);
: if (error)
: {
: printf("usbd_setup_isochronous error: %d\n",error);
: }
: else
: printf("usbd_setup_isochronous ok\n");
: error =
: usbd_io(spca->urbIso,spca>IsoPipe,isoc_irq,spca,USBD_TIME_INFINITY);
: if (error)
: {
: printf("usbd_io error: %d\n",error);
: }
: else
: printf("usbd_io ok\n");
: }
: }
: }

: The few comments are in french (sorry) but they are not very
helpfull...
;-p

: Peter > Do you only access to the Usb bridge of the cam or do you also
have
: to configure the sensor?


: "Henry Van Dyke" <henry@93.com> a écrit dans le message news:
: b5flt2$8ml$1@nntp.qnx.com...
: > Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > : I have put the usbd_select_interface and now usbd_io returns error
3.
:

:
: > The pipes you open and pass to usbdi_io are valid endpoints
: > on the this selected interface/alternate right ?
:
: > Could you post the source your insertion callback function
:
:
: > : Is it bad doctor?
:
: > : "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le message
news:
: > : b5fdn3$9r2$1@inn.qnx.com...
: > : > > have you done a :
: > :
: > : > > usbd_select_interface( spca->ptrdevice, spca->instance.iface,
7 );
: > :
: > : > I don't think I have done that. :-) This time it should be
allright.
: > : I'll
: > : > test it immediatly and give you feedback as soon as possible.
: > :
: > : > Thanks
: > :
: > :
: > : > "Henry Van Dyke" <henry@93.com> a écrit dans le message news:
: > : > b5fcl3$2oq$1@nntp.qnx.com...
: > : > > Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > : > > : I find out something... I explain.
: > :
: > : > > : I was doing that in the insertion callback:
: > :
: > : > > :
: > :
: > :
:

usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: > : > > : ce.iface,7,&nod);
: > :
: > : > > : Now I have written that and put the buffer size to 0 (size
for
: > : alternate
: > : > 0):
: > :
: > : > > : inter =
: > : > > :
: > :
: > :
:

usbd_interface_descriptor(spca->ptrdevice,spca->instance.config,spca->instan
: > : > > : ce.iface,spca->instance.alternate,&nod)
: > :
: > : > > : And after that status look like: 0x02000005
: > :
: > : > > : I think it means the device doesn't respond. Perhaps
because
of
: > : packet
: > : > size
: > : > > : 0...
: > :
: > : > > : Could you tell me how to do to get the alternate 7 properly?
: > :
: > : > > have you done a :
: > :
: > : > > usbd_select_interface( spca->ptrdevice, spca->instance.iface,
7 );
: > :
: > :
: > : > > : "Hercot Jean-Yves" <fa063821@skynet.be> a écrit dans le
message
: news:
: > : > > : b5d5ff$ltm$1@inn.qnx.com...
: > : > > : > > Have you initialized the camera to get it start
: > : > > : > > capturing frames.
: > : > > :
: > : > > : > Yes. But I also receive the call back if I don't
initialize
the
: > : > camera to
: > : > > : > get it start capturing frames. :-s
: > : > > :
: > : > > : > > Is MAX_FRAME_SIZE_PER_DESC equal to the >endpoint size ?
: > : > > :
: > : > > : > Yes. 1023 exactly.
: > : > > :
: > : > > : > > In your callback function to do you continously get the
: > : > > : > > same error reported in the the call to usbd_urb_status()
?
: > : > > :
: > : > > : > Always the same status : 0x02040932
: > : > > :
: > : > > : > Tomorrow I'll try the webcam on an other computer to see
if
: status
: > : > keeps
: > : > > : the
: > : > > : > same value.
: > : > > :
: > : > > : > But I can say I'am sure it is not a hardware problem
because
the
: cam
: > : > works
: > : > > : > very well under windows....
: > : > > :
: > : > > : > "Henry Van Dyke" <henry@93.com> a écrit dans le message
news:
: > : > > : > b5d5g7$j2n$1@nntp.qnx.com...
: > : > > : > > Hercot Jean-Yves (fa063821@skynet.be) wrote:
: > : > > : > > : > have a look to the mouse_parse_descriptors() in the
DDK
: mouse
: > : > > : example.
: > : > > : > > : > to get/test the endpoint number use ep =
bEndpointAddress
: &
: > : 0xF.
: > : > > :
: > : > > : > > : I get the correct value :-) (1)
: > : > > :
: > : > > : > > : >What USB controller chip are you running on.
: > : > > :
: > : > > : > > : VIA VT83C572
: > : > > :
: > : > > : > > : +
: > : > > :
: > : > > : > > : Opti 82C861 Firelink (Pci-to-usb bridge)
: > : > > :
: > : > > : > > : >Could you post code snippets of where you are
: > : > > : > > : >enqueuing the urbs ?
: > : > > :
: > : > > : > > : spca->urbIso = usbd_alloc_urb(NULL);
: > : > > : > > : spca->frameBuffer =
usbd_alloc(MAX_FRAME_SIZE_PER_DESC);
: > : > > : > > : error =
: > : > > : > > :
: > : > > :
: > : > > :
: > :
: > :
:

usbd_setup_isochronous(spca->urbIso,URB_DIR_IN|URB_ISOCH_ASAP,0,spca->frameB
: > : > > : > > : uffer,MAX_FRAME_SIZE_PER_DESC);
: > : > > : > > : if (error)
: > : > > : > > : {
: > : > > : > > : printf("usbd_setup_isochronous error:
%d\n",error);
: > : > > : > > : }
: > : > > : > > : else
: > : > > : > > : printf("usbd_setup_isochronous ok\n");
: > : > > : > > : error =
: > : > > : > > :
: > :
usbd_io(spca->urbIso,spca->IsoPipe,isoc_irq,spca,USBD_TIME_INFINITY);
: > : > > : > > : if (error)
: > : > > : > > : {
: > : > > : > > : printf("usbd_io error: %d\n",error);
: > : > > : > > : }
: > : > > :
: > : > > : > > : --> the pipe is correctly initialized I think.
: > : > > :
: > : > > :
: > : > > : > > Have you initialized the camera to get it start
: > : > > : > > capturing frames.
: > : > > :
: > : > > : > > I can't see anything obviously wrong with the above
code.
: > : > > :
: > : > > : > > Is MAX_FRAME_SIZE_PER_DESC equal to the endpoint size ?
: > : > > :
: > : > > : > > In your callback function to do you continously get the
: > : > > : > > same error reported in the the call to usbd_urb_status()
?
: > : > > :
: > : > > :
: > : > > :
: > : > > : > > : "Peter" <nospam@nospam.at.all> a écrit dans le message
news:
: > : > > : > > : b5cbel$mn9$1@inn.qnx.com...
: > : > > : > > : > have a look to the mouse_parse_descriptors() in the
DDK
: mouse
: > : > > : example.
: > : > > : > > : > to get/test the endpoint number use ep =
bEndpointAddress
: &
: > : 0xF.
: > : > > : > > :
: > : > > : > > : > "Hercot Jean-Yves" <fa063821@skynet.be> schrieb im
: Newsbeitrag
: > : > > : > > : > news:b5ajj2$n6o$1@inn.qnx.com...
: > : > > : > > : > > I have tried and it doesn't work :-(.
: > : > > : > > :
: > : > > : > > : > > I have checked my code with Peter's one and it
seems
: > : similar.
: > : > > : When
: > : > > : > I
: > : > > : > > : > setup
: > : > > : > > : > > an isochronous I receive the callback (even if I
don't
: > : enable
: > : > > : Isoch
: > : > > : > > : > > transfers on the cam) but the urb_status is set to
: > : 0x02040932.
: > : > > : > > :
: > : > > : > > : > > The results of usb -vvv seems correct and the cam
works
: well
: > : > under
: > : > > : > > : windows
: > : > > : > > : > > on the same computer.
: > : > > : > > :
: > : > > : > > : > > I have noticed that the value returned by
: usbd_pipe_endpoint
: > : > is 0
: > : > > : > for
: > : > > : > > : the
: > : > > : > > : > > control pipe and 129 for the Isoch/in pipe (it
should be
: 1).
: > : > It
: > : > > : > also
: > : > > : > > : > > returns 129 with the other alternate settings.
: > : > > : > > :
: > : > > : > > : > > Help me!!!! :-p
: > : > > : > > :
: > : > > : > > : > > "Hercot Jean-Yves" <fa063821@skynet.be> a écrit
dans
le
: > : > message
: > : > > : > news:
: > : > > : > > : > > b5abul$f7k$1@inn.qnx.com...
: > : > > : > > : > > > Henry > I'll test all you have said about the
: isochronous
: > : > > : > transfers.
: > : > > : > > : > I'll
: > : > > : > > : > > > post my question here if it doesn't work... ;-)
: > : > > : > > :
: > : > > : > > : > > > Thanx
: > : > > :
: > : > > : > > [snip]
: > : > > :
: > : > > :
: > : > > :
: > :
: > :
: > :
: > :
:
:



Post Reply

Return to “qdn.public.ddk.usb”