Webcam programs working with webcamd in FreeBSD

Thanks for your reply, adamk.

I maybe am not clear with my post above, but since I have uninstalled webcamd in order to try with pwc/motion-with-pwc support, my /dev/video0 has disappeared. I need to recreate it.
Sorry for the misunderstanding.


Code:
ls /dev/
acpi            console         klog            sysmouse        ttyvd
ad0             consolectl      kmem            ttyu0           ttyve
ad0s1           ctty            log             ttyu0.init      ttyvf
ad0s1a          cuau0           lpt0            ttyu0.lock      ufsid
ad0s1b          cuau0.init      lpt0.ctl        ttyv0           ugen0.1
ad0s1d          cuau0.lock      mdctl           ttyv1           ugen1.1
ad0s1e          dcons           mem             ttyv2           ugen2.1
ad0s1f          devctl          nfslock         ttyv3           ugen2.2
ad2             devstat         null            ttyv4           urandom
ad2s1           dgdb            pci             ttyv5           usb
ad2s1d          fd              ppi0            ttyv6           usbctl
agpgart         fido            ptmx            ttyv7           xpt0
ata             geom.ctl        pts             ttyv8           zero
atkbd0          io              random          ttyv9
audit           kbd0            stderr          ttyva
bpf             kbd1            stdin           ttyvb
bpf0            kbdmux0         stdout          ttyvc
 
I did the same thing and was able to re-create it by running webcamd manually.

Code:
[root@Emi#/dev]webcamd -d ugen3.2 -i 0 -v 0
Attached ugen3.2[0] to cuse unit 0
Creating /dev/video0

My camera works fine in pwcview, but Cheese reports no device found. Its docs suggest testing the webcam in gstreamer-properties, but it also works fine there as the default v4l2 device.

Skype and Flash can't see a camera device either, but I'm not sure that works for anybody.
 
Linuxolator V4L2 (and DVB) patches

nox@ said:
I have just posted patches that add V4L2 (and DVB) support to the Linuxolator which got webcam video working in Skype at least for one guy. :) Here is my mailing list post with details:
http://lists.freebsd.org/pipermail/freebsd-multimedia/2011-April/011888.html
Updated the patches at the same place, now they also work for amd64 hosts:
http://lists.freebsd.org/pipermail/freebsd-multimedia/2011-April/011897.html
(Also has details how to get webcams working that don't support YUV video like the one I tested here.)

A few clarifications:

- The skype version tested was the one from the net/skype port, newer ones still need other patches: http://markmail.org/message/yilswgpnur4zawne

- To install Linux rpms (libv4l) see "Installing a Random Linux RPM Based Application" in the handbook: http://www.freebsd.org/doc/handbook/linuxemu-lbc-install.html

- You may need to restart skype after enabling video support.

- You may need to adjust device permissions in /etc/devfs.rules for /dev/video*.

And I just found my cam now works in flash too: http://www.testmycam.com/
 
I can report success here with a uvc webcam on 9.0-CURRENT amd64! Skype and flash :) I never thought I'd see this day :) Thanks for all your great work.
 
Unfortunately I'm having less luck with an older gspca webcam. skype crashes when I enable test the webcam, and flash just hangs up entirely. The v4l rpm is installed. Let me know if there is anything I can do to help debug this.

EDIT:

I tried the flash site again, and this time it worked. skype (from net/skype) still crashes, though. I am setting
Code:
XLIB_SKIP_ARGB_VISUALS=1
as per your directions.
 
adamk said:
Unfortunately I'm having less luck with an older gspca webcam. skype crashes when I enable test the webcam, and flash just hangs up entirely. The v4l rpm is installed. Let me know if there is anything I can do to help debug this.
Sounds like your camera (like mine which is also a gspca) doesn't support YUV video ootb, did you LD_PRELOAD the v4l2convert.so as mentioned in the thread I linked? Example: (bourne shell)
Code:
LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so /usr/local/share/skype/skype --resources=/usr/local/share/skype

And btw bsam@ now posted a port for the Linux libv4l that I just tested and I guess he will commit soon: http://lists.freebsd.org/pipermail/freebsd-multimedia/2011-April/011912.html
 
Ahhh, the LD_PRELOAD did it. I had tried setting LD_PRELOAD to /compat/linux/usr/lib/libv4l/v4l2convert.so

You rock :)

Adam
 
Patches work

