Random Noise

cat /dev/random >> /dev/dsp

Archive for February 2008

Asus G1S-A1 1.3M Pixel webcam adventure

with 3 comments

I use gentoo linux on my laptop (G1S-A1). Everything is working including wireless, bluetooth, media keys etc.
The only thing that annoys me is when I use skype beta (with video) or any other webcam utility. The webcam image is 180° inverted!! I know it sounds funny..but its annoying after a while… Anyway, as usual I set out on the quest 😀 to find out the cause and possible remedy. A quick lsusb gives tells me that the device id and vendor id information.

localhost ~# lsusb
Bus 002 Device 001: ID 0000:0000
Bus 007 Device 002: ID 0b05:1712 ASUSTek Computer, Inc.
Bus 007 Device 001: ID 0000:0000
Bus 006 Device 001: ID 0000:0000
Bus 005 Device 002: ID 046d:c521 Logitech, Inc.
Bus 005 Device 001: ID 0000:0000
Bus 001 Device 003: ID 0b05:1726 ASUSTek Computer, Inc.
Bus 001 Device 002: ID 174f:5a35
Bus 001 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000

To get more information about the webcam from vendor/device id

localhost ~ # lsusb -v -d 174f:5a35

iManufacturer 2 Sonix Technology Co., Ltd.
iProduct 1 USB 2.0 Camera

I tried to google the combination of device id and sonix to find any information about the camera. But it turned out that there is no such device manufactured/assembled by Sonix. I was curious and I thought lets see what the windows driver for this webcam has to say. I rebooted into Vista and bingo! the device information clearly mentions D-Max/Sonix 1.3M pixel camera. All the description regarding their camera modules can be found their website. Two weeks ago I was able to find the module along with device id mentioned. Unfortunately today I’m unable to locate the 5A35 module on that page because all the camera modules have generic names now(e.g 1.3M_UVC 5). I couldn’t find any cached page on google either. Looks like they D-Max doesn’t want to disclose that information.

On further digging through windows driver files, snp2uvc.inf (version 04/18/2007, reveals some cool information.

%SN.USBVideo.DeviceDesc% = SN.USBVideo.XP,USB\VID_174f&PID_5a35 ;GD-5A35A(Ov9655)
%SN.USBVideo.DeviceDesc% = SN.USBVideo.XP,USB\VID_174f&PID_5a31 ;GD-5A31A(MI1320)
%SN.USBVideo2M.DeviceDesc% = SN.USBVideo2M.XP,USB\VID_174f&PID_5a51 ;GD-5A51A
%SN.USBVideoVGA.DeviceDesc% = SN.USBVideoVGA.XP,USB\VID_174f&PID_5a11 ;GD-5A11A(Ov7670)

Hmm…After searching for GD-5A35A I found this cached link that links 5A35 to the generic model number that is 1.3M_UVC 1. So, here are the specifications:

1.3M_UVC 1 USB 2.0 1.3MP Camera Module Support UVC


• SXGA Resolution Image Sensor
•Video Resolution:
1280 x 1024, 1280 x 800
1204 x 768, 800 x 600
640 x 480, 352 x 288
320 x 240.
•Frame Rate:
640 x 480 at 30fps maximum
1280 x 1024 at 8fps maximum
•Video Format: YUY2
•LED Indicator
•DOF on 30~80cm
•Support UVC
•Auto Exposure
•Auto White Balance Control
•High Speed USB 2.0 Interface
•Low Power Consumption
•RoHS Compliant
•Dimension(LxWxH) 60 x 8.5 x 7.05mm

On careful inspection of snp2uvc.inf you can see that my webcam uses OV9655 sensor – cool! And the datasheet for that can be found here: http://rapidshare.com/files/94672360/OV9655-datasheet.pdf.html

Interestingly the newer version of the webcam driver doesn’t specify the sensor (OV9655) or the model number (GD-5A35A) information.

Most of the datasheet information went over my head except some interesting bits.
If you skip to “Register Set” and checkout register 1E :

1E MVFP 00 RW  Mirror / Vertical Flip Enable                

Bit[7:6] Reserved                
Bit[5]   Mirror                  
    0: Normal Image                  
    1: Mirror Image                
Bit[4]   Vertical Flip                  
    0: Vertical Flip Disable                  
    1: Vertical Flip Enable                
Bit[3:0] Reserved

Default value for bit[4] is 0, i.e VFlip is disabled. We get upside down image which means that the webcam module is installed upside down on G1S-A1, so the linux uvc driver must find a way to set the bit[4] of this register.

I’m reading through uvc-linux source to understand the driver and make appropriate changes. But it can take sometime… Sole purpose of this blog entry is to inform you guys about my findings, so someone with the right knowledge can add the vflip support for this webcam.

Written by Vivek Unune

February 24, 2008 at 11:08 pm