Skip to contentSkip to conversation

gspca V2 vs V1: webcam picture very dark

DISCUSSION Ian Pickworth 2 participants 3 messages Oct 20, 2008 – Oct 21, 2008 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Running my Logitec cheapo webcam on gspca V2, the result is not as good as when I previously used gspca V1 freestanding (20071224).

Specifically, under V2:
The picture is very, very dark - can hardly make it out. The webcam light switches off after first use, and stays off.

The second may or may not be a problem, but I'm assuming that the light is signaling something useful, thus its state seems important.

To test the webcam, I'm using spcaview.

Using the freestanding (V1) gspca module on kernel 2.6.26, I see output below (gspca V1 run). The webcam light switches on when the gspca module loads, stays on throughout, and after the application finishes as well. The brightness is normal, ie I can see myself clearly.

Using the new gspca_main/gspca_spca561 modules on kernel 2.6.27 I see output below (gspca_main/gspca_spca561 run). The webcam light switches on when the modules are loaded, stays on until spcaview exits, at which point it switches off. It then stays off until the modules are reloaded. The brightness is very low indeed - I can hardly make myself out.

The main difference between the two outputs (old then new) seems to be:

---------------------------------------------------
Camera found: Logitech QuickCam EC
Bridge found: SPCA561
Bridge find SPCA561 number 9
StreamId: GBRG Camera
quality 0 autoexpo 1 Timeframe 0 lightfreq 50
Bridge find SPCA561 number 9

vs

Camera found: Camera
Bridge found: spca561
Unable to find a StreamId !!
StreamId: -1 Unknow Camera
----

and

----
VIDIOCGPICT
brightnes=16384 hue=0 color=0 contrast=8192 whiteness=0 depth=12 palette=15

vs

VIDIOCGPICT
brightnes=0 hue=0 color=0 contrast=0 whiteness=0
depth=8 palette=15
--------------------------------

brightness and contrast seem to be way off for the new modules.

So, I'm guessing that some attributes that previously were detected by gspca are being missed by gspca_spca561.

I am very keen to help make this work properly for gspca V2, but... I am not much of a C coder. If someone can tell me how to produce useful diagnostics, and/or point me at some code to fiddle I'm willing to have a go. However - I'd be best at testing someone else's patches!

dmesg for the gspca_main/gspca_spca561 modules is:

[   28.308979] gspca: main v2.3.0 registered
[   28.333195] gspca: probing 046d:092e
[   28.531364] gspca: probe ok
[   28.531603] spca561: registered

dmesg for the gspca module is:

[   40.140033] gspca: USB GSPCA camera found.(SPCA561A)
[   40.140033] gspca: [spca5xx_probe:4275] Camera type S561
[   40.153846] gspca: [spca5xx_getcapability:1249] maxw 352 maxh 288
minw 160 minh 120
[   40.153907] usbcore: registered new interface driver gspca
[   40.153910] gspca: gspca driver 01.00.20 registered
[   65.614301] gspca: [spca561_init:467] Find spca561 USB Product ID 92e
[   65.828003] gspca: [spca5xx_set_light_freq:1932] Sensor currently not

support light frequency banding filters.

Regards
Ian

---------------------
gspca V1 run
---------------------

ipic@ian2 ~/bin $ spcaview -d /dev/video_webcam
Spcaview version: 1.1.7 date: 06:11:2006 (C) [email protected]
Initializing SDL.
SDL initialized.
bpp 3 format 15
Using video device /dev/video_webcam.
Initializing v4l.
**************** PROBING CAMERA ********************* Camera found: Logitech QuickCam EC
Bridge found: SPCA561
Bridge find SPCA561 number 9
StreamId: GBRG Camera
quality 0 autoexpo 1 Timeframe 0 lightfreq 50
Bridge find SPCA561 number 9

Available Resolutions width 352  heigth 288 native
Available Resolutions width 320  heigth 240 native *
Available Resolutions width 176  heigth 144 native
Available Resolutions width 160  heigth 120 native

unable to probe size !!
*****************************************************
grabbing method default MMAP asked
VIDIOCGMBUF size 2457616 frames 2 offets[0]=0 offsets[1]=1228808 VIDIOCGPICT
brightnes=16384 hue=0 color=0 contrast=8192 whiteness=0 depth=12 palette=15
VIDIOCSPICT
brightness=16384 hue=0 color=0 contrast=8192 whiteness=0 depth=24 palette=15

Stop asked

Used 19966ms for 244 images => 81ms/image 12fps.
Quiting SDL.
Decoded frames:244 Average decode time: 1.000000
unmapping
closing
closed
Destroy Picture thread ...
Quiting....

----------------------------
gspca_main/gspca_spca561 run
----------------------------
ipic@ian2 ~/bin $ LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so spcaview -d /dev/video_webcam

Spcaview version: 1.1.7 date: 06:11:2006 (C) [email protected]
Initializing SDL.
SDL initialized.
bpp 3 format 15
Using video device /dev/video_webcam.
Initializing v4l.
**************** PROBING CAMERA ********************* Camera found: Camera
Bridge found: spca561
Unable to find a StreamId !!
StreamId: -1 Unknow Camera

