A4tech PK-836MJ camera, GET_LEN request on VS interface behaviour

Oct 11, 2010 at 8:54 AM
Edited Oct 11, 2010 at 9:38 AM

Hi, all

I'm working on utilizing the CeWebCam driver with A4tech PK-836MJ camera. The camera is VC0332PLNF chip based (http://www.vimicro.com/english/product/d_vc0332_n.htm).

The camera didn't work with the driver out from the box, and debugging has shown that problems are arising when driver does quality negotiation task.

Particulary, before driver requests quality settings (GetMinMaxQuality function) it requests for the size of STREAM_PROBE_CONTROLSTRUCT structure (line 1456 in original pddVclas.cpp), and at that point things get bad.

I have tested with two CE devices, one is Acer n311 PDA  running WM5 (CE 5.1.476) and the other is Fujitsu n560 PDA running WM6.1 (CE 5.2.19209).

On Acer GetVendorTransferLen() finishes with WinErr=31 and USB error (traced inside of GetVendorTransferLen) is USB_DATA_UNDERRUN_ERROR. The camera seems to send one byte reply, which is 26. 26 is quite an appropriate value, and if error is ignored and 26 is accepted as the structure size driver continues intializing and camera starts capturing, although there still some problems with payload transfers (only top part of image is fine, the bottom is corruted).

On Fujitsu GetVendorTransferLen() finishes with no error, but reply is 0x021A, the LSB is still 26, but higher byte looks strange. Assuming 0x21A=538 as structure size is obviously a bad idea.

The UVC specification says that GET_LEN request should be always 2 bytes in length, but the camera seems to send only one correct byte.

The questions are: 1) why two devices behave in a different ways, and 2) what is the correct way of understanding the request reply. Any help of USB expirienced people is highly appreciated.

Jan 6, 2012 at 1:43 PM

Hi vityap,

I am also stuck at the same point as you (using MIcrosoft LifeCam NX-6000). 

I am using the webcam driver developed by Mr. Boling. 

As you had observed, GetVendorTransferLen() (within GetMinMaxQuality()) finishes with error code 31. Then I commented off GetVendorTransferLen() and hardcoded the value for 'wProbeLen' as 26. In this case I got only the top part of the image, while the remaining image was blank.

Have you got any info regarding the resolution of this issue?

Jan 10, 2012 at 10:18 AM
Hi kensas,

I didn't have success with this project.

After I assumed that the only byte transferred by the camera is correct
one, I continued to work on image corruption issue and found out that
some part of payload packets are simply lost somewhere in depth of WinCE
usb drivers. I finally gave up fighting this and stopped working on this
project. All this happend about a year ago, so can't remember any
details now, sorry.
Jan 10, 2012 at 1:00 PM

Hi Vityap,

THanks for your reply.

Many ppl seem to be having similar issue, but there hasn't been any resolution.. Any way, I will continue with the work and post a msg in case of any progress ..