Page 7 of 8

Re: FreeBSD port for 1.23.3

Posted: Wed Jul 06, 2011 5:07 am
by achix
also i changed files/patch-src_Makefile.am

Code: Select all

--- src/Makefile.am.orig	2011-01-22 00:09:46.000000000 +0200
+++ src/Makefile.am	2011-07-06 08:00:50.000000000 +0300
@@ -1,6 +1,6 @@
 AUTOMAKE_OPTIONS = gnu
 
-AM_CPPFLAGS = @MYSQL_CFLAGS@ @FFMPEG_CFLAGS@ -Wall -Wno-sign-compare -fno-inline
+AM_CPPFLAGS = @MYSQL_CFLAGS@ @FFMPEG_CFLAGS@
 #AM_CXXFLAGS = -frepo
 
 CLEANFILES = *.rpo
@@ -36,7 +36,7 @@
 	zm_ffmpeg_camera.cpp \
 	zm_image.cpp \
 	zm_jpeg.c \
-	zm_local_camera.cpp \
+	zm_fbsd_camera.cpp \
 	zm_monitor.cpp \
 	zm_ffmpeg.cpp \
 	zm_mpeg.cpp \
@@ -89,7 +89,7 @@
 	zm.h \
 	zm_image.h \
 	zm_jpeg.h \
-	zm_local_camera.h \
+	zm_fbsd_camera.h \
 	zm_mem_utils.h \
 	zm_monitor.h \
 	zm_ffmpeg.h \
and i added files/patch-src_Makefile.in

Code: Select all

--- src/Makefile.in.orig	2011-07-06 08:01:02.000000000 +0300
+++ src/Makefile.in	2011-07-06 08:01:43.000000000 +0300
@@ -54,7 +54,7 @@
 	zm_coord.$(OBJEXT) zm.$(OBJEXT) zm_db.$(OBJEXT) \
 	zm_debug.$(OBJEXT) zm_event.$(OBJEXT) zm_exception.$(OBJEXT) \
 	zm_file_camera.$(OBJEXT) zm_ffmpeg_camera.$(OBJEXT) \
-	zm_image.$(OBJEXT) zm_jpeg.$(OBJEXT) zm_local_camera.$(OBJEXT) \
+	zm_image.$(OBJEXT) zm_jpeg.$(OBJEXT) zm_fbsd_camera.$(OBJEXT) \
 	zm_monitor.$(OBJEXT) zm_ffmpeg.$(OBJEXT) zm_mpeg.$(OBJEXT) \
 	zm_poly.$(OBJEXT) zm_regexp.$(OBJEXT) \
 	zm_remote_camera.$(OBJEXT) zm_remote_camera_http.$(OBJEXT) \
@@ -271,7 +271,7 @@
 	zm_ffmpeg_camera.cpp \
 	zm_image.cpp \
 	zm_jpeg.c \
-	zm_local_camera.cpp \
+	zm_fbsd_camera.cpp \
 	zm_monitor.cpp \
 	zm_ffmpeg.cpp \
 	zm_mpeg.cpp \
@@ -323,7 +323,7 @@
 	zm.h \
 	zm_image.h \
 	zm_jpeg.h \
-	zm_local_camera.h \
+	zm_fbsd_camera.h \
 	zm_mem_utils.h \
 	zm_monitor.h \
 	zm_ffmpeg.h \
@@ -470,7 +470,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_file_camera.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_image.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_jpeg.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_local_camera.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_fbsd_camera.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_monitor.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_mpeg.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_poly.Po@am__quote@
however... now the compilation in the old zm_fbsd_camera breaks...

Re: FreeBSD port for 1.23.3

Posted: Wed Jul 06, 2011 5:58 am
by achix
seems that the local camera code was heavily overhauled in 1.24, from 1.23
Do not know what to do, try to compile the old 1.23.3 port (still lives in my ports tree) or just try and see what i can do with this current port 1.24.4 :roll:

Re: FreeBSD port for 1.23.3

Posted: Wed Jul 06, 2011 3:23 pm
by bsam
Hello Achix,
achix wrote:1) i changed files/zm.in to look like :
Have you tried the solution from ports?
achix wrote:

Code: Select all

--- scripts/zmdc.pl.in.orig	2011-07-06 07:26:46.000000000 +0300
+++ scripts/zmdc.pl.in	2011-07-06 07:27:35.000000000 +0300
@@ -780,14 +780,14 @@
 	sleep( $delay );
 	foreach my $daemon ( @daemons )
 	{
-		my $cmd = "killall --quiet --signal TERM $daemon";
+		my $cmd = "killall -KILL $daemon 2>/dev/null";
Did you change the signal type from TERM to KILL on purpose?
achix wrote:

Code: Select all

 		Debug( $cmd );
 		qx( $cmd );
 	}
 	sleep( $delay );
 	foreach my $daemon ( @daemons )
 	{
-		my $cmd = "killall --quiet --signal KILL $daemon";
+		my $cmd = "killall -KILL $daemon 2>/dev/null";
 		Debug( $cmd );
 		qx( $cmd );
 	}
