# Installing Z-Star Microelectronics Corp. ZC0301 Webcam

## fernandoc1

I need help installing Z-Star Microelectronics Corp. ZC0301 Webcam on Gentoo.

I already tried the tutorial at http://en.gentoo-wiki.com/wiki/Webcam and in kernel 2.6.31-gentoo-r6 there is no option in Multimedia devices to enable webcam support on kernel.

I tried compiling gspca drivers from http://mxhaard.free.fr/download.html and it doesn't compile with the newer kernel code.

Can someone help me?

----------

## SamuliSuominen

The gspca drivers are included in kernel.

Post output of `lsusb` here. The device ID, for example 046d:c050 will tell us what camera it really is.

----------

## fernandoc1

```

Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 004 Device 002: ID 0ac8:301b Z-Star Microelectronics Corp. ZC0301 Webcam

Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

```

----------

## SamuliSuominen

Quick `grep` in /usr/src/linux revealed,

Documentation/video4linux/gspca.txt:zc3xx		0ac8:301b	Z-Star zc301b

Documentation/video4linux/zc0301.txt:0x0ac8     0x301b

drivers/media/video/gspca/zc3xx.c:/* mi0360soc and pb0330 from vm30x.inf for 0ac8:301b and 0ac8:303b 07/02/13 */

drivers/media/video/gspca/zc3xx.c:	{USB_DEVICE(0x0ac8, 0x301b)},

So the driver for your webcam is called "zc3xx" and it's included in the kernel.

Then, in "make menuconfig" you can hit / button for search, type zc3xx there... 

Symbol: USB_GSPCA_ZC3XX [=n]                                                                                                 │  

  │ Prompt: ZC3XX USB Camera Driver                                                                                              │  

  │   Defined at drivers/media/video/gspca/Kconfig:288                                                                           │  

  │   Depends on: MEDIA_SUPPORT [=n] && VIDEO_CAPTURE_DRIVERS [=n] && V4L_USB_DRIVERS [=n] && USB [=y] && VIDEO_V4L2 [=n] && USB │  

  │   Location:                                                                                                                  │  

  │     -> Device Drivers                                                                                                        │  

  │       -> Multimedia support (MEDIA_SUPPORT [=n])                                                                             │  

  │         -> Video capture adapters (VIDEO_CAPTURE_DRIVERS [=n])                                                               │  

  │           -> V4L USB devices (V4L_USB_DRIVERS [=n])                                                                          │  

  │             -> GSPCA based webcams (USB_GSPCA [=n])

----------

## fernandoc1

Now the driver works, and I got a /dev/video0 file.

But the camera only shows a black screen on amsn. I think that this driver does not match to the camera, because even on Ubuntu it doesn't work properly.

The camera works on ms windows inside a virtual machine with the driver ZC0301PL that can be found at http://www.vimicro.com/english/product/pc003.htm.

----------

## SamuliSuominen

`emerge -av libv4l` and try the post emerge instructions... perhaps something like...

```

LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so amsn

```

or if you are using stable libv4l, try latest in ~arch, 0.6.4

note: only guessing here   :Smile: 

----------

## fernandoc1

The same result: a black screen.

Is there another suggestion?

----------

## s4e8

I have a ZC301 webcam, and got blank screen if plugin into mainboard directly. It only work when I plugin it into USB1 hub.

----------

## Fernandenhoff

I had the same problem with my zc0305b webcam. I solved the broblem changin the in-kernel gspca module, changing the sensor routine.

Try this patch.

```
--- zc3xx.c     2010-02-24 15:52:17.000000000 -0300

+++ zc3xx.patch 2010-04-29 22:55:10.000000000 -0300

@@ -7228,7 +7228,7 @@

        {USB_DEVICE(0x0698, 0x2003)},

        {USB_DEVICE(0x0ac8, 0x0301), .driver_info = SENSOR_PAS106},

        {USB_DEVICE(0x0ac8, 0x0302), .driver_info = SENSOR_PAS106},

-       {USB_DEVICE(0x0ac8, 0x301b)},

+       {USB_DEVICE(0x0ac8, 0x301b), .driver_info = SENSOR_TAS5130CXX},

        {USB_DEVICE(0x0ac8, 0x303b)},

        {USB_DEVICE(0x0ac8, 0x305b)},

        {USB_DEVICE(0x0ac8, 0x307b)},
```

----------

