Accessing a USB WebCAM

  • Admin note: This thread has been splittet from usbclient.lib


    No, of course I don't. I try to compile the MS open source webcam driver <!-- m --><a class="postlink" href="http://www.codeplex.com/cewebcam">http://www.codeplex.com/cewebcam</a><!-- m --> against your SDK. It does compile without any problems against the headers of your SDK but it misses a library to link the USB-functionality to. The precompiled binary distributions of the driver work well with your platform as long as you do not try to capture images, but I guess these are compiled for older versions of win CE so I would prefer to compile it explicitely for the picocom.


    I know there is an alternate camera driver shipping with CE6 providing a direct show interface but as I got as a first impression (with a windows XP desktop system) direct show behaves very unhandy when trying to do still captures instead of streaming video. (Streaming video will be a problem due to excessive USB-Bandwidth allocation when the system needs to support multiple USB-devices)

  • Ok now this is getting clearer.
    To compile this driver the PicoCOM SDK is not sufficient. You will need a Driver Development Kit which will be the platform builder for WindowsCE device drivers. For this reason I have compiled this library within the PicoCOM2 environment for you.

    Files

    • WebCAM-DLL.zip

      (68.19 kB, downloaded 478 times, last: )

    Software developer, F&amp;S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • I am wondering why all includes are already there. Just the .lib file is missing in your sdk. Anyway, thank you for compiling the driver. Would it be possible to provide me the debug version too? It contains several debug outputs that give information on driver failure.
    Btw. I am using picocom1 but I guess the difference will be not that huge, isn't it?

  • I have updated the ZIP package above. It now also includes the debug version of the camera driver.

    Quote from "goennema"

    Btw. I am using picocom1 but I guess the difference will be not that huge, isn't it?


    Yes, this should not be a problem, as the libraries the driver is build with are common for all WindowsCE 6.0 devices.


    Meanwhile we have tested the USB driver, too and we succedded in capturing a still image and write it into a file.

    Software developer, F&amp;S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Oh, most likely you got further than me. The driver that you have compiled freezes when I try to capture a still or if I try to start streaming. That is the same behaviour I see with the precompiled release binary from codeplex. The debug binary from codeplex works better.


    And you did a capture using ioctl IOCTL_CAMERA_DEVICE_GETSTILLIMAGE? This did not work with any camera I tested. All of them returned error 258 stating something like "WebCam: Next Frame event not signaled rc 258" on the debug console (when using the debug binary from codeplex, your webcam.dll freezes on ioctl). This is strange thus IOCTL_CAMERA_DEVICE_QUERYSTILLFORMATS reports that my camera do support still frame modes. Can you tell me what type of camera you use?


    IOCTL_CAMERA_DEVICE_GETNEXTVIDEOFRAME in streaming mode indeed works fine (with the debug dll) but the timing overhead for starting and stopping streaming for each frame is inacceptable.


    EDIT: the debug binary you supplied in your last post does freeze too. The only one that does anything useful with my unit is the codeplex debug binary.

  • Here is the code how we are capturing an image, also tested on PicoCOM1. We are using logitec webcam.


    I must admit that I have added the driver directly into kernel. Could you tell me how you have installed the driver on PicoCOM? Maybe there might be a problem.

    Software developer, F&amp;S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • I put the webcam.dll to \\FFSDISK\Drivers\webcam.dll and associated it to the USB attach-process according to the manual delivered with the webcam driver.


    the NDCUCFG-script looks like this:



    I'll try out your code, but in its core functionality it looks too similiar to mine to expect too much of it. In parallel I will go and pick a logitech-camera to be sure to eliminate hardware issues.

  • Tried your code with my cameras, all of them report this (like expected):


    WebCam: Next Frame event not signaled rc 258
    IOCTL_CAMERA_DEVICE_QUERYSTILLFORMATS failed (LE:258)


    Note: I tried it with the codeplex debug-dll as it showed up the best results until now.

  • interesting issue:


    with your code, the debug-driver you supplied today, does NOT freeze, but shows more comprehensive errors on the debug console:



    The application console still shows:


    IOCTL_CAMERA_DEVICE_QUERYSTILLFORMATS failed (LE:258)

  • Please try to replace your registry settings with the following ones:


    Software developer, F&amp;S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • tried that and verified correct application using the remote registry editor.


    This makes the picocom report an "unidentified USB device" on the desktop. Answering the prompt for "driver name" with \ffsdisk\drivers\webcam.dll makes the picocom generate the registry entries as stated in my previous post.

  • Sorry, there was an error in the script posted berfore. I have corrected this. ("reg create Video_Class" -> "reg create key Video_Class").
    I have tested it again and its working without any problems with our camera.

    Software developer, F&amp;S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Thank you, but this did not change the cameras behaviour.


    But at last I succeeded after I tried a logitech quickcam. The Quickcam does its job quite good. And just for Info: There is at least one camera in my stock that freezes the driver you compiled for me (the debug binary from codeplex indeed works - or better, it does not crash/freeze). Some other cameras just do not work with the driver. I can use the register to read the camera properties but all tries to capture an image do fail.


    All in all not a really satisfactory result, but thank you for your help

  • Well I've put the WebCam.dll in the \FFSDSK\Drivers\ map and added the key's in the registry, but I'm getting an error on opening CAM1. Should I see anything on the display when I plug in the QuickCam Pro5000 or on the debug output on rebooting the PicoCOM2?

  • You are already confirm with BSP?
    I assume to built the components and copy dependencies to release directory before make a runtime image is enouth.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.