# Webcam Help

## gentoo_newguy

Hi I have a built in webcam and was wondering how i would being to configure. 

Feel a bit silly posting all the time. 

Atm having problems with webcam , bluetooth and wireless

Just trying to get everything working. 

Could anyone point me in the right direction so i can get started ? 

Here is the output of lspci  

```

CircleMaster ~ # lspci

00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03)

00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03)

00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)

00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)

00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)

00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02)

00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02)

00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02)

00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)

00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)

00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)

00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 02)

00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)

02:00.0 Ethernet controller: Atheros Communications Inc. AR242x 802.11abg Wireless PCI Express Adapter (rev 01)

03:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8040 PCI-E Fast Ethernet Controller (rev 13)

```

Thanks for all your support Gentoo [/profile]

----------

## NeddySeagoon

gentoo_newguy,

Your bluetooth and webcam are not listed there, they are probably internal USB devices.

Please post the content of /proc/bus/usb/devices

Your wireless needs the Atheros wireless driver in recent kernels. Try 2.6.28 if you don't have it already.

Don't be ashamed to post here, I do it all the time.  While you are waiting for replies to you your own questions, have a look round for questions you can answer. Keep in mind that an expert is someone who knows more than you do, so you are somebody elses expert.

----------

## gentoo_newguy

For some reason i am not able to post the out put 

CircleMaster ~ # /proc/bus/usb/devices 

/proc/bus/usb/devices: Permission denied

I am the root user though

----------

## NeddySeagoon

gentoo_newguy,

Does the file exist ?

If not, your USB support in the kernel is not correct.

Post the output of lsub.  Thats provided by usbutils in case you don't have it

----------

## gentoo_newguy

the output of lsusb is 

```
Bus 001 Device 003: ID 0ac8:c326 Z-Star Microelectronics Corp. 

Bus 001 Device 001: ID 1d6b:0002  

Bus 005 Device 001: ID 1d6b:0001  

Bus 004 Device 001: ID 1d6b:0001  

Bus 003 Device 002: ID 0a5c:2101 Broadcom Corp. 

Bus 003 Device 001: ID 1d6b:0001  

Bus 002 Device 001: ID 1d6b:0001  

```

Not sure if it exists or not . 

It just says No such file or directory

So i guess it does not exist

----------

## NeddySeagoon

gentoo_newguy,

Your webcam is 

```
0ac8:c326 Z-Star Microelectronics Corp.
```

and uses the uvc driver in the kernel from about 2.6.26.

0a5c:2101 Broadcom Corp. is your bluetooth too.

Both devices need basic USB support, at least par of which you have missing.

There is additional bluetooth support in the kernel.

```
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)

00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02) 
```

Tells that you need both EHCI and UHCI support for your USB root hubs. You will also need usbfs support, so you get /proc/bus/usb/devices.

Thats not all, but it will point you in the right direction.  Be sure to read the help in the kernel

----------

## gentoo_newguy

Needy i will have a play around in my kernel in a minute 

Do i just need to find where uvc driver is in my kernel ? 

I will try doing one thing at a time as i get myself in a bit of a muddle

----------

## NeddySeagoon

gentoo_newguy,

First, you need support for your USB hardware on the motherboard.

In make.conf press / and enter ehci, go there and enable it.

Repeat for uhci.

uvc is more tricky, it depends on other things, like Video For Linux.

Try searching for uvc, is its not there, try video.

----------

## gentoo_newguy

Do u mean add them to my use flags or in my kernelLast edited by gentoo_newguy on Tue Mar 31, 2009 8:19 pm; edited 1 time in total

----------

## gentoo_newguy

Both of these were already enbaled in my kernel. 

Shall i enable video for linux ?

Also  /proc/bus/usb/ is a direcotry 

But when u add  /proc/bus/usb/devices thats when permissions are denied

Shall i just follow the webcam wiki now ?

----------

## NeddySeagoon

gentoo_newguy,

Its all kernel options.  Does your kernel have   

```
[*]     USB device filesystem
```

enabled ?

Thats what creates /proc/bus/usb/devices.  Lots of things use that file to find your USB devices

----------

## foxicatko

 *gentoo_newguy wrote:*   

