NetBSD Problem Report #44926

From www@NetBSD.org  Mon May  2 12:29:20 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 8780A63B8AC
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  2 May 2011 12:29:20 +0000 (UTC)
Message-Id: <20110502122833.5ACA263B8AC@www.NetBSD.org>
Date: Mon,  2 May 2011 12:28:33 +0000 (UTC)
From: noud4@home.nl
Reply-To: noud4@home.nl
To: gnats-bugs@NetBSD.org
Subject: userland support for SN9C102 chip (cam)
X-Send-Pr-Version: www-1.0

>Number:         44926
>Category:       pkg
>Synopsis:       userland support for SN9C102 chip (cam)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon May 02 12:30:00 +0000 2011
>Closed-Date:    Tue May 03 01:01:46 +0000 2011
>Last-Modified:  Tue May 03 01:01:46 +0000 2011
>Originator:     B.ICT A.P. deBROUWER Jr.
>Release:        5.1
>Organization:
-none-
>Environment:
NetBSD 10.0.2.17 5.1 NetBSD 5.1 (GENERIC.nouadio.ugen) #0: Thu Apr 28 20:51:59 UTC 2011  root@10.0.2.17:/obj/sys/arch/i386/compile/GENERIC.nouadio.ugen i386
>Description:
A Chicony Electronics USB Cam having USB ID 0x6025 doesn't work.
We have SN9C101 support in graphics/snx101view but not SN9C102.
>How-To-Repeat:
You'd plug in a SN9C102 based cam.
>Fix:
(snx101view is made by Takafumi Mizuno <taka-qce@ls-a.jp>)
see these patches conform the existing code.
these give me vague image i.s.o. none,
unsure but think one has to add some sensor code to get a sharp image.

i'll email Takafumi Mizuno and ask him to include this patches,
or them could go as pkgsrc patches till accepted upstream by Takafumi Mizuno. (and yes all these userland cam progs should be turned into uvideo drivers)

--- snx101shot.c.orig	2010-12-10 11:20:15.000000000 +0100
+++ snx101shot.c	2010-12-10 11:20:31.000000000 +0100
@@ -56,6 +56,7 @@

 static struct usb_dev_info devslist [] = {
     { "Tama Electronic Corp. Z-102/Sweex USB MiniWebcam", SONIX_ID, 0x6005, 0x6005},
+    { "Chicony Electronics. USB Cam", SONIX_ID, 0x6025, 0x6025},
     { NULL }
 };

--- snx101view.c.orig	2010-12-10 11:20:10.000000000 +0100
+++ snx101view.c	2010-12-10 11:20:20.000000000 +0100
@@ -66,6 +66,7 @@

 static struct usb_dev_info devslist [] = {
     { "Tama Electronic Corp. Z-102/Sweex USB MiniWebcam", SONIX_ID, 0x6005, 0x6005},
+    { "Chicony Electronics. USB Cam", SONIX_ID, 0x6025, 0x6025},
     { NULL }
 };

--- sonix.c.orig	2010-12-10 18:41:54.000000000 +0100
+++ sonix.c	2010-12-10 18:44:47.000000000 +0100
@@ -94,6 +94,10 @@
 	urbnum = INIT6005_URBSNUM;
 	inits = init6005;
 	break;
+    case 0x6025:
+	urbnum = INIT6025_URBSNUM;
+	inits = init6025;
+	break;
     default:
 	fprintf(stderr, "Unknown sensor. The camera is not supported yet.\n");
 	return -1;
--- sonix.h	2010-12-10 16:05:53.000000000 +0100
+++ sonix.h.new	2010-12-10 16:06:09.000000000 +0100
@@ -40,7 +40,7 @@
     u_int16_t val;
     u_int16_t idx;
     u_int16_t len;
-#define LENNUM_MAX	31
+#define LENNUM_MAX	43
     u_int8_t data[LENNUM_MAX];
 } initURB_t;

--- sonixinit.h.orig	2004-03-07 17:05:13.000000000 +0100
+++ sonixinit.h	2010-12-10 18:40:08.000000000 +0100
@@ -1,4 +1,5 @@
 #define INIT6005_URBSNUM	31
+#define INIT6025_URBSNUM	31

 extern initURB_t init6005[INIT6005_URBSNUM];
-
+extern initURB_t init6025[INIT6025_URBSNUM];
--- sonixinit.c.orig	2004-03-07 17:04:59.000000000 +0100
+++ sonixinit.c	2010-12-10 18:40:01.000000000 +0100
@@ -65,3 +65,69 @@
 						 /* [29] */
 	{ ACT_WRITE, 0x0019, 0x0000, 0x0001, { 0xab /* MCK_SIZE=0xa=10 */ } },  /* [30] */
 };
