Hi All, On 01/11/2010 10:55 AM, Jean-Francois Moine wrote: > On Mon, 11 Jan 2010 09:37:29 +0100 > Hans de Goede wrote: > >> This is the infamous zc3xx bottom of the image is missing in 320x240 >> problem, with several sensors the register settings we took from the >> windows driver will only give you 320x232 (iirc), we tried changing >> them to get 320x240, but then the camera would not stream. Most >> likely some timing issue between bridge and sensor. >> >> I once had a patch fixing this by actually reporting the broken modes >> as 320x232, but that never got applied as it breaks app which are >> hardcoded to ask for 320x240. libv4l has had the ability to extend >> the 320x232 image to 320x240 for a while now (by adding a few black >> lines at the top + bottom), fixing the hardcoded apps problem. >> >> So I think such a patch can and should be applied now. This will get >> rid of the jpeg decompression errors reported by libv4l and in case >> if yuv mode the ugly green bar with some random noise in it at the >> bottom. >> >> I'm afraid my patch is most likely lost, but I can create a new one >> if you want, I have access to quite a few zc3xx camera's, and more >> over what resolution they are actually streaming at can be deducted >> from the register settings in the driver. > > Hi Hans, > > As you may see in Jose Alberto's message, the problem occurs with > 640x480 and, yes, the image bottom is lacking, but also the right side. > Hmm, the right side missing would indicate some timing issue between sensor and bridge, but it seems this is an intermittent problem, as in Jose's last message only the last 8 lines are missing. As for this happening also at 640x480, I re-checked things and that is the same problem, here is a table of the resolutions per sensor, derived from the register settings in zc3xx.c, iow this are the resolutions we are telling the bridge to send us! adcm2700 640x472 320x232 cs2102 640x480 320x240 cs2102k 640x480 320x240 gc0305 640x480 320x240 hdcs2020xb 640x480 320x240 hv7131bxx 640x480 320x240 hv7131cxx 640x480 320x240 icm105axx 640x480 320x240 MC501CB 640x472 320x232 OV7620 640x472 320x232 ov7630c 640x480 320x240 pas202b 640x480 320x232 mi0360soc 640x480 320x240 pb0330 640x480 320x240 PO2030 640x480 320x240 tas5130CK 640x480 320x240 tas5130cxx 640x480 320x240 tas5130c_vf0250 640x480 320x240 > I did not lose your patch, but I did not apply it because most of the > time, the webcams work in the best resolution (VGA) and the associated > problem has not found yet a good resolution... It turns out I was wrong, and the problem happens for 3 of the 4 affected sensors at both VGA and QVGA. What we are currently doing is telling the bridge to send us these resolutions, and then telling userspace it is getting something different. This is just plain wrong, no but ..., it is just *wrong*. This makes for users getting an image out of the cam like Jose is getting with the last 8 lines garbled. And when they start their webcam application from a terminal the terminal fills with: libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffec libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffd9 libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff Which is because libv4l expects there to be more data then it actually is getting, as we are *lying* to it. I know ideally we would change the register settings to actually get 640x480 and 320x240, but that won't work when you do that the camera's with the affected sensors won't stream at all, that is I've tried fiddling with the register settings for a pas202b equipped cam for hours to fix 320x240 and I got no where at all. I've done a new version of my patch, which also fixes the affected cams at 640x480, please apply this, as said I know this isn't ideal, but it is better then what we currently have. If we ever find register settings to make these cams work at normal resolutions, we can always revert this. I've tested the attached patch with the following cams: Philips SPC 200NC 0471:0325 zc3xx PAS106 Logitech QuickCam IM/Connect 046d:08d9 zc3xx HV7131R Logitech QuickCam E2500 046d:089d zc3xx MC501CB Creative WebCam NX Pro 041e:401e zc3xx HV7131B No brand 0ac8:307b zc3xx ADCM2700 Labtec notebook cam 046d:08aa zc3xx PAS202B Creative WebCam Notebook 041e:401f zc3xx TAS5130C Creative Live! Cam Video IM 041e:4053 zc3xx TAS5130-VF250 And for the 3 affected models it fixes the garbled bottom of the image and the libv4lconvert error messages (which people keep submitting bugs about). Jose, Can you please test the attached patch, do: install mercurial (on Fedora yum install mercurial) hg clone http://linuxtv.org/hg/~jfrancois/gspca/ cd gscpa patch -p1 < [path-to]/gspca_zc3xx-8lines-missing.patch make menuconfig [choose exit] make sudo make install [reboot] Thanks & Regards, Hans