> For some reason i am not able to post the out put 
> 
> CircleMaster ~ # /proc/bus/usb/devices 
> 
> /proc/bus/usb/devices: Permission denied
> ...

 

Looks like you're trying to execute a regular file. Try

```
cat /proc/bus/usb/devices
```

instead.

----------

## gentoo_newguy

hey man the output to that is messy 

```
T:  Bus=05 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2

B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0

D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=1d6b ProdID=0001 Rev= 2.06

S:  Manufacturer=Linux 2.6.27-gentoo-r8 uhci_hcd

S:  Product=UHCI Host Controller

S:  SerialNumber=0000:00:1d.3

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms

T:  Bus=04 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2

B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0

D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=1d6b ProdID=0001 Rev= 2.06

S:  Manufacturer=Linux 2.6.27-gentoo-r8 uhci_hcd

S:  Product=UHCI Host Controller

S:  SerialNumber=0000:00:1d.2

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms

T:  Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2

B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0

D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=1d6b ProdID=0001 Rev= 2.06

S:  Manufacturer=Linux 2.6.27-gentoo-r8 uhci_hcd

S:  Product=UHCI Host Controller

S:  SerialNumber=0000:00:1d.1

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms

T:  Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=12  MxCh= 0

D:  Ver= 2.00 Cls=e0(unk. ) Sub=01 Prot=01 MxPS=64 #Cfgs=  1

P:  Vendor=0a5c ProdID=2101 Rev= 3.54

S:  Manufacturer=Broadcom Corp

S:  Product=BCM92045NMD

S:  SerialNumber=002269C832AD

C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=  0mA

I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(unk. ) Sub=01 Prot=01 Driver=(none)

E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms

E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=(none)

E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms

E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms

I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=(none)

E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms

E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms

I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=(none)

E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms

E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms

I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=(none)

E:  Ad=83(I) Atr=01(Isoc) MxPS=  32 Ivl=1ms

E:  Ad=03(O) Atr=01(Isoc) MxPS=  32 Ivl=1ms

I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=(none)

E:  Ad=83(I) Atr=01(Isoc) MxPS=  64 Ivl=1ms

E:  Ad=03(O) Atr=01(Isoc) MxPS=  64 Ivl=1ms

I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=(none)

E:  Ad=83(I) Atr=01(Isoc) MxPS=  64 Ivl=1ms

E:  Ad=03(O) Atr=01(Isoc) MxPS=  64 Ivl=1ms

I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)

E:  Ad=84(I) Atr=02(Bulk) MxPS=  32 Ivl=0ms

E:  Ad=04(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms

I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=00 Driver=(none)

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2

B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0

D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=1d6b ProdID=0001 Rev= 2.06

S:  Manufacturer=Linux 2.6.27-gentoo-r8 uhci_hcd

S:  Product=UHCI Host Controller

S:  SerialNumber=0000:00:1d.0

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 8

B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0

D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=1d6b ProdID=0002 Rev= 2.06

S:  Manufacturer=Linux 2.6.27-gentoo-r8 ehci_hcd

S:  Product=EHCI Host Controller

S:  SerialNumber=0000:00:1d.7

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=07 Cnt=01 Dev#=  3 Spd=480 MxCh= 0

D:  Ver= 2.00 Cls=ef(unk. ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1

P:  Vendor=0ac8 ProdID=c326 Rev= 1.00

S:  Manufacturer=Vimicro Corp.

S:  Product=Namuga 1.3M Webcam

C:* #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=320mA

A:  FirstIf#= 0 IfCount= 2 Cls=0e(video) Sub=03 Prot=00

I:* If#= 0 Alt= 0 #EPs= 1 Cls=0e(video) Sub=01 Prot=00 Driver=(none)

E:  Ad=81(I) Atr=03(Int.) MxPS=  10 Ivl=2ms

I:* If#= 1 Alt= 0 #EPs= 0 Cls=0e(video) Sub=02 Prot=00 Driver=(none)

I:  If#= 1 Alt= 1 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=(none)

E:  Ad=82(I) Atr=05(Isoc) MxPS= 128 Ivl=125us

I:  If#= 1 Alt= 2 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=(none)

E:  Ad=82(I) Atr=05(Isoc) MxPS= 512 Ivl=125us

I:  If#= 1 Alt= 3 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=(none)

E:  Ad=82(I) Atr=05(Isoc) MxPS=1024 Ivl=125us

I:  If#= 1 Alt= 4 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=(none)

E:  Ad=82(I) Atr=05(Isoc) MxPS=1536 Ivl=125us

I:  If#= 1 Alt= 5 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=(none)

E:  Ad=82(I) Atr=05(Isoc) MxPS=2048 Ivl=125us

I:  If#= 1 Alt= 6 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=(none)

E:  Ad=82(I) Atr=05(Isoc) MxPS=2688 Ivl=125us

I:  If#= 1 Alt= 7 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=(none)

E:  Ad=82(I) Atr=05(Isoc) MxPS=3072 Ivl=125us

```

