# HOWTO: adding webcam support for skype and adobe flash



## aleksey14 (May 7, 2011)

Note these works only with i386.
To set up your webcam to work with skype and flash you should do the following:
1.Download the long hoped-for patch from here.
Copy it into /usr.
Next patch, compile, install the kernel.

2. Install from the ports:
multimedia/webcamd
multimedia/linux-f10-libv4l
net/skype

3. in /boot/loader.conf add

```
cuse4bsd_load="YES"
```
in /etc/rc.conf add the line

```
webcamd_enable="YES"
```
and, of course, do not forget to set permissions on /dev/video0
in /etc/devfs.rules add lines

```
[system = 10]
add path 'video *' mode 0666
```
in /etc/rc.conf add

```
devd_enable="YES"
devfs_system_ruleset="system"
```

Skype should run with the script


```
#!/bin/sh 
export LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so 
/usr/local/share/skype/skype --resources=/usr/local/share/skype $@
```

Well, that's easy enough.
And by the way, check the flash player here.
If you don't have installed flash please see this forum thread.

If I wrote something in sufficient detail, do not hesitate to notice me that.
I'll be pleased to hear your questions and criticism.

P.S. Sorry for my poor English. You know, I'm traveling down the river, finished MGIMO and all that. :e


----------



## Aisha (Jul 14, 2011)

Hello.

I'm very new to FreeBSD and I want to make my webcam work in Skype. I have FreeBSD 8.2 and my arch is i386. I have skype-2.0.0.72 already installed and working, but if I go to Skype -> options -> video device, and click the 'Test' button for my webcam, it doesn't show nothing it stays all black no stream, even if I see that 'video device' points correctly in skype to '/dev/video0'. If I really need to patch my kernel like you say in your message, can you please tell me how can I patch, configure and install the kernel?? I really will appreciate to have video working on skype. 

The following is the current configuration I already had made, and my webcam is working great but only in pwcview I can see video on my webcam, but I cannot see any video on skype. Please, can you or anyone help me?.

This is what I got:

```
[root@kim /etc]# kldstat
Id Refs Address    Size     Name
 1   13 0xc0400000 bd97b4   kernel
 2    1 0xc0fda000 2d998    linux.ko
 3    1 0xc1008000 7520     snd_atiixp.ko
 4    2 0xc1010000 56794    sound.ko
 5    1 0xc1067000 48f8     cuse4bsd.ko
```


```
[root@kim /usr/ports/distfiles]# cat /boot/loader.conf 
kern_maxfiles=25000
sem_load="YES"
linux_load="YES"
snd_atiixp_load="YES"
cuse4bsd_load="YES"
pwc_load="YES"
```


```
[root@kim /usr/ports/distfiles]# ls -l /dev | grep video0
crw-rw-rw-  1 webcamd  webcamd     0,  83 Jul 14 08:36 video0
```

Thanks in Advanced.


----------



## nox@ (Sep 9, 2011)

A small update for people who found this thread:  My Linuxolator V4L2 patch has been committed to 9.0-current (r221426) and to 8.2-stable in the meantime (r222914), so if you run either of those it should work already.  And if you run a -release (8.2) then the skype ports now depend on multimedia/linux_v4l2wrapper-kmod which is an implementation of the patch as a kld that can be loaded as: `# kldload linux_v4l2wrapper` or added to /boot/loader.conf.
The result of loading that kld will be the same as patching your kernel.

And finally, two notes:

a) the net-im/skype-devel port doesn't seem to work with V4L2 (video) on FreeBSD, and
b) the net-im/skype port uses linux-alsa compat packages for oss output as described in the port's pkg-message that can be displayed like this: `$ pkg_info -D skype\* |less`
For mic input to work that alsa oss input code needs another one-line patch that was committed after 8.2-release (r221388 for 9.0-current and r221583 for 8.2-stable, the latter commit was on on May 7 2011): http://lists.freebsd.org/pipermail/freebsd-multimedia/2011-April/012024.html - link to standalone patch: http://svnweb.freebsd.org/base/head...view=patch&r1=221388&r2=221387&pathrev=221388
(and the net-im/skype20 port doesn't need this patch since it still supports oss natively, but the distfile for that is no longer public.)

I hope this clears up any remaining confusions. 

PS: compiling a custom kernel is explained in the handbook: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-building.html - and you can also patch and rebuild just the sound.ko by doing: `# cd /usr/src && fetch -o - 'http://svnweb.freebsd.org/base/head/sys/dev/sound/pcm/dsp.c?view=patch&r1=221388&r2=221387&pathrev=221388' |patch -p1
# cd sys/modules/sound/sound && make DEBUG_FLAGS=-g && make install DEBUG_FLAGS=-g`
(and then reload it resp. your sound driver that depends on it, or reboot.)


----------



## warudemaru (Sep 14, 2011)

This is simply fantastic! it works! Appreciate your great job nox! :e


----------



## serjsk8 (Sep 25, 2011)

Thanks! Webcam works!


----------



## SIFE (Sep 25, 2011)

Does multimedia/webcamd port support usb2 webcam now?


----------



## nox@ (Sep 29, 2011)

SIFE said:
			
		

> Does multimedia/webcamd port support usb2 webcam now?


I'd be surprised if not, or rather if it doesn't it would be unlikely that usb2 is the reason, more likely the Linux v4l/dvb tree that webcamd uses doesn't have a driver for it.  (Which one is it anyway and can you post `# usbconfig dump_device_desc` output for it?)


----------



## serjsk8 (Oct 5, 2011)

For your information:
After binary upgrading to FreeBSD8.1-p3, skype did not start again.

```
freebsd-update fetch
freebsd-update install
```
I had to remove the updates and then skaype working again with support for webcam.

```
freebsd-update rollback
```

I have skype 2.0.0.72,1


----------



## warudemaru (Oct 6, 2011)

serjsk8 said:
			
		

> For your information:
> After binary upgrading to FreeBSD8.1-p3, skype did not start again.[...]
> I have skype 2.0.0.72,1



8.1-p3?? It works for 8.2-STABLE and only since r221583, as it's been announced here. Anyway give skype 2.1 a try. I had problems on 8.2 with skype 2.0 and 2.1 works pretty well


----------



## serjsk8 (Oct 7, 2011)

> 8.1-p3?? It works for 8.2-STABLE and only since r221583, as it's been announced here. Anyway give skype 2.1 a try. I had problems on 8.2 with skype 2.0 and 2.1 works pretty well


Yes, I know!
But my skype 2.0.0.72,1 + webcam works on FreeBSD8.1-RELEASE-p2 after installing multimedia/linux_v4l2wrapper-kmod. I just wanted to say that after upgrading to FreeBSD8.1-RELEASE-p3 skype 2.0 not run! I do not use STABLE on my home PC. I'll try Skype 2.1 after the upgrade to 9-RELEASE.


----------



## nox@ (Oct 7, 2011)

serjsk8 said:
			
		

> Yes, I know!
> But my skype 2.0.0.72,1 + webcam works on FreeBSD8.1-RELEASE-p2 after installing multimedia/linux_v4l2wrapper-kmod. I just wanted to say that after upgrading to FreeBSD8.1-RELEASE-p3 skype 2.0 not run! I do not use STABLE on my home PC. I'll try Skype 2.1 after the upgrade to 9-RELEASE.


I wouldn't be surprised if this was caused by the Linuxolator breakage in the original version of the UNIX socket address security fix, a revised version of that advisory is now available here: http://security.FreeBSD.org/advisories/FreeBSD-SA-11:05.unix.asc

Bottom line:  just try using freebsd-update again.


----------



## Pjoter (Oct 28, 2011)

Hello all,

Could I ask if anyone made a Skype phone call with video enabled and did it work? 

Thank you.

Piotr.


----------



## adamk (Oct 28, 2011)

I have, and yes, it worked.

EDIT:

While it did work for me previously, it's definitely not working now. If I test the video camera in the skype options, it works fine still.  But I enable the video in an actual chat, the video doesn't actually display for some reason...


----------



## warudemaru (Oct 29, 2011)

Pjoter said:
			
		

> Could I ask if anyone made a Skype phone call with video enabled and did it work?



of course, it works every time I use Skype, however one person reported problems with receiving video from me, while everything seemed ok at my side


----------



## Pjoter (Oct 29, 2011)

Hello all,

thank  you very much.

I will rest it with 9.0 RC today probably and let's see how it goes.

Kr.

Piotr.


----------



## jimmiejaz (Nov 9, 2011)

Skype and a few other IM clients work with my cam, but no flash sites find it  I has a sad.


----------



## Pjoter (Nov 9, 2011)

Just to be sure- is amd64 supported or only i386?

Piotr.


----------



## graudeejs (Nov 9, 2011)

Skype + Webcam works find on amd64
Dunno about flash


----------



## adamk (Nov 9, 2011)

Pjoter said:
			
		

> Just to be sure- is amd64 supported or only i386?
> 
> Piotr.



amd64 is supported.

Adam


----------



## Pjoter (Nov 9, 2011)

Ok, thank you- I will give a try this weekend and report flash and webcam support.

Thank you !

Piotr.


----------



## HenryHu (Dec 18, 2011)

My Skype is working with my webcam, but my flash was not. Now I found the problem: I need to create a symlink at /compat/linux/dev to /dev/video0. And now it works! Thanks!


----------



## purgatori (Jan 8, 2012)

Disappointing. It seems that there is still no way to run Skype on my system without polluting it with a bunch of Linux stuff.


----------



## Dru (Jan 8, 2012)

purgatori said:
			
		

> Disappointing. It seems that there is still no way to run Skype on my system without polluting it with a bunch of Linux stuff.




lol...http://www.microsoft.com/en-us/skype/


----------



## pkubaj (Jan 14, 2012)

I've been trying to get it to work for some time and I can't.
Video works, but no sound. Mixer shows:

```
Mixer vol      is currently set to 100:100
Mixer pcm      is currently set to  92:92
Mixer speaker  is currently set to 100:100
Mixer line     is currently set to  75:75
Mixer mic      is currently set to 100:100
Mixer cd       is currently set to 100:100
Mixer rec      is currently set to  75:75
Mixer igain    is currently set to 100:100
Mixer ogain    is currently set to  50:50
Mixer line1    is currently set to  75:75
Mixer phin     is currently set to 100:100
Mixer phout    is currently set to 100:100
Recording source: mic
```
I use net-im/skype and 9.0-RELEASE. My webcam is Logitech C310HD, I followed the guide in here http://wiki.freebsd.org/WebcamCompat but it still doesn't work.


----------



## bbzz (Jan 14, 2012)

Try changing and/or adding (R)ecording source. See mixer(8). Also try changing values for line, rec, etc. In other words, experiment a bit.


----------



## pkubaj (Jan 14, 2012)

OK, so now it works out of Skype, but still doesn't work in Skype.


----------



## tcrider84 (Jan 23, 2012)

*odd problem with webcamd_enable="YES"*

Hi everyone. So I've come across a strange problem. I'm using Freebsd 9 stable. I've followed the guide and installed the required packages. Here's the issue.

If I put:


```
webcamd_enable="YES"
```

in /etc/rc.conf, /dev/video0 is not loaded and not listed when I *ls /dev*, nor does it get picked up by pwcview. BUT

IF I remove the line, and then manually enable webcamd, /dev/video0 IS generated, and I can set permissions and use pwcview/other webcam programs as normal. Any idea why it's doing this? The cam is a logitech C210.


----------



## tcrider84 (Jan 23, 2012)

Some extra info that might be useful:

when


```
webcamd_enable="YES"
```

and I try to run it, I get:

```
Webcamd is already running for ugen3.2.0
..yet no /dev/video0
```
Here's the usbconfig dump_device_desc:

```
ugen3.2: <product 0x0819 vendor 0x046d> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON

  bLength = 0x0012 
  bDescriptorType = 0x0001 
  bcdUSB = 0x0200 
  bDeviceClass = 0x00ef 
  bDeviceSubClass = 0x0002 
  bDeviceProtocol = 0x0001 
  bMaxPacketSize0 = 0x0040 
  idVendor = 0x046d 
  idProduct = 0x0819 
  bcdDevice = 0x0010 
  iManufacturer = 0x0000  <no string>
  iProduct = 0x0000  <no string>
  iSerialNumber = 0x0002  <D07EA700>
  bNumConfigurations = 0x0001
```


----------



## bbzz (Jan 23, 2012)

Do you have 

```
cuse4bsd_load="YES"
```
in /boot/loader.conf?

Also to avoid manually setting permission for video0, edit your /etc/devfs.rules file.


----------



## tcrider84 (Jan 23, 2012)

bbzz said:
			
		

> Do you have
> 
> ```
> cuse4bsd_load="YES"
> ...



Yes, I do have 
	
	



```
cuse4bsd_load="YES"
```
 in /boot/loader.conf. I do not think I would be able to manually load webcamd and create /dev/video0 if cuse was not loaded. 

As I said it works fine IF:
1. I do not use 
	
	



```
webcamd_enable="YES"
```
 in /etc/rc.conf 
and also 
2. manually type 
	
	



```
webcamd -d ugen3.2 -i 0 -v 0
```

this creates /dev/video0 and works properly. 

*But if I enable webcamd in /etc/rc.conf, /dev/video0 is not created.*

Also, I already know about /etc/devfs.rules, but it cannot set permissions to /dev/video0 if /dev/video0 is not created/does not exist.


----------



## bbzz (Jan 24, 2012)

Right, sorry.
And if you explicitly add flags in /etc/rc.conf? Along the lines of:


```
webcamd_flags="-d ugen3.2 -B"
```

Also try all again without *-i* and *-v* switch. Yeah, I know, you'd be surprised.


----------



## tcrider84 (Jan 24, 2012)

ok, so.

tried it with

```
webcmad_enable="YES"
webcamd_flags="-d ugen3.2 -B"
```

/dev/video0 not created.

tried with

```
webcamd_flags="-d ugen3.2 -B"
```
only. still /dev/video0 not created

tried via terminal manually:


```
sudo webcamd
Attached ugen3.2[0] to cuse unit 0
Creating /dev/video0
```

created, but then it hangs.. as in I can't get back to console without pressing ctrl+c. When I installed webcamd I used pkg_add -r webcamd, maybe I should remove it and compile it from ports instead?


----------



## tcrider84 (Jan 24, 2012)

Same problem using install from ports. Seems someone else is also having this exact problem:

http://freebsd.1045724.n5.nabble.com/webcamd-startup-problems-td3927737.html#a5398421


----------



## jrm@ (Mar 12, 2012)

Thanks for this helpful guide @Aleksey14.



			
				aleksey14 said:
			
		

> ...
> in /etc/devfs.rules add lines
> 
> ```
> ...



Maybe it's a formatting issue, but I had problems with the spaces.  Only

```
[system=10]
add path 'video*' mode 0666
```
worked for me.




			
				aleksey14 said:
			
		

> ...
> 
> ```
> export LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so
> ...



This part didn't seem to make any difference than when I just ran the skype binary.  Is it still necessary?

Thanks again; it's nice to be able to see friends and family who live far away.


----------



## bbzz (Mar 14, 2012)

That last part is not needed anymore.


----------



## jrm@ (Jun 7, 2012)

I haven't used my formerly working generic USB webcam in a few months, but when I plugged it in today and started pwcview I saw a green screen where the video normally would be and the system semi-froze. I say semi- because the colours were slowly changing and every once in awhile the mouse would move or a keystroke would register.  But, after about 10 minutes I was forced to hard reboot.  I don't think I've used the webcam since upgrading from 8.2 to 8.3, but searching for things like "FreeBSD 8.3 webcam" doesn't turn anything up.

When I plug the webcam in I see:


```
Jun  7 19:06:24 met kernel: ugen3.2: <Image Processor> at usbus3
Jun  7 19:06:24 met root: /usr/local/etc/rc.d/webcamd: WARNING: failed to start webcamd
Jun  7 19:06:24 met root: Unknown USB device: vendor 0x090c product 0x937b bus uhub3
```

in syslog.

I do see /dev/video0 and I set the permissions to crw-rw-rw-.

Am I missing something?


----------

