aMSN Forums
January 18, 2018, 12:54:32 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Webcam on FreeBSD  (Read 34039 times)
atazoth
Newbie

Offline Offline

Posts: 1


View Profile
« on: December 16, 2008, 11:58:53 am »

Has anyone gotten webcam to work on FreeBSD? I installed from ports and get an error that says the "grab" extention is not loaded. I couldn't find anything on this extension on google.

After some tinkering I can now view my cam using VLC via the gspca and v4l_compat port. Just wanna see if I can get it going in a messenger program now.

Thanks


Btw, best client i've ever seen aside from the real deal. In looks and functionality.
Logged
whetphish
Newbie

Offline Offline

Posts: 6



View Profile
« Reply #1 on: January 22, 2009, 05:45:55 am »

Any update on this? My webcam works fine on FreeBSD but I also get that message about the 'grab' extension when I try to set up my webcam in aMSN. I clicked the link to the Webcam Wiki but there is nothing there regarding FreeBSD.

I noticed there was some talk of the webcamsn extension. This appears to have been installed when I compiled aMSN and the following files exist ...

/usr/local/share/amsn/utils/webcamsn
/usr/local/share/amsn/utils/webcamsn/pkgIndex.tcl
/usr/local/share/amsn/utils/webcamsn/webcamsn.so

My question is how do I know if this extension is loaded and, if it isn't, how do I get aMSN to load it? I looked under the FAQ, HELP, INSTALL and README in /usr/local/share/amsn but can't find an answer anywhere.

Any help would be greatly appreciated.
Logged

whetphish.

kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #2 on: January 22, 2009, 06:33:49 am »

Hi, and welcome to both of you to our forums...
Unfortunately, I thought I had answered atazoth before, but apparently, I never sent the message and it somehow got lost...
I don't know about BSD since I never used it, and I certainely can't test anything for it... however, if you could try to help debug this a little, then we might be able to get the webcam working on BSD...
The problem is not the 'webcamsn' extension, it's the 'capture' extension... This doesn't get built on BSD, so if you could build it, and see if it compiles without error, and try to test the webcam, then that would be great...
first step is to edit the Makefile.in file from amsn's sources, then search for 'bsd' until you find this :
Code:
 ifeq ($(FOUND_OS),bsd)
    ifeq ($(FOUND_X11),yes)
       ADDLIBS    += ${X_LIBS}
      include $(tray_dir)/Rules.mk
      include $(linflash_dir)/Rules.mk
    endif
  else

change it into :
Code:

  ifeq ($(FOUND_OS),bsd)
    include $(capture_dir)/Rules.mk
    include $(capture_dir)/libng/Rules.mk
    include $(capture_dir)/libng/plugins/Rules.mk

    ifeq ($(FOUND_X11),yes)
       ADDLIBS    += ${X_LIBS}
      include $(tray_dir)/Rules.mk
      include $(linflash_dir)/Rules.mk
    endif
  else