----------

## gentoo_newguy

Neddy that is enabled in my kernel . 

I wonder why it is not working .

In the webcam guide it tells me to emerge this package for uvc drivers 

(install media-video/linux-uvc for <2.6.26 kernels): supports many webcams following the UVC specification. List of supported devices at http://linux-uvc.berlios.de

This is a masked package is it safe for me to do this ?

----------

## foxicatko

 *NeddySeagoon wrote:*   

> gentoo_newguy,
> 
> Your webcam is 
> 
> ```
> ...

 

This is probably why the linux-uvc package is masked for you, the driver is already included in your kernel. You just need to enable it under Device drivers->Multimedia devices->Video capture adapters->V4L USB devices.

----------

## gentoo_newguy

Ok im getting somewhere . 

I have everything installed as far as i no im trying to use a webcam viewer its telling me 

cannot connect to /dev/video0

----------

## NeddySeagoon

gentoo_newguy,

To pretty up /proc/bus/usb/devices, 

```
emerge usbview
```

It shows you a graphical view of your USB tree.

UVC is Video For Linux 2 only, so you must use a vewer that supports v4l2.

Do you have a /dev/video0?

It may be /dev/v4l/video0, then /dev/video0 should be a symlink.

What viewer are you using?

Looking at your /proc/bus/usb/devices in usbview, your webcam and bluetooth both appear in red, which means the kernel drivers are not loaded for them.

----------

## gentoo_newguy

Neddy. 

I am using camaroma for my video viewer. 

what viewers support v4l2 ? 

I have neither of those devices. 

/dev/video0

/dev/v4l/video0

You are right they are both coming up in red. 

How do i load the kernel driver for them. 

Sorry if i am being a pain

----------

## NeddySeagoon

gentoo_newguy,

If you complied the kernel driver as a module, you do 

```
modprobe <module_name>
```

If that fails, the module is not built.

Were the module built into the kernel, it would be loaded by grub with the rest of the kernel.

I don't have camaroma but v4l2 isn't your problem yet.

----------

## gentoo_newguy

its not compiled as a module 

Should i compile it as a module ? 

Aghh this is real hard work . 

But i refuse to use windows

Can i post my kernel config for you to check . 

This is killing me 

How do i go about posting my kernel config

----------

## gentoo_newguy

Neddy i have it compiled in as a module 

We are starting to get somewhere it no longer appears in red. 

I now have a v4l directory but it only contains 

```

localhost ~ # /dev/v4l/by-

by-id/   by-path/ 

```

v4l-info tells me this. 

```
localhost ~ # v4l-info 

### v4l2 device info [/dev/video0] ###

general info

    VIDIOC_QUERYCAP

   driver                  : "uvcvideo"

   card                    : "Namuga 1.3M Webcam"

   bus_info                : "0000:00:1d.7"

   version                 : 0.1.0

   capabilities            : 0x4000001 [VIDEO_CAPTURE,STREAMING]

standards

inputs

    VIDIOC_ENUMINPUT(0)

   index                   : 0

   name                    : "Camera 1"

   type                    : CAMERA

   audioset                : 0

   tuner                   : 0

   std                     : 0x0 []

   status                  : 0x0 []