nox@ said:
Updated the patches at the same place, now they also work for amd64 hosts:
http://lists.freebsd.org/pipermail/freebsd-multimedia/2011-April/011897.html
(Also has details how to get webcams working that don't support YUV video like the one I tested here.)

A few clarifications:

- The skype version tested was the one from the net/skype port, newer ones still need other patches: http://markmail.org/message/yilswgpnur4zawne

- To install Linux rpms (libv4l) see "Installing a Random Linux RPM Based Application" in the handbook: http://www.freebsd.org/doc/handbook/linuxemu-lbc-install.html

- You may need to restart skype after enabling video support.

- You may need to adjust device permissions in /etc/devfs.rules for /dev/video*.

And I just found my cam now works in flash too: http://www.testmycam.com/

I can confirm that your patches work. The video in skype is working en wxcam en guvcview are still working. I had to tweak the patched /usr/src/sys/compat/linux/linux_ioctl.c on my system ( 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #17 r209545M ).

Many thanks!!!!!
 
For some reason it compiles on amd64 while it doesn't on i386. I applied patches to files in /usr/src/.. added files to /usr/src/sys/compat/linux/, but I get this error when compiling kernel on i386:
Code:
cc1: warnings being treated as errors
/usr/src/sys/modules/ksyms/../../dev/ksyms/ksyms.c: In function 'ksyms_open':
/usr/src/sys/modules/ksyms/../../dev/ksyms/ksyms.c:431: warning: implicit declaration of function 'copyout_map'
/usr/src/sys/modules/ksyms/../../dev/ksyms/ksyms.c:431: warning: nested extern declaration of 'copyout_map'
/usr/src/sys/modules/ksyms/../../dev/ksyms/ksyms.c:444: warning: implicit declaration of function 'copyout_unmap'
/usr/src/sys/modules/ksyms/../../dev/ksyms/ksyms.c:444: warning: nested extern declaration of 'copyout_unmap'
*** Error code 1

Stop in /usr/src/sys/modules/ksyms.
*** Error code 1

Stop in /usr/src/sys/modules.
*** Error code 1

Stop in /usr/obj/usr/src/sys/GENERIC.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.

Am I missing something? I did same thing on my amd64 but it works.
 
bbzz said:
For some reason it compiles on amd64 while it doesn't on i386. I applied patches to files in /usr/src/.. added files to /usr/src/sys/compat/linux/, but I get this error when compiling kernel on i386:
Code:
cc1: warnings being treated as errors
/usr/src/sys/modules/ksyms/../../dev/ksyms/ksyms.c: In function 'ksyms_open':
/usr/src/sys/modules/ksyms/../../dev/ksyms/ksyms.c:431: warning: implicit declaration of function 'copyout_map'
[...]

Am I missing something? I did same thing on my amd64 but it works.

Maybe you use a different FreeBSD version/date of checkout on that box? Anyway, copyout_map() etc are only used by the DVB part of the patches which I now separated out into a port and fixed this issue in (separated because of LGPL in Linux DVB header files that I used parts of and got no reply about when emailing the author of those parts); I posted about the new patches here: http://lists.freebsd.org/pipermail/freebsd-multimedia/2011-April/011992.html

And as mentioned in that posting I'm also trying to collect data about the latest skype beta where video doesn't work at least for me.
 
Tried again to D/L sources and patch/compile, now it works. Hmm...must've followed wrong link on mailing list. Again, great job. I'll try to run latest skype version and see what happens.
The camera that now works is Logitech QuickCam Communicate (V-UBK45).
 
dusty_fox said:
Would it be possible to get this patch to work with 8.2?

I think the current version of the patch as well as the DVB wrapper port "should" work on 8.2, just give it a try. :)

Link to the mailing list post again: http://lists.freebsd.org/pipermail/freebsd-multimedia/2011-April/011992.html

And I also made yet other versions that use the V4L2 header from Linux 2.6.17 which doesn't seem to make a difference for Skype and Flash at least for my camera: http://lists.freebsd.org/pipermail/freebsd-multimedia/2011-April/012005.html

(And I'm still trying to collect data and webcamd logs for the latest skype as also mentioned in that post.)
 
skype has green screen

Hi everybody,

I currently still have problems getting skype to work.
In skype I get a green screen instead of the video. Other programs like mplayer accept my cams.

My Sytem is i386 FreeBSD-9-current with latest ports and kernel module loaded

Code:
kldstat 
Id Refs Address    Size     Name
 1   36 0xc0400000 82e77c   kernel
 2    2 0xc0c2f000 2f090    linux.ko
 3    1 0xc0c5f000 1ceb4    if_bwi.ko
 4    1 0xc0c7c000 1b440    snd_hda.ko
 5    2 0xc0c98000 57920    sound.ko
 6    1 0xc0cf0000 1a150    bwi_v3_ucode.ko
 8    1 0xc4fb3000 8000     linprocfs.ko
 9    1 0xc4fc3000 b000     ntfs.ko
10    1 0xc56eb000 9000     i915.ko
11    1 0xc56f4000 15000    drm.ko
12    1 0xc9286000 4000     cuse4bsd.ko

Code:
user> ls /var/db/pkg | grep v4l
gstreamer-plugins-v4l2-0.10.27,3/
libv4l-0.8.1/
v4l_compat-1.0.20101027_1/

user> pkg_version -v | grep linux_base
linux_base-f10-10_4                 =   up-to-date with port

I have been testing with two different webcams
Code:
ugen4.2: <vendor 0x046d> at usbus4      # this is a Logitech C500
ugen3.2: <CRrative Labs> at usbus3      # i cannot find what creative model this is



I start webcamd with the -B switch, otherwise it will suddenly go up to 100% cpu
Code:
webcamd -d ugen4.2 -i 0 -v 0 -B




I tried those 3 Skype Version
Code:
2.0.0.72-oss (old one from the ports)
2.1.0.81
2.2.0.25

with this command
Code:
LD_PRELOAD=/compat/linux/usr/lib/libv4l/v4l2convert.so /path/to/skype --resources=/path/to/skype


When I hit the "Test" webcam button in skype, the console puts out this
Code:
Starting the process...
Skype Xv: Xv ports available: 17
Skype XShm: XShm support enabled
Skype Xv: Using Xv port 73


So right now I am more or less lost on what to do next.

Anything else I could check or modify in the settings?
 
lockdoc said:
Hi everybody,

I currently still have problems getting skype to work.
In skype I get a green screen instead of the video. Other programs like mplayer accept my cams.

My Sytem is i386 FreeBSD-9-current with latest ports and kernel module loaded
[...]
Anything else I could check or modify in the settings?

Just to make sure, you did apply the Linuxolator V4L2 patch, rebuilt, and reloaded linux.ko?
 
nox@ said:
I was wrong, new mailing list post with Q&D patches for 8.2 and more detailed notes about how to get Skype 2.1.0.81 working:
http://lists.freebsd.org/pipermail/freebsd-multimedia/2011-May/012080.html

My FreeBSD version is (8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #21 r209545M). The patches for the audio worked and now the mic on my logitec webcam record the sound in skype_static-2.1.0.81. With the video and audio working this version is usable. Many thanks!

Skype_static-2.2.0.25 has all the audio working but not the video. I am sure this will be fixed!
 
lockdoc said:
Turns out Alexander committed the patches to -current now (r221426), so since you run that you just need to update your /usr/src.
Is there a way only to rebuild the linux.ko without having to recompile the kernel?
Well there may be other unrelated changes that may require a kernel rebuild anyway, but in general you should be able to just cd to /usr/src/sys/modules/linux and run:
Code:
make DEBUG_FLAGS=-g install
(The same goes for /usr/src/sys/modules/sound/sound after applying the one-line sound.ko patch which has been committed as r221388.)
 
Linuxolator V4L2 patches now turned into a port

Hi!

I now turned my Linuxolator V4L2 patches into a port: multimedia/linux_v4l2wrapper-kmod

So now people not running -current no longer have to find the right patch to apply to their 8-stable or release and rebuild their linux.ko, just install this port and do:
Code:
kldload linux_v4l2wrapper
Thanx to Andrey V. Elsukov for turning my patches into a separate kld like I already did with the Linuxolator DVB patches: multimedia/linux_dvbwrapper-kmod
 
  • Thanks
Reactions: xa
Thanks, it is working with the linux_V4l2wrapper.

One more question. If it would also work by just fetching the latest source and re-compiling the kernel, why is the need for a kernel module? Just curious because I try to have as less modules loaded as possible xD
 
lockdoc said:
Thanks, it is working with the linux_V4l2wrapper.

One more question. If it would also work by just fetching the latest source and re-compiling the kernel, why is the need for a kernel module? Just curious because I try to have as less modules loaded as possible xD

(Sorry for the late reply.)

The module port is only for people that don't want to upgrade to -current or manually apply my V4L2 patch. (or upgrade to -stable once the patch has been merged there.)
 
Back
Top