then try ./configure again, then make to compile the capture extension.. It should compile and work... (it will build a bsd specific driver for the webcam, so you don't need to have v4l or v4l2 compat... )
Then try amsn by launching it *directly from source* with
Code:
./amsn
If you try to install it first with make install, it will not work since the capture extension doesn't get installed... Then go to the audio/video settings (preferences->others) and see if it works... if not, please give as much details as you can so we can debug this and guide you through more steps to try out...
Logged

KaKaRoTo
whetphish
Newbie

Offline Offline

Posts: 6



View Profile
« Reply #3 on: January 28, 2009, 12:33:11 am »

Hi Kakaroto,

Thanks for your help. I did went to the aMSN port directory /usr/ports/net-im/amsn and did a make deinstall, make clean, make distclean, make fetch and make extract.

I then edited /usr/ports/net-im/amsn/work/amsn-0.97.2/Makefile.in and changed it as you suggested. I tried a ./configure in that directory but had the error You dot not have a devel package of Tk (there isn't a devel package of tk for FreeBSD as far as I can see). Anyway I changed back to /usr/ports/net-im/amsn/ and did a make on its own. aMSN compiled fine and I ran amsn from the /usr/ports/net-im/amsn/work/amsn-0.97.2/ directory (where it had compiled itself).

I tried to configure my cam but it still had the same error about not being able to find the 'grab' extension. I'm just wondering if, even though the port isn't currently installed, whether aMSN is looking for extensions in the place it does normally - /usr/local/share/amsn/utils/

Here is the output of the make command ...

bobby# make
===>  Patching for amsn-0.97.2_1
===>  Applying FreeBSD patches for amsn-0.97.2_1
===>   amsn-0.97.2_1 depends on executable: wish8.4 - found
===>   amsn-0.97.2_1 depends on file: /usr/local/lib/tls/tls.tcl - found
===>   amsn-0.97.2_1 depends on executable: dtplite - found
===>   amsn-0.97.2_1 depends on executable: gmake - found
===>   amsn-0.97.2_1 depends on shared library: Imlib.5 - found
===>  Configuring for amsn-0.97.2_1
checking for gcc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether c++ accepts -g... yes
checking tcl build dir... using tcl library in /usr/local/lib/tcl8.4
checking tk build dir... using tk library in /usr/local/lib/tk8.4
checking for main in -lstdc++... yes
checking how to run the C preprocessor... cc -E -O2 -fno-strict-aliasing -pipe -I/usr/local/include -L/usr/local/lib
checking for X... libraries /usr/local/lib, headers /usr/local/include
checking whether -R must be followed by a space... no
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
test: bsd: unexpected operator
checking for png_read_info in -lpng... yes
checking png.h usability... yes
checking png.h presence... yes
checking for png.h... yes
checking for jpeg_CreateDecompress in -ljpeg... yes
checking jpeglib.h usability... yes
checking jpeglib.h presence... yes
checking for jpeglib.h... yes
checking jerror.h usability... yes
checking jerror.h presence... yes
checking for jerror.h... yes
checking for ftello... yes
checking for fseeko... yes
checking for getpt... no
checking for strcasestr... yes
checking for memmem... yes
checking for dlopen... yes
checking for pthread_create in -lpthread... yes
checking if mmx should be used... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating utils/linux/capture/config.h

compile time options summary
============================

    X11          : yes
    Tcl       : 8.4
    TK        : 8.4
    DEBUG        : no
    STATIC       : no

===>  Building for amsn-0.97.2_1
utils/linux/traydock/Rules.mk:5: warning: overriding commands for target `utils/linux/traydock/libtray.so'
utils/linux/traydock/Rules.mk:5: warning: ignoring old commands for target `utils/linux/traydock/libtray.so'
  CC     utils/linux/traydock/libtray.o
  LD     utils/linux/traydock/libtray.so
  CXX     utils/TkCximage/src/TkCximage.cpp.o
  CXX     utils/TkCximage/src/PhotoFormat.cpp.o
  CXX     utils/TkCximage/src/procs.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximadsp.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximaexif.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximagif.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximainfo.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximajpg.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximalyr.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximapng.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximatga.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximatran.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximabmp.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximaenc.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximage.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximahist.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximaint.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximalpha.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximapal.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximasel.cpp.o
  CXX     utils/TkCximage/src/CxImage/ximath.cpp.o
  CXX     utils/TkCximage/src/CxImage/xmemfile.cpp.o
  AR     utils/TkCximage/src/CxImage/libCxImage.a
ar: creating utils/TkCximage/src/CxImage/libCxImage.a
  LDX     utils/TkCximage/src/TkCximage.cpp.so
  LDX     utils/TkCximage/src/TkCximage.cpp.so
cp utils/TkCximage/src/TkCximage.cpp.so utils/TkCximage/TkCximage.so
  CC     utils/webcamsn/src/webcamsn.o
  CC     utils/webcamsn/src/kidhash.o
  CC     utils/webcamsn/src/bitstring.o
  CC     utils/webcamsn/src/deblock.o
  CC     utils/webcamsn/src/encode.o
  CC     utils/webcamsn/src/idct_dequant.o
  CC     utils/webcamsn/src/mimic.o
  CC     utils/webcamsn/src/vlc_decode.o
  CC     utils/webcamsn/src/colorspace.o
  CC     utils/webcamsn/src/decode.o
  CC     utils/webcamsn/src/fdct_quant.o
  CC     utils/webcamsn/src/vlc_common.o
  CC     utils/webcamsn/src/vlc_encode.o
  AR     utils/webcamsn/src/libmimic.a
ar: creating utils/webcamsn/src/libmimic.a
  LD     utils/webcamsn/src/webcamsn.so
cp utils/webcamsn/src/webcamsn.so utils/webcamsn/webcamsn.so
  CC     utils/tcl_siren/src/tcl_siren.o
  CC     utils/tcl_siren/src/common.o
  CC     utils/tcl_siren/src/dct4.o
  CC     utils/tcl_siren/src/encoder.o
  CC     utils/tcl_siren/src/decoder.o
  CC     utils/tcl_siren/src/huffman.o
  CC     utils/tcl_siren/src/rmlt.o
  AR     utils/tcl_siren/src/libsiren.a
ar: creating utils/tcl_siren/src/libsiren.a
  LD     utils/tcl_siren/src/tcl_siren.so
cp utils/tcl_siren/src/tcl_siren.so utils/tcl_siren/tcl_siren.so
  CC     utils/linux/capture/capture.o
  CC     utils/linux/capture/libng/grab-ng.o
  CC     utils/linux/capture/libng/devices.o
  CC     utils/linux/capture/libng/writefile.o
  CC     utils/linux/capture/libng/parse-mpeg.o
  CC     utils/linux/capture/libng/parse-dvb.o
  CC     utils/linux/capture/libng/color_common.o
  CC     utils/linux/capture/libng/color_packed.o
  CC     utils/linux/capture/libng/color_lut.o
  CC     utils/linux/capture/libng/color_yuv2rgb.o
  CC     utils/linux/capture/libng/convert.o
  CC     utils/linux/capture/libng/misc.o
  AR     utils/linux/capture/libng/libng.a
ar: creating utils/linux/capture/libng/libng.a
  LD     utils/linux/capture/capture.so
  CC     utils/linux/capture/libng/plugins/conv-mjpeg.o
  LD     utils/linux/capture/libng/plugins/conv-mjpeg.so
  CC     utils/linux/capture/libng/plugins/drv0-bsd.o
  LD     utils/linux/capture/libng/plugins/drv0-bsd.so
  CC     utils/linux/linflash/flash.o
  LD     utils/linux/linflash/flash.so

Regards,
whetphish
Logged

whetphish.

kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #4 on: January 28, 2009, 01:48:38 am »

Hi whetphish, good news.. well first, you have the tcl/tk dev packages, so configuring should work with ./configure --with-tcl=/usr/local/lib/tcl8.4 --with-tk=/usr/local/lib/tk8.4
however, you do not need that...  
simply because the ported amsn for bsd already seems to be doing it for you ;
Code:

ar: creating utils/linux/capture/libng/libng.a
LD utils/linux/capture/capture.so
CC utils/linux/capture/libng/plugins/conv-mjpeg.o
LD utils/linux/capture/libng/plugins/conv-mjpeg.so
CC utils/linux/capture/libng/plugins/drv0-bsd.o
LD utils/linux/capture/libng/plugins/drv0-bsd.so

so it already builds the capture extension, so it should work in theory... however.. it looks like the code is looking for 'linux' instead of 'unix' (because of the mac) to load the capture extension and do what it needs to do...
so if you could try a simple hack.. edit amsncore.tcl and find the OnLinux proc and make it always return 1, so it will force amsn into thinking you're on linux.. then try again.. I'll see if i can patch it to take bsd into account too...

p.s.: I've never installed amsn, I always run it from source and amsn is written to work that way...
Logged

KaKaRoTo
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #5 on: January 29, 2009, 11:50:16 pm »

Hi,
Can you please test the latest SVN of amsn and see if it fixes your problems ?
You could also use your current version but just try to patch this to your sources :
http://amsn.svn.sourceforge.net/viewvc/amsn?view=rev&revision=10896
Logged

KaKaRoTo
whetphish
Newbie

Offline Offline

Posts: 6



View Profile
« Reply #6 on: January 31, 2009, 03:49:06 am »

Hi Kakaroto,

I cleaned out the aMSN port, applied your patches from the SVN and changed the Makefile.in again so it built the 'capture' extension.

Now when I try and configure the webcam it says Checking if webcam is connected ... and then has a red X.

My camera is connected and /dev/video0 has:

Quote
crw-rw-rw-  1 root  operator    0,  83 Jan 30 15:47 /dev/video0


Here is the part of my dmesg where the driver is loaded ...

Quote
gspca_attach_bridge: USB GSPCA camera found. SONIX JPEG (sn9c1xx)
spca5xx_probe: [spca5xx_probe:4259] Camera type JPEG
spca5xx_getcapability: [spca5xx_getcapability:1239] maxw 640 maxh 480 minw 160 minh 120
0 [1117] video_register_device: to be fixed but ok for now
ldev0: vendor 0x045e USB camera, rev 1.10/1.01, addr 2


The driver is a port of the Linux gspcav1 driver so aMSN should be able to talk to the device the same way as it would on a Linux system.

Thanks,
whetphish.
Logged

whetphish.

vivia
Administrator
Super Power User
*****
Offline Offline

Posts: 2464


View Profile
« Reply #7 on: February 01, 2009, 12:40:49 am »

Hi,

Can you compile with debug enabled, start aMSN from a terminal, start the assistant and paste here the terminal output?
Thanx!
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #8 on: February 01, 2009, 05:30:40 am »

ok, the problem is different.. you have a v4l or v4l2 driver, but amsn has a specific bsd driver (not video4linux, but whatever is the bsd equivalent...)
Can you make it work using the default bsd driver? if not can you look at the file amsn/utils/linux/capture/libng/plugins/Rules.mk and make it compile the v4l/v4l2 modules even if you're on BSD ? should be easy... try that and tell me if that worked...
Logged

KaKaRoTo
whetphish
Newbie

Offline Offline

Posts: 6



View Profile
« Reply #9 on: February 01, 2009, 08:33:33 pm »

Hiya,

As far as I know there are no specific 'native' webcam drivers for BSD hence the spca, gspca, pwc, etc. drivers  have been ported from Linux and compiled using special headers to produce BSD code (see http://info.iet.unipi.it/~luigi/FreeBSD/linux_bsd_kld.html).

I've got the Video4Linux compatibility headers installed on my system so I'll try what you suggested with the Rules.mk and let you know the result.

Thanks for your help so far. It will be really good if we can get webcam working in aMSN as it will be the only 'useful' video conferencing program, that I am aware of, that runs on BSD.

Regards,
whetphish.

PS
I am I little reluctant to try compiling the SVN version until I have got my head around the patch system. The BSD port has specific patch files that are applied when you build it and these probably won't work on modified code.
Logged

whetphish.

kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #10 on: February 18, 2009, 06:54:55 pm »

Hi,
any news on this? does it work now with the v4l driver ?
Logged

KaKaRoTo
drdmd
Newbie

Offline Offline

Posts: 1


View Profile
« Reply #11 on: February 25, 2009, 03:57:15 pm »

Hi,

I red this post few week ago, and I need webcam support works for FreeBSD too. Then I rewrite a patch for an old release of amsn for another driver and it works for gspca module !!

I will post here a download link for this patch in few days (no ftp for now...)

But changes in aMsn source code are no so difficult to make it works without any patch in FreeBSD, and in my mind it will be better to do that than apply patches for FreeBSD...

David

PS sorry for my english...
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #12 on: February 26, 2009, 12:38:12 am »

Hi David, welcome to the forums!
It's great to hear that it works for you. i'd like to see this patch and we'll integrate it into the SVN version for the next release.
It's appreciated.
Thanks
Logged

KaKaRoTo
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #13 on: April 08, 2009, 07:21:47 pm »

David, I'm still waiting to see your patch, or to have you tell us what you changed to make it work!
I want to have webcam working for BSD users in our next release, and this is one of the few items blocking the release..
Logged

KaKaRoTo
elgrande
Newbie

Offline Offline

Posts: 2


View Profile
« Reply #14 on: May 02, 2009, 10:51:31 pm »

Hello,

I found this topic, and am willing to get it working on freebsd.
I followed all instructions and compiled using debugging.

When entering assistent in amsn configuration gui, it tells me that it did not find any webcam.
The debug output in the shell is only:

vid-probe: trying: bktr...

Any ideas how to continue?

Also the test.tcl script suceeds, but finds no devices.
Can I just hardcode /dev/video0 for a first try. If yes, where to do so?

Best regards, Tino
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!