video capture

    VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)

   index                   : 0

   type                    : VIDEO_CAPTURE

   flags                   : 0

   description             : "YUV 4:2:2 (YUYV)"

   pixelformat             : 0x56595559 [YUYV]

    VIDIOC_G_FMT(VIDEO_CAPTURE)

   type                    : VIDEO_CAPTURE

   fmt.pix.width           : 640

   fmt.pix.height          : 480

   fmt.pix.pixelformat     : 0x56595559 [YUYV]

   fmt.pix.field           : NONE

   fmt.pix.bytesperline    : 1280

   fmt.pix.sizeimage       : 614400

   fmt.pix.colorspace      : unknown

   fmt.pix.priv            : 0

controls

    VIDIOC_QUERYCTRL(BASE+0)

   id                      : 9963776

   type                    : INTEGER

   name                    : "Brightness"

   minimum                 : -10

   maximum                 : 10

   step                    : 1

   default_value           : 2

   flags                   : 0

    VIDIOC_QUERYCTRL(BASE+1)

   id                      : 9963777

   type                    : INTEGER

   name                    : "Contrast"

   minimum                 : 0

   maximum                 : 20

   step                    : 1

   default_value           : 14

   flags                   : 0

    VIDIOC_QUERYCTRL(BASE+2)

   id                      : 9963778

   type                    : INTEGER

   name                    : "Saturation"

   minimum                 : 0

   maximum                 : 10

   step                    : 1

   default_value           : 5

   flags                   : 0

### video4linux device info [/dev/video0] ###

general info

    VIDIOCGCAP

   name                    : "Namuga 1.3M Webcam"

   type                    : 0x1 [CAPTURE]

   channels                : 1

   audios                  : 0

   maxwidth                : 1280

   maxheight               : 1024

   minwidth                : 48

   minheight               : 32

channels

ioctl VIDIOCGCHAN: Invalid argument

tuner

ioctl VIDIOCGTUNER: Invalid argument

audio

ioctl VIDIOCGAUDIO: Invalid argument

picture

    VIDIOCGPICT

   brightness              : 39321

   hue                     : 0

   colour                  : 32768

   contrast                : 45875

   whiteness               : 33423

   depth                   : 16

   palette                 : YUYV

buffer

ioctl VIDIOCGFBUF: Invalid argument

window

    VIDIOCGWIN

   x                       : 0

   y                       : 0

   width                   : 640

   height                  : 480

   chromakey               : 0

   flags                   : 0

```

```

localhost ~ # v4l-conf 

v4l-conf: using X11 display :0.0

WARNING: v4l-conf is compiled without DGA support.

mode: 1024x600, depth=24, bpp=32, bpl=4096, base=unknown

/dev/video0 [v4l2]: no overlay support

```

Any ideas

----------

## NeddySeagoon

gentoo_newguy,

Your kernel is good.

Looking at my Acer One, with a uvc webcam, it has a /dev/video0 under Linpus Linux, where it works but not under Gentoo, where it doesn't.

Lifting the udev rules from Linpus doesn't work. I've just tried that

----------

## gentoo_newguy

um ok i dont have a clue what that means 

what should i do next

----------

## gentoo_newguy

hey does anyone else on th forums no how to get my webcam workin ?

----------

## NeddySeagoon

gentoo_newguy,

My UVC webcam doesn't work in Gentoo yet either. If you get yours going before I do, be sure to post what you did.

----------

## gentoo_newguy

AGh i see well i have noticed certain things work when compiled as modules and certain things dont . 

Before i could get the usbview to stop it from being red it needed to be compiled as a module. 

i can now modprobe the module and it loads but i just cant get it to create the device in /dev/v4l/ 

is there away i can do this manually ? 

Apperantly it can be done in gentoo.

----------

## gentoo_newguy

Hi neddy. 

I have /dev/video and /dev/video0 

I seem to be getting somewhere . 

Im now getting this problem 

```
localhost ~ # cheese 

** ERROR **: error: libhal_ctx_set_dbus_connection: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

aborting...

Aborted