Available Resolutions width 640  heigth 480 native
Available Resolutions width 352  heigth 288 native
Available Resolutions width 320  heigth 240 native *
Available Resolutions width 176  heigth 144 native
Available Resolutions width 160  heigth 120 native

unable to probe size !!
*****************************************************
grabbing method default MMAP asked
VIDIOCGMBUF size 67108864 frames 4 offets[0]=0 offsets[1]=16777216 VIDIOCGPICT
brightnes=0 hue=0 color=0 contrast=0 whiteness=0
depth=8 palette=15
VIDIOCSPICT
brightness=0 hue=0 color=0 contrast=0 whiteness=0 depth=24 palette=15

Stop asked

Used 2131ms for 63 images => 33ms/image 29fps.
Quiting SDL.
Decoded frames:63 Average decode time: 0.000000
unmapping
closing
closed
Destroy Picture thread ...
Quiting....

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#1 lore raw
Quoted 17 lines · Ian Pickworth

Running my Logitec cheapo webcam on gspca V2, the result is not as good as when I previously used gspca V1 freestanding (20071224).

Specifically, under V2:
The picture is very, very dark - can hardly make it out. The webcam light switches off after first use, and stays off.

The second may or may not be a problem, but I'm assuming that the light is signaling something useful, thus its state seems important.

To test the webcam, I'm using spcaview.

Using the freestanding (V1) gspca module on kernel 2.6.26, I see output below (gspca V1 run). The webcam light switches on when the gspca module loads, stays on throughout, and after the application finishes as well. The brightness is normal, ie I can see myself clearly.

Quoted 5 lines

Using the new gspca_main/gspca_spca561 modules on kernel 2.6.27 I see output below (gspca_main/gspca_spca561 run). The webcam light switches on when the modules are loaded, stays on until spcaview exits, at which point it switches off. It then stays off until the modules are reloaded. The brightness is very low indeed - I can hardly make myself out.

Hi Ian,

Thanks for including so much details in you report, this certainly makes things much easier for us!

Quoted 5 lines

----
VIDIOCGPICT
brightnes=16384 hue=0 color=0 contrast=8192 whiteness=0 depth=12 palette=15

Quoted 9 lines

vs

VIDIOCGPICT
brightnes=0 hue=0 color=0 contrast=0 whiteness=0
depth=8 palette=15
--------------------------------

brightness and contrast seem to be way off for the new modules.

This is normal, you have a revison 12a spca561 (I can tell from your usb-id), this does not have brightness nor contrast controls, hence they show as 0. It does have exposure and gain controls which used to be mapped to contrast and brightness in gspcav1 as there was no way to express these controls in v4l1, the new gspcav2 exports these as exposure and gain, iow as what they are.

However since you're using a v4l1 application, you cannot control these now. You can use a separate v4l2 controlpanel application (google for, download, and install v4l2ucp) to control these settings. You can run this in parallel to spcaview. You will want to crank up exposure, I really need to add software autoexposure to libv4l for these cams to adjust this automatically to lighting conditions.

<snip>

Notice gspcav1:

Quoted 1 line

Used 19966ms for 244 images => 81ms/image 12fps.

Note an exposure time of 81 ms / frame.

Quoted 3 lines

----------------------------
gspca_main/gspca_spca561 run
----------------------------

<snip>

Quoted 1 line

Used 2131ms for 63 images => 33ms/image 29fps.

Note an exposure time of 33 ms / frame, so thats 2.5 times as short an exposure, and thus 2.5 times as dark a picture.

Regards,

Hans

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#2 lore raw
Quoted 5 lines · Hans de Goede
Quoted 5 lines

Ian Pickworth wrote:
Hi Ian,

Thanks for including so much details in you report, this certainly makes things much easier for us!

So far your advice back is 100% - thank you very much.

Quoted 7 lines
Quoted 7 lines

This is normal, you have a revison 12a spca561 (I can tell from your usb-id), this does not have brightness nor contrast controls, hence they show as 0. It does have exposure and gain controls which used to be mapped to contrast and brightness in gspcav1 as there was no way to express these controls in v4l1, the new gspcav2 exports these as exposure and gain, iow as what they are.

Quoted 7 lines
Quoted 7 lines

However since you're using a v4l1 application, you cannot control these now. You can use a separate v4l2 controlpanel application (google for, download, and install v4l2ucp) to control these settings. You can run this in parallel to spcaview. You will want to crank up exposure, I really need to add software autoexposure to libv4l for these cams to adjust this automatically to lighting conditions.

Downloaded v4l2ucp, ./configure, make and then ran v4l2ucp. Bingo - webcam is way better than it ever was under gspca V1, and I can now adjust it for background light conditions.

Result - many thanks. Now Skype, mplayer and spcaview all show crisp pictures.

Now I just have to work out how to get cheese to work. No good documentation for adjusting the gstreamer pipe it uses. Seems to be picking up the TV tuner card rather than the webcam - despite setting the source in gstreamer-propeties (and the test there working). Ho hum - more digging.

Thanks
Regards
Ian

(Original reply not sent to list - sorry)

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list