+
+initURB_t init6025[INIT6025_URBSNUM] = {
+	{ ACT_SETIF, 0x0000, 0x00, 0x0000, { 0x00 } },  /* [0] */
+	{ ACT_SETIF, 0x0000, 0x08, 0x0000, { 0x00 } },  /* [1] */
+	{  ACT_READ, 0x0000, 0x0000, 0x0001, { 0x10 } },  /* [2] *//* read ID */
+	{ ACT_WRITE, 0x0001, 0x0000, 0x0001, { 0x04 } },  /* [3] */
+	{ ACT_WRITE, 0x0017, 0x0000, 0x0001, { 0x60 } },  /* [4] */
+	{ ACT_WRITE, 0x0001, 0x0000, 0x0020, { 0x44, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
+					       0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+					       0x01, /* R_GAIN */
+					       0x01, /* B_GAIN */
+					       0x01, /* G_GAIN */
+					       0x33, /* H_START(pixel) */
+					       0x09, /* V_START(pixel) */
+					       0x0a, /* Offset */
+					       0x14, /* H_SIZE */
+					       0x0f, /* V_SIZE */
+					       0x60,
+					       0x86, /* compression enable */
+					       0x2b,
+					       0x14, /* HO_SIZE 0x14*32=640 */
+					       0x0f, /* VO_SIZE 0x0f*32=480 */
+					       0x02, /* AE_STRX (horizontal) 2*32=64 */
+					       0x02, /* AE_STRY (vertical)   2*32=64 */
+					       0x12, /* AE_ENDX (horizontal) 9*32=288 */
+					       0x0d  /* AE_ENDY (vertical)   7*32=224 */ } },
+	 /* [5] */
+	{ ACT_WRITE, 0x0008, 0x0000, 0x0008, { 0x30, 0x11, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x10 } },  /* [6] */
+	{ ACT_WRITE, 0x0008, 0x0000, 0x0008, { 0x30, 0x11, 0x02, 0x20, 0xa9, 0x00, 0x00, 0x10 } },  /* [7] */
+	{ ACT_WRITE, 0x0015, 0x0000, 0x0002, { 0x14, /* H_SIZE  14h=20 20*32=640 */
+					       0x0f  /* V_SIZE  0fh=15 15*32=480 */ } },  /* [8] */
+	{ ACT_WRITE, 0x0018, 0x0000, 0x0001, { 0x86 } },  /* [9] *//* Compression */
+	{ ACT_WRITE, 0x0012, 0x0000, 0x0001, { 0x33 /* H_START (85) */ } },  /* [10] */
+	{ ACT_WRITE, 0x0013, 0x0000, 0x0001, { 0x09 /* V_START (31) */ } },  /* [11] */
+	{ ACT_WRITE, 0x0017, 0x0000, 0x0001, { 0x60 } },  /* [12] */
+	{ ACT_WRITE, 0x0017, 0x0000, 0x0001, { 0x60 } },  /* [13] */
+	{ ACT_WRITE, 0x0019, 0x0000, 0x0001, { 0x2b } },  /* [14] */
+	{ ACT_WRITE, 0x001c, 0x0000, 0x0004, { 0x02, /* AE_STRX 2*32=64 */
+					       0x02, /* AE_STRY 2*32=64 */
+					       0x12, /* AE_ENDX 18*32=576 */
+					       0x0d  /* AE_ENDX 13*32=416 */ } },  /* [15] */
+	{ ACT_WRITE, 0x0001, 0x0000, 0x0001, { 0x44 } },  /* [16] *//* Start Video transfer */
+#if 0
+	{ ACT_WRITE, 0x0018, 0x0000, 0x0002, { 0x86, 0x2b } },  /* [17] *//* Compression */
+#endif
+	{ ACT_WRITE, 0x0018, 0x0000, 0x0002, { 0x06, 0x2b } },  /* [17] *//* No compression */
+	{ ACT_WRITE, 0x001b, 0x0000, 0x0001, { 0x0f /* VO_SIZE 10*32=320 */ } },  /* [18] */
+	{ ACT_WRITE, 0x0008, 0x0000, 0x0008, { 0x30, 0x11, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x16 } },
+						 /* [19] */
+	{ ACT_WRITE, 0x0008, 0x0000, 0x0008, { 0x30, 0x11, 0x02, 0x20, 0x70, 0x00, 0x00, 0x1d } },
+						 /* [20] */
+	{  ACT_READ, 0x0008, 0x0000, 0x0001, { 0x00 } },  /* [21] */
+	{  ACT_READ, 0x0008, 0x0000, 0x0001, { 0x00 } },  /* [22] */
+	{ ACT_WRITE, 0x0008, 0x0000, 0x0008, { 0x30, 0x11, 0x02, 0x20, 0x70, 0x00, 0x00, 0x14 } },
+						 /* [23] */
+	{ ACT_WRITE, 0x001b, 0x0000, 0x0001, { 0x0f /* VO_SIZE 10*32=320 */ } },  /* [24] */
+	{ ACT_WRITE, 0x0008, 0x0000, 0x0008, { 0x30, 0x11, 0x00, 0xc0, 0x05, 0x00, 0x00, 0x16 } },
+						 /* [25] */
+	{ ACT_WRITE, 0x0008, 0x0000, 0x0008, { 0x30, 0x11, 0x02, 0x20, 0x60, 0x00, 0x00, 0x1d } },
+						 /* [26] */
+	{  ACT_READ, 0x0008, 0x0000, 0x0001, { 0x00 } },  /* [27] */
+	{  ACT_READ, 0x0008, 0x0000, 0x0001, { 0x00 } },  /* [28] */
+	{ ACT_WRITE, 0x0008, 0x0000, 0x0008, { 0x30, 0x11, 0x02, 0x20, 0x60, 0x00, 0x00, 0x14 } },
+						 /* [29] */
+	{ ACT_WRITE, 0x0019, 0x0000, 0x0001, { 0xab /* MCK_SIZE=0xa=10 */ } },  /* [30] */
+};
+