```

Does this help at all

----------

## NeddySeagoon

gentoo_newguy,

There are two ways to do it manually.

Write a udev rule, so udev does it for you. Thats supposed to happen anyway.

Use mknod to create a static /dev node, this will not persist over reboots.

Read man mknod to see how to use the command and /usr/src/linux/Documentation/devices.txt to get the major and minor device numbers that you need to feed to mknod. /usr/src/linux/Documentation/devices.txt will also tell if its a character or block device.

----------

## gentoo_newguy

Neddy im really sorry to keep asking you. 

I dont really understand the man pages at all. 

can i not re-emerge udev will this fix my problem ?

----------

## NeddySeagoon

gentoo_newguy,

Reinstalling packages usually does not help on Linux, unless you have doen something to damage them.

Look first in /usr/src/linux/Documentation/devices.txt where we find

```
 81 char        video4linux

                  0 = /dev/video0       Video capture/overlay device

                    ...

                 63 = /dev/video63      Video capture/overlay device
```

so /dev/video0 is a character device with major number 81 and minor number 0. Note that there are 64 minor numbers reserved, so you can have 64 video capture devices if you want to.

From man mknod we see 

```
mknod [OPTION]... NAME TYPE [MAJOR MINOR]
```

Filling in the blanks gives us 

```
mknod [OPTION] /dev/video0 c 81 0
```

Do we need any options ?

I fix the permissions after so the command is 

```
mknod /dev/video0 c 81 0
```

How change 

```
chown root:video /dev/video0

chmod 660 /dev/video0
```

to fix the ownership and permissions.

You may use 

```
chmod 666 /dev/video0
```

for testing. This makes the device open to all users.

It still may not work of course, this just gets you a static /dev node

----------

## gentoo_newguy

Thanks for always replying neddy. 

I seem to be getting this error now 

```

 mknod /dev/video0 c 81 0

mknod: `/dev/video0': File exists

```

Everything is going wrong for me today i have now done something to my wifi as well grrr !! Gentoo is really hard lol

```

localhost init.d # /etc/init.d/net.wlan0 restart

 * Caching service dependencies ...                                       [ ok ]

 * Stopping wlan0

 *   Bringing down wlan0

 *     Shutting down wlan0 ...                                            [ ok ]

 *     Stopping wpa_cli on wlan0 ...                                      [ ok ]

 *     Stopping wpa_supplicant on wlan0 ...                               [ ok ]

 * Starting wlan0

SIOCSIFFLAGS: Resource temporarily unavailable

SIOCSIFFLAGS: Resource temporarily unavailable

 *   Starting wpa_supplicant on wlan0 ...

SIOCSIFFLAGS: Resource temporarily unavailable

SIOCSIFFLAGS: Resource temporarily unavailable

Could not set interface 'wlan0' UP                                        [ ok ]

 *   Starting wpa_cli on wlan0 ...                                        [ ok ]

 *     Backgrounding ...

```

What the hell is happening to my system aghhh

----------

## NeddySeagoon

gentoo_newguy,

```
mknod: `/dev/video0': File exists 
```

code is good.  That means it was there before you attempted to make it.

Do you have any other video devices beside the webcam?

e.g. scanner, tv card etc ?

Do

```
ls -l /dev/video0
```

and see if its a real device file or a symbolic link. If its a link, follow the link?

Where is the real device file.

For your wireless, look in dmesg. You will find more detail there.

----------

## gentoo_newguy

Fixed the wifi neddy i think it just needed a reboot must have been a problem somewhere. 

This is what i get when i do this.

```

localhost ~ # ls -l /dev/video

lrwxrwxrwx 1 root root 10 Apr  2 19:22 /dev/video -> v4l/video0

localhost ~ # ls -l /dev/video

video   video0  

localhost ~ # ls -l /dev/video0 

lrwxrwxrwx 1 root root 10 Apr  2 19:22 /dev/video0 -> v4l/video0

```

Not really sure what it all means. 

My Gentoo knowledge is poor i have just applied for a basic Linux + course i think this will help me. 

Thanks for all your support

----------

## NeddySeagoon

gentoo_newguy,

That shows a /dev/video0 symlink pointing to /dev/v4l/video0

What does 

```
ls -l /dev/v4l/video0
```

show ?

----------

## gentoo_newguy

```

localhost ~ # ls -l /dev/v4l/video0