With those changes at /var/run/zm/zm.pid I get:
-----
8669No matching processes belonging to you were found
No matching processes belonging to you were found
No matching processes belonging to you were found
(many lines more...
-----

Re: FreeBSD port for 1.23.3

Posted: Wed Jul 06, 2011 3:47 pm
by achix
Hi Boris, pls change unset your "Disable BBCode" button because all your answers look like
[quote="bsam"]Hello Achix,....
[/quote]

this one

Re: FreeBSD port for 1.23.3

Posted: Wed Jul 06, 2011 3:52 pm
by achix
bsam wrote:8669No matching processes belonging to you were found
No matching processes belonging to you were found
No matching processes belonging to you were found
(many lines more...
-----
that was the point of 2>/dev/null, i do not know why this is happening.
right now i am in a desperation mode to make the old thing work.

if i manage to have some video from my local camera, maybe i will be encouraged to look at the
new local code in 1.24.

i'll keep in touch in any way, lets see...

thing is that when i run the new 1.24 and got the first screens, the thing frightened me with all the v4l stuff, it was just like crying for huge work in order to make it run on FreeBSD. I do not know what the situation is gonna be.
OTOH it is highly obsessive, if i start with this, then my daytime job will be held back (FreeBSD was always more interesting :)

anyway, take care, and we'll be in touch.

Re: FreeBSD port for 1.23.3

Posted: Wed Jul 06, 2011 3:56 pm
by bsam
achix wrote:Hi Boris, pls change unset your "Disable BBCode" button because all your answers look like
bsam wrote:Hello Achix,....
this one
Oh, thanks! I was scratching my head on how to do it. :D

Re: FreeBSD port for 1.23.3

Posted: Wed Jul 06, 2011 4:01 pm
by bsam
achix wrote:anyway, take care, and we'll be in touch.
Sure. Take care.

Re: FreeBSD port for 1.23.3

Posted: Mon Sep 19, 2011 5:28 pm
by darkfires
I've been putting significant effort into making zm_fbsd_camera.cpp work with 1.24.4.

As achix stated, the zoneminder API has drastically changed, and after much work I've gotten zm_fbsd_camera.cpp to compile, the only thing I have left to try before I can run is finish porting

int LocalCamera::Capture( Image &image )
{
Debug( 3, "Capturing" );

from zm_local_camera.cpp to zm_fbsd_camera.cpp

I've ripped out all the v4l code out of Capture(), zmc ends up crashing now, I could use some help since I don't 100% understand the code.

Here's my current version that compiles against 1.24.4

72.38.113.230/zm_fbsd_camera.cpp

9/19/2011 13:25:54.030529 zmdc[3968].INF [Starting pending process, zmc -d /dev/bktr0]
09/19/2011 13:25:54.036065 zmdc[3968].INF ['zmc -d /dev/bktr0' starting at 11/09/19 13:25:54, pid = 4284]
09/19/2011 13:25:54.374554 zmdc[3968].INF ['zmc -d /dev/bktr0' crashed, signal 10]

Re: FreeBSD port for 1.23.3

Posted: Mon Sep 19, 2011 5:46 pm
by darkfires
Anyone know where achix's original working port is?
The original URL doesn't work, and what is with this forum not letting me post anything with a ".c0m" in the sentence because it looks too "spamy". Horrible.

Re: FreeBSD port for 1.23.3

Posted: Mon Sep 19, 2011 5:59 pm
by achix
darkfires wrote:Anyone know where achix's original working port is?
The original URL doesn't work, and what is with this forum not letting me post anything with a ".c0m" in the sentence because it looks too "spamy". Horrible.
hello,
pm'me with your email to send you the code.

Re: FreeBSD port for 1.23.3

Posted: Mon Sep 19, 2011 9:42 pm
by darkfires
Hooray.... I've made some progress getting freebsd 8.2/zm_fbsd_camera.cpp to work with 1.24.4!!!

but All I'm getting is a red screen in the monitor, zmc doesn't crash and is reading from /dev/bktr0

I think that might have something to do with the input code getting moved around... I'm going to keep trying.

Re: FreeBSD port for 1.23.3

Posted: Mon Sep 19, 2011 9:53 pm
by darkfires
Hoooray! I've got it working :D Colors are a bit off still, but i've got video feed from the card in zoneminder monitor!

What's the proper course of action for getting this submitted so that other freebsd people will benefit?

I'd like someone else to possibly look over my changes as well, I'm sure I probably messed up, been a long time since I messed with C/C++.

Re: FreeBSD port for 1.23.3

Posted: Mon Sep 19, 2011 10:41 pm
by darkfires
I'm still trying to figure out how to correct the color issues. I get perfect picture from fxtv, so I've been going thru the code trying to figure out what's different.

It's like the palette is wrong, on linux i had to set it to BGR32 ... but I think bsd only has RGB32, invert doesn't seem to work either.

Re: FreeBSD port for 1.23.3

Posted: Tue Sep 20, 2011 12:17 am
by darkfires
I solved the color issue... the pallette was hitting default in the code. So I got it working nicely now on 1.24.4/8.2! :D

Re: FreeBSD port for 1.23.3

Posted: Tue Sep 20, 2011 1:57 am
by darkfires
zmc is taking up 100% cpu, trying to figure out why i believe its compat7.msgctl() failing


10311 initial thread CALL sigprocmask(SIG_UNBLOCK,0x7fffffffeb80,0)
10311 initial thread RET sigprocmask 0
10311 initial thread CALL sigprocmask(SIG_BLOCK,0x7fffffffeae0,0)
10311 initial thread RET sigprocmask 0
10311 initial thread CALL gettimeofday(0x7fffffffeb70,0)
10311 initial thread RET gettimeofday 0
10311 initial thread CALL gettimeofday(0x7fffffffe970,0)
10311 initial thread RET gettimeofday 0
10311 initial thread CALL compat7.msgctl(0x7fffffffc378,0,0)
10311 initial thread RET compat7.msgctl -1 errno 22 Invalid argument
10311 initial thread CALL gettimeofday(0x804c00594,0)
10311 initial thread RET gettimeofday 0
10311 initial thread CALL gettimeofday(0x80480f490,0)

I don't see msgctl() in all of ZoneMinder's src code so I'm not sure what's calling it

www 10311 100.0 1.1 229428 45724 1 R 9:25PM 31:51.32 /usr/local/bin/zmc -d /dev/bktr0