Last week I came across a no-brand, very cheap-looking USB webcam with id 0ac8:0323 and recognized by Linux as a “Z-Star Microelectronics Corp. Luxya WC-1200 USB 2.0 Webcam”, which seems to be misleading in this case.

vc0323-webcam.jpg

From the USB ID it is supposed to contain a Vimicro VC0323 controller, and it was recognized as so by the GSPCA driver. This camera, however, seems to have a number of quirks that cause the driver to decode the image incorrectly: the image is fed as YUV instead of Jpeg (like the VC0321), image start offset is different from what the driver expects for VC0323 or VC0321, and finally the sensor appears to be mounted upside-down inside the camera. Read on for fix details and GSPCA patches.

Since there’s no datasheet available I tried to fix the problem as best as I could without breaking existing support in GSPCA for other VC0323-based cameras. Unable to auto-identify the model to apply the appropriate quirk handlers, I added two new module parameters: force_yuv (to handle data as planar YUV422) and rotate (to fill the frame buffer starting at the end and rotate the image 180 degrees). The fix was made for the most common output formats, namely YUV, RGB15, RGB24 and RGB32. One quirk still remains: the driver delivers RGB by default instead of BGR, so the force_rgb will actually make the image BGR (for spcaview or other applications expecting the standard encoding).

The patches for gspcav1-20071224 are:

If you could identify this camera model/manufacturer, or any other VC0323-based cameras that need this patch to work properly, please inform me.

7 Responses to “Fix for VC0323 webcam”

  1. Tabgal says:

    404 not found nos patches :/

  2. claudio says:

    Typo in URL, fixed already.

  3. decr says:

    I have a similar webcam with the same problems, but apparently they exist even after applying the patches. They get applied ok and I see the changes in the sources but still no go. Any ideas?

  4. claudio says:

    The two extra options are not enabled by default, you must manually enable “force_yuv” and “rotate” when loading the module. Is the image generated by your camera similar to my broken image sample?

  5. decr says:

    Haha. Of course, dumb me. After loading the module with those parameters it actually started working. A small defect is left though. dmesg gets filled with gspca_core.c [spca50x_move_data:1618] ISO C data error [] len=1023 status=-71. Is this the case with your camera as well?

    And to answer your question, my “broken” image is exactly the same as your sample. The camera in question can be found there: http://www.deltaco.fi/article.aspx?ItemID=WEB-302 (only in Finnish, sorry)

  6. ron says:

    I used your code and some I wrote to make the back cam work on a Samsung Q1U. The Samsung Q1U has a vc0232 with a MI1320_soc sensor.

  7. rainman110 says:

    Hello,
    I used your rotating codebase to provide 180-rotation for the class-ohlson twc30xop webcam which actually uses the bayer_decode routine. If you would like to merge my code, please write me.

Leave a Reply