crw-rw---- 1 root video 81, 0 Apr  2 19:22 /dev/v4l/video0

```

this is all very confusing

----------

## gentoo_newguy

Does that mean its all linked up correctly ? 

Are we progressing or still in a muddle ?

----------

## quag7

I have a UVC videocam working well on my system.  Just as a checklist, this is what I have in my kernel that works - whether every one of these is required I do not know:

```

Device Drivers -->

  Multimedia Devices -->

    <*> Video for Linux

    [*] Video capture adapters -->

      [*] V4L USB devices -->

        <M> USB Video Class (UVC)

        [*] UVC input events device support

```

and also

```

Device Drivers -->

  [*] USB support -->

    <*> Support for Host-side USB

    [*] USB announce new devices

    [*] USB device filesystem

    *** USB Host Controller Drivers ***

    <*> EHCI HCD (USB 2.0) support

    <*> OHCI HCD support

    <*> UHCI HCD (most Intel and VIA) support

```

I can't run cheese here without some pain since I don't use Gnome, but I can confirm that:

media-video/luvcview  ( ver 20070512 )

will view my webcam.

I did not have to run mknod or otherwise configure or tweak anything else to get this to work.  /dev/video0 showed up automatically and worked alright the first time around.  (That's not saying you won't have to)

In /dev:

```

lrwxrwxrwx  1 root  root            10 Apr  2 12:42 video -> v4l/video0

lrwxrwxrwx  1 root  root            10 Apr  2 12:42 video0 -> v4l/video0

```

and /dev/v4l/video0 looks like:

```

crw-rw----  1 root video 81, 0 Apr  2 12:42 video0

```

Note group - make sure the user you're running as is in the video group.

----------

## gentoo_newguy

Right all that is compiled into my kernel already i will try emerging that package and see if that works. 

Really want to get it to work .

May i ask what commans u used to get those outputs i want to check if mine are the same. 

Im still new to it all.

I compiled the package and i get the same error. 

Sorry im so usless i dont no what im doing 

```

localhost ~ # luvcview 

luvcview version 0.2.1 

Video driver: x11

A window manager is available

video /dev/video0 

Unable to set format: 22.

 Init v4L2 failed !! exit fatal
```

Any ideas

----------

## NeddySeagoon

gentoo_newguy,

The first two code listings are from menuconfig  ... when you set up your kernel.

```
cd /usr/src/linux

