introduce gspca-stk1135: Syntek STK1135 driver
Subsystems (2)
RFC PATCH 1/1 introduce gspca-stk1135: Syntek STK1135 driver
Hello,
this is a new gspca driver for Syntek STK1135 webcams. The code is completely new, but register values are based on Syntekdriver (stk11xx) by Nicolas VIVIEN
(http://syntekdriver.sourceforge.net).
Only one webcam type is supported now - vendor 0x174f, device 0x6a31. It's Asus F5RL laptop flippable webcam with MT9M112.
The camera works better than in Windows - initializes much faster and provides more resolutions (the sensor can do almost any resolution - just add it to the stk1135_modes[] - could this feature be somehow used by applications to avoid SW scaling?).
Autoflip works too - when the camera is flipped around, the image is flipped automatically.
drivers/media/usb/gspca/Kconfig +9 -0
@@ -338,6 +338,15 @@ config USB_GSPCA_STK014 To compile this driver as a module, choose M here: the module will be called gspca_stk014. +config USB_GSPCA_STK1135 + tristate "Syntek STK1135 USB Camera Driver" + depends on VIDEO_V4L2 && USB_GSPCA + help + Say Y here if you want support for cameras based on the STK1135 chip. + + To compile this driver as a module, choose M here: the + module will be called gspca_stk1135. + config USB_GSPCA_STV0680 tristate "STV0680 USB Camera Driver" depends on VIDEO_V4L2 && USB_GSPCA
drivers/media/usb/gspca/Makefile +2 -0
@@ -34,6 +34,7 @@ obj-$(CONFIG_USB_GSPCA_SQ905C) += gspca_sq905c.o obj-$(CONFIG_USB_GSPCA_SQ930X) += gspca_sq930x.o obj-$(CONFIG_USB_GSPCA_SUNPLUS) += gspca_sunplus.o obj-$(CONFIG_USB_GSPCA_STK014) += gspca_stk014.o +obj-$(CONFIG_USB_GSPCA_STK1135) += gspca_stk1135.o obj-$(CONFIG_USB_GSPCA_STV0680) += gspca_stv0680.o obj-$(CONFIG_USB_GSPCA_T613) += gspca_t613.o obj-$(CONFIG_USB_GSPCA_TOPRO) += gspca_topro.o
@@ -78,6 +79,7 @@ gspca_sq905-objs := sq905.o gspca_sq905c-objs := sq905c.o gspca_sq930x-objs := sq930x.o gspca_stk014-objs := stk014.o +gspca_stk1135-objs := stk1135.o gspca_stv0680-objs := stv0680.o gspca_sunplus-objs := sunplus.o gspca_t613-objs := t613.o
drivers/media/usb/gspca/stk1135.c new file +671 -0
671 lines not on this page · raw message
Signature · 1 line
Ondrej Zary
Hi,
Quoted 10 lines · Ondrej Zary
Hello,
this is a new gspca driver for Syntek STK1135 webcams. The code is completely new, but register values are based on Syntekdriver (stk11xx) by Nicolas VIVIEN
(http://syntekdriver.sourceforge.net).Only one webcam type is supported now - vendor
0x174f, device0x6a31. It's Asus F5RL laptop flippable webcam with MT9M112.The camera works better than in Windows - initializes much faster and provides more resolutions
You've certainly done this quickly, many thanks for working on this!
Looks good. Any reason why this is RFC, iow any reason why I should not add this to my tree and include it in my next pullreq to Mauro ?
Quoted 2 lines
Autoflip works too - when the camera is flipped around, the image is flipped automatically.
Cool, but I've some comments on the implementation:
1) It seems autoflip and manual flip with controls conflict, the manual setting will be overwritten as soon as the switch is debounced. I think it would be best to make the manual setting invert (when on) the setting detected from the switch
2) You make the switch control both hflip and vflip, but the way the flipping works the sensor is not turned upside down, but rotated over its x-axis, so you should only set vflip based on the switch if I'm not mistaken. To verify this take a piece of paper, and write on it with large letters "HELLO" then hold it in front of the camera. It should read normally on the screen. I believe that in one of the 2 orientations of the camera it will be mirrored now since you set hflip while it should not be set
3) Once debounced is over 100, you re-set hflip and vflip every frame, this causes expensive USB IO, so please cache the current setting and only change it if it actually needs to change
If you can do a new version with these 3 things fixed I'll happily pull it into my tree!
Regards,
Hans
Quoted 22 lines · On Sunday 11 August 2013 11:26:18 Hans de Goede wrote:
Hi,
Quoted 10 lines · Ondrej Zary
Hello,
this is a new gspca driver for Syntek STK1135 webcams. The code is completely new, but register values are based on Syntekdriver (stk11xx) by Nicolas VIVIEN (http://syntekdriver.sourceforge.net).Only one webcam type is supported now - vendor
0x174f, device0x6a31. It's Asus F5RL laptop flippable webcam with MT9M112.The camera works better than in Windows - initializes much faster and provides more resolutions
You've certainly done this quickly, many thanks for working on this!
Looks good. Any reason why this is RFC, iow any reason why I should not add this to my tree and include it in my next pullreq to Mauro ?
Quoted 2 lines
Autoflip works too - when the camera is flipped around, the image is flipped automatically.
Quoted 6 lines
Cool, but I've some comments on the implementation:
1) It seems autoflip and manual flip with controls conflict, the manual setting will be overwritten as soon as the switch is debounced. I think it would be best to make the manual setting invert (when on) the setting detected from the switch
Yes, that's a problem. Too bad that there's no "autorotate" control in V4L2. Inverting seems like a good idea.
Quoted 8 lines
2) You make the switch control both hflip and vflip, but the way the flipping works the sensor is not turned upside down, but rotated over its x-axis, so you should only set vflip based on the switch if I'm not mistaken. To verify this take a piece of paper, and write on it with large letters "HELLO" then hold it in front of the camera. It should read normally on the screen. I believe that in one of the 2 orientations of the camera it will be mirrored now since you set hflip while it should not be set
I thought that too at first - and changed only vflip. Then noticed that the image is mirrored when the camera is flipped to the back.
When the sensor is rotated over its x-axis, the "left" side of the sensor will be on the right side (when you look from the back of the laptop).
Quoted 3 lines
3) Once debounced is over 100, you re-set hflip and vflip every frame, this causes expensive USB IO, so please cache the current setting and only change it if it actually needs to change
When debounce gets over 100, flip_status is inverted (so it matches the current state reported by camera). Thus, debounce is not incremented in sd_pkt_scan but reset to 0 instead.
Maybe the code could be re-arranged somehow to make this more clear.
Quoted 2 lines
If you can do a new version with these 3 things fixed I'll happily pull it into my tree!
Working on it now.
Signature · 1 line
Ondrej Zary