>Release-Note:

>Audit-Trail:
From: "B.ICT, A.P. deBROUWER Jr." <noud4@home.nl>
To: Takafumi Mizuno <taka-qce@ls-a.jp>
Cc: gnats-bugs@NetBSD.org
Subject: Re: pkg/44926: userland support for SN9C102 chip (cam)
Date: Mon, 02 May 2011 12:42:27 +0000

 --=-Y2y8EXgtpFDyvzh9wh3n
 Content-Type: text/plain; charset="us-ascii"
 Content-Transfer-Encoding: quoted-printable

 Hi Takafumi Mizuno,

 First of all my condoleance the earthquake victims!,
 plus .. hope you are still alive.

 euu..code.. i have a Chicony Electronics USB Cam having USB ID 0x6025.
 i suspect a SN9C102 chip inside, in gnats included patches gave me an
 image.

 i could not find a (public) place to post the patches so i did put them
 http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=3D44926

 greetings,
 Noud

 On Mon, 2011-05-02 at 12:30 +0000, gnats-admin@netbsd.org wrote:
 > Thank you very much for your problem report.
 > It has the internal identification `pkg/44926'.
 > The individual assigned to look at your
 > report is: pkg-manager.=20
 >=20
 > >Category:       pkg
 > >Responsible:    pkg-manager
 > >Synopsis:       userland support for SN9C102 chip (cam)
 > >Arrival-Date:   Mon May 02 12:30:00 +0000 2011
 >=20

 --=20
 PLUNDERER'S THEME (to Supercalifragilisticexpialidocius) Pillage, rape,
 and loot and burn, but all in moderation. If you do the things we say,
 then you'll soon rule the nation. Kill your foes and enemies and then
 kill your relations. Pillage, rape, and loot and burn, but all in
 moderation. ..brought to you by NetBSD 5.1 (GENERIC.nouadio.ugen) #0:
 Thu Apr 28 20:51:59 UTC 2011 Welcome to NetBSD! ..apropos: Have a peek
 at http://en.wikipedia.org/wiki/List_of_Dutch_painters from time to
 time.

 --=-Y2y8EXgtpFDyvzh9wh3n
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: This is a digitally signed message part

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (NetBSD)

 iEYEABECAAYFAk2+pq4ACgkQUmHcLyC5i6bZ+gCghN43AbXY7bMOsVp8IDmM5dR2
 0egAniGv2iyd0gl/U+npYQQgM20JZwqa
 =EdQ3
 -----END PGP SIGNATURE-----

 --=-Y2y8EXgtpFDyvzh9wh3n--

State-Changed-From-To: open->closed
State-Changed-By: obache@NetBSD.org
State-Changed-When: Tue, 03 May 2011 01:01:46 +0000
State-Changed-Why:
It had been removed from pkgsrc-HEAD.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.