make menuconfig
```

Press / to search and enter uvc

menuconfig will tell you where the uvc options are. Rinse and repeat with other search strings.

The directory/file listings were done with ls -l 

I get the same error as you with luvcview, so I'm poking about in the kernel just now

----------

## NeddySeagoon

gentoo_newguy,

```
luvcview -h 
```

is interesting reading.

Try 

```
luvcview -f yuv
```

 That works for me

----------

## gentoo_newguy

Neddy that command mad my cam work 

so how do i get it to work on messenger and other progs or other viewers

----------

## NeddySeagoon

gentoo_newguy,

You need to tell other programs to use the v4l version 2 and the YUV video format. How you do that will be application specific.

Not all applications support  v4l version 2 yet.

----------

## gentoo_newguy

Neddy excellent 

Right im gona try see if i can compile that flag in with certain apps or maybe change something in a configuration file. 

This viewer that we are currently using is there away for me to make it appear in my gnome menu as an application at all ? 

Thaks for all your help[/glep]

----------

## NeddySeagoon

gentoo_newguy,

I use smeg to edit Genome menus, its depreciated now and replaced with alacarte.

Open an xterm for your user and type alacarte to see if you have it, its a part of Gnome.

Linux saves all settings on a per user basis, so you will have to set up each user seperately.

Were its a good idea to have system wide defaults, root can set them but users can still normally set their own.

----------

## gentoo_newguy

Neddy ur a star thanks for all your help. 

My system is getting there. 

I have pretty much done the power managment myself. 

Next thing im intrested in is i have a built in mic on my laptop how or what do i need to do to get this working . 

Or could it allready be working ? Is there a program i can use to test it ?

Thanks again

----------

## NeddySeagoon

gentoo_newguy,

It probably belongs to your sound system or your webcam, either way it will be in ALSA.

Rub alsamixer and press F3, F4, F5,  that toggles between Player Controls, Capture controls and All controls.

Try Gnome Sound Recorder to capture something to a file, then replay it. 

Make sure your capture controls are unmuted and levels are up. 

You may have several sound cards but its unlikely. You point alsamixer at a particuar card with 

```
alsamixer -c 0 
```

for the first card and increment the number for second and subsequent cards. Alsa will tell you if you ask for a card you don't have.

----------

## gentoo_newguy

Neddy thanks i got it working last night but today i have booted up and the mic has stopped working. 

My system tells me i have 2 mics how can i find out which is my internal mic and which is the mic i plug in. 

I think it must be something to do with the sound levels but when i try record and capture sound it isint working.

I had it working last night

----------

## NeddySeagoon

gentoo_newguy,

First, unplug your plug in mic.

Now test your capture devices until you find your internal mic.

Plug in the external mic and test the capture devices again.

Its possible that when you connect the external mic, the switches in the socket disable the internal mic so that the two appear as the same device.

----------

## gentoo_newguy

I only have an internal mic on laptop i dont own a mic to plug into my laptop . 

Gentoo is a very crazy system when it works it works a treat when it doesent i dont have a clue lol. 

I will have a play around and see if i can get it working . 

Neddy really appricate all your help

----------

## NeddySeagoon

gentoo_newguy,

Within the kernel and alsa user space tools, sound out and sound in are very closely tied togeter.

When sound output works, sound input is a matter of fiddling with the sound input controls in alsa-mixer.

Do ensure that any controls with SPDI/F or IEC in their names are muted. Thats digital sound in/out.

It works at a different sample rate to the analogue sound and you  cannout use both at the same time.

When you activate both. only digital works, which is not what you want.

----------

## gentoo_newguy

Thanks neddy ur a star

You must have been using Gentoo for a longtime.

Next im sorting my bluetooh. 

Im trying to do that without any help as i ask far to much. 

Do u no anything about kismet at all ? 

there seems to be very little Gentoo guides on using this application .

----------

## NeddySeagoon

gentoo_newguy.

I've been using Gentoo about 7 years.  I came here for some help one day and never looked back.

I've not used kismet and know nothing about it.

If you find you do need help with your bluetooth, start a new thread.

----------

## gentoo_newguy

Thanks neddy.

----------

## gentoo_newguy

Neddy having real wierd problems with my bluetooth. 

My device still comes up in red on usbview but it seems i have some sort of connection going. 

```
GentooBox ~ # hciconfig 

hci0:   Type: USB

   BD Address: 00:22:69:C8:32:AD ACL MTU: 1017:8 SCO MTU: 64:8

   UP RUNNING PSCAN ISCAN 

   RX bytes:3665 acl:0 sco:0 events:147 errors:0

   TX bytes:952 acl:0 sco:0 commands:65 errors:0

```

```

GentooBox ~ # hciconfig -a 

hci0:   Type: USB

   BD Address: 00:22:69:C8:32:AD ACL MTU: 1017:8 SCO MTU: 64:8

   UP RUNNING PSCAN ISCAN 

   RX bytes:3665 acl:0 sco:0 events:147 errors:0

   TX bytes:952 acl:0 sco:0 commands:65 errors:0

   Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80

   Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 

   Link policy: RSWITCH HOLD SNIFF PARK 

   Link mode: SLAVE ACCEPT 

   Name: 'BlueZ (0)'

   Class: 0x080100

   Service Classes: Capturing

   Device Class: Computer, Uncategorized

   HCI Ver: 2.0 (0x3) HCI Rev: 0x2162 LMP Ver: 2.0 (0x3) LMP Subver: 0x41d3

   Manufacturer: Broadcom Corporation (15)

GentooBox ~ # 

```

I am also able to see my laptop from my phone but it wont let me pair. 

I have been trying to figure it out without asking opn the forums but no luck 

Any ideas ?

----------

## NeddySeagoon

gentoo_newguy,

Nope, sorry. I don't use bluetooth.

Post the Vendor and Product IDs of your device from lsusb as well as the progress you have made when you start your new thread.

----------

