FreeBSD port for 1.23.3

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
achix
Posts: 146
Joined: Tue Oct 02, 2007 9:38 am
Location: Greece

Post by achix »

Jimmy wrote:Hi Achix,

I have the Kodicom KMC-4400R and have compiled Mark T's patch into the kernel, dmesg is showing as having detected bktr0 - bktr3 although a pciconf -lv lists the cards as being unknown vendor, which makes me question is Marks patch having the desired effect with the crossbar on the card?

I've tried all sorts of camera settings and still can't get any input other than a blue background with a timestamp, have you tried this card and got it working? If so what settings did you use?

Thanks

Jimmy
I have the same exact card and it works great.
I remember this patch didnt apply cleanly and i had to do some extra editing
in order for it to take full effect.

Also i put the line

Code: Select all

device          bktr
into the KERNCONF file.

Please do a

Code: Select all

ident /boot/kernel/kernel | grep -i bktr
to verify that you have indeed the bktr compiled into the kernel.

However using it as a kernel module should work ok too.

My pciconf -lv gives:

Code: Select all

bktr0@pci0:2:12:0:      class=0x040000 card=0x00000000 chip=0x036e109e rev=0x11 hdr=0x00
    vendor     = 'Conexant (Was: Brooktree Corp)'
    device     = 'Bt878/Fusion 878A Mediastream Controller'
    class      = multimedia
    subclass   = video
none1@pci0:2:12:1:      class=0x048000 card=0x00000000 chip=0x0878109e rev=0x11 hdr=0x00
    vendor     = 'Conexant (Was: Brooktree Corp)'
    device     = '7610144D&REV_02\4&1F7DBC9F&0&09F0 TV Video Capture'
    class      = multimedia
bktr1@pci0:2:13:0:      class=0x040000 card=0x00000000 chip=0x036e109e rev=0x11 hdr=0x00
    vendor     = 'Conexant (Was: Brooktree Corp)'
    device     = 'Bt878/Fusion 878A Mediastream Controller'
    class      = multimedia
    subclass   = video
none2@pci0:2:13:1:      class=0x048000 card=0x00000000 chip=0x0878109e rev=0x11 hdr=0x00
    vendor     = 'Conexant (Was: Brooktree Corp)'
    device     = '7610144D&REV_02\4&1F7DBC9F&0&09F0 TV Video Capture'
    class      = multimedia

.... rest of the bktr chips...
I dont use the crossbar, i just let the inputs to default to camera 1,2,3,4 respectively.

I also had this classic blue background effect, when i hadnt applied Mark's patch.
(i almost conducted the chinese guy from ebay to send my money back lol!)
After Mark's patch everything worked.
BaD.PinG
Posts: 3
Joined: Fri Dec 12, 2008 12:27 pm

Post by BaD.PinG »

Sorry for my English. I have a problem. Instead of watching pictures "blue screen". I use ZoneMinder 1.23.3, the system FreeBSD 7.0 stable. Card "Geovision GV-600" chip Conexant bt878a 16 channels. I have the same thig in the "Motion". In fxtv, xawtv, kbtv2 picture perfect. I think that this issue happens on the channels. Here are some logs...

Code: Select all

bktr0@pci0:2:1:0:       class=0x040000 card=0x763c003a chip=0x036e109e rev=0x11 hdr=0x00
    vendor     = 'Conexant (Was: Brooktree Corp)'
    device     = 'Bt878/Fusion 878A Mediastream Controller'
    class      = multimedia
    subclass   = video
none1@pci0:2:1:1:       class=0x048000 card=0x763c003a chip=0x0878109e rev=0x11 hdr=0x00
    vendor     = 'Conexant (Was: Brooktree Corp)'
    device     = '7610144D&REV_02\4&1F7DBC9F&0&09F0 TV Video Capture'
    class      = multimedia
fxtv logs. Here's all right:

Code: Select all

Fxtv v1.03

DETECTED CAPTURE CARD(S) [DRIVER PROBES]:
    bktr0: <BrookTree> mem 0xf7efe000-0xf7efefff irq 22 at device 1.0 on pci2
    bktr0: [GIANT-LOCKED]
    bktr0: [ITHREAD]
    bktr0: Detected a MSP34255?-?31 at 0x80
    bktr0: Hauppauge WinCast/TV, <no> tuner, dbx stereo, msp3400c stereo.
    pci2: <multimedia> at device 1.1 (no driver attached)
    bktr0: Detected a MSP34255?-?31 at 0x80
    bktr0: Detected a MSP34255?-?31 at 0x80
    bktr0: Detected a MSP34255?-?31 at 0x80
    bktr0: Detected a MSP34255?-?31 at 0x80
Options of my kernel:

Code: Select all

options 	SYSVSHM			# SYSV-style shared memory
options 	SYSVMSG			# SYSV-style message queues
options 	SYSVSEM			# SYSV-style semaphores
options 	SHMMAXPGS=65536
options 	SHMMNI=384
options 	SHMSEG=256 
device		bktr
device  	iicbus
device  	iicbb
device  	smbus
options 	OVERRIDE_CARD=2
options 	OVERRIDE_MSP=1
options 	OVERRIDE_DBX=1
options 	BROOKTREE_SYSTEM_DEFAULT=BROOKTREE_PAL
options 	BKTR_USE_PLL
options 	BKTR_GPIO_ACCESS
options 	BROOKTREE_ALLOC_PAGES=512

And log on the 9 level debugging:

Code: Select all

12/12/08 14:09:21.458360 zms[3473].INF-zm_debug.c/305 [New Debug Level = 9, New Debug Log = /tmp/zm_debug.log.03473]
12/12/08 14:09:21.458492 zms[3473].DB1-zms.cpp/91 [Query: mode=jpeg&monitor=1&scale=100&maxfps=10&rand=1229090960]
12/12/08 14:09:21.460323 zms[3473].DB1-zm_monitor.cpp/1967 [Got 1 monitors]
12/12/08 14:09:21.461819 zms[3473].DB1-zm_monitor.cpp/259 [monitor purpose=0]
12/12/08 14:09:21.461843 zms[3473].DB1-zm_monitor.cpp/266 [shm.size=9217188]
12/12/08 14:09:21.462172 zms[3473].DB1-zm_zone.cpp/50 [Initialised zone 0/All - 1 - 320x240 - Rgb:ff0000, CM:3, MnAT:15, MxAT:0, MnAP:50, MxAP:75000, FB:3x3, MnFP:50, MxFP:50000, MnBS:10, MxBS:0, MnB:0, MxB:0, OF: 0]
12/12/08 14:09:21.462419 zms[3473].DB9-zm_image.cpp/1343 [x1:0,y1:239 x2:0,y2:0]
12/12/08 14:09:21.462439 zms[3473].DB9-zm_image.cpp/1343 [x1:0,y1:0 x2:319,y2:0]
12/12/08 14:09:21.462456 zms[3473].DB9-zm_image.cpp/1343 [x1:319,y1:0 x2:319,y2:239]
12/12/08 14:09:21.462569 zms[3473].DB9-zm_image.cpp/1343 [x1:319,y1:239 x2:0,y2:239]
12/12/08 14:09:21.462635 zms[3473].DB9-zm_image.cpp/1363 [0: min_y: 0, max_y:239, min_x:0.00, 1/m:-0.00]
12/12/08 14:09:21.462671 zms[3473].DB9-zm_image.cpp/1363 [1: min_y: 0, max_y:239, min_x:319.00, 1/m:0.00]
12/12/08 14:09:21.462687 zms[3473].DB9-zm_image.cpp/1377 [Moving global edge]
12/12/08 14:09:21.462704 zms[3473].DB9-zm_image.cpp/1377 [Moving global edge]
12/12/08 14:09:21.462723 zms[3473].DB9-zm_image.cpp/1397 [0 - 0: min_y: 0, max_y:239, min_x:0.00, 1/m:-0.00]
I work with FreeBSD from 02.11.08. Please do not kick me badly ... =)
Jimmy
Posts: 16
Joined: Wed Jun 23, 2004 9:39 pm

Post by Jimmy »

Here's the fixed kodicom.patch for FreeBSD 7, it was only one line missing a carriage return causing the problem.

Bktr_reg.h was failing to apply because of it.

http://www.hamsterleymill.co.uk/kodicom.patch
achix
Posts: 146
Joined: Tue Oct 02, 2007 9:38 am
Location: Greece

Post by achix »

According to
http://www.geovision.com.tw/english/product/GV-600.htm
this card uses compression.
in this case i doubt the native freebsd local camera code can do
anything about t.
Jimmy
Posts: 16
Joined: Wed Jun 23, 2004 9:39 pm

Post by Jimmy »

Achix, thanks for the prompt on the kodicom.patch I didn't realise it was the cause of the problems at first. Kodicom card working fine in the browser now, streaming JPEG's brilliantly.

Now I have a video generation problem, did you have any problems generating video from the events, when I view an event, and click the video link, then using the default settings; format mpg (although I have tried mpeg and avi), rate real, size actual. I click generate video to be greeted with the error Video Generation Failed!

/var/log/messages reveals:

Dec 29 00:59:10 diesel zmvideo[5256]: ERR [Unable to generate video, check /usr/local/www/apache22/data/zm/events/1/1/ffmpeg.log for details]

However when I navigate to that folder there is no ffmpeg.log, I thought it was a permissions problem so I upped the events folder to 777 and still nothing, I checked that /usr/local/bin/ffmpeg is executable by www and it is.

Totally confused.

EDIT:

After much trials and tribulation I finally tracked the problem down to /usr/local/bin/zmvideo.pl line 324, features the line:

my $command = ZM_PATH_FFMPEG." -y -r $frame_rate ".ZM_FFMPEG_INPUT_OPTIONS." -i %0".ZM_EVENT_IMAGE_DIGITS."d-capture.jpg -s $video_size ".ZM_FFMPEG_OUTPUT_OPTIONS." '$video_file' >& ffmpeg.log";

The ">&" part of that line produces the error "Syntax error: Bad fd number" apparently this is caused by a shell syntax incopatibility on FreeBSD.

I was able to discover it after noticing the following in the zmfilter.log file:
zmfilter[4836].ERR [Video generation '/usr/local/bin/zmvideo.pl -e 2 -r 1 -s 1 -f mpg' failed with status: 255]

When running the following under bash it executed correctly!:

/usr/local/bin/zmvideo.pl -e 2 -r 1 -s 1 -f mpg

However when executed under FreeBSD's /bin/sh it failed with:

Syntax error: Bad fd number

The >& in line 324 is attempting to nullify the output of ffmpeg, the following patch does the equivalent in freebsd:

http://www.hamsterleymill.co.uk/zmvideo.patch

* Download it
* Extract it to /usr/local/bin
* Execute 'patch < zmvideo.patch'
* Execute 'chmod +x ./zmvideo.pl'

Hey presto, video generation now works.

SECOND EDIT:

Word of caution, check the field under:

Options > Images > ZM_FFMPEG_OUTPUT_OPTIONS

Which by default is set to '-r 25'. This specifies the frame rate for video encoding to ffmpeg and needs to be set to the same rate as defined in your actual camera frame rate, so in my case it's '-r 5', otherwise your videos look like they're doing a time warp! *shakes head*
achix
Posts: 146
Joined: Tue Oct 02, 2007 9:38 am
Location: Greece

Post by achix »

Jimmy thanx for the fine info and debugging!
great work!
neek
Posts: 15
Joined: Thu May 21, 2009 12:21 am

Any update for 1.24.x?

Post by neek »

Hi, I'm just trying to get ZoneMinder up and running on my freebsd box, but I think I need 1.24 (I need RTSP to access my ACM-1231 cam). I can try to do the port but didn't want to do a bunch of redundant work. From looking at the previous work, a lot of the patches don't seem relevant, so this may be a somewhat big effort. Thanks in advance.
nonofurbiz
Posts: 8
Joined: Wed Mar 23, 2011 8:29 am

Re: FreeBSD port for 1.23.3

Post by nonofurbiz »

hi guys,

awaking a 2-year old thread.. just wanted to ask hows the port update coming? tryed to build this one on the 8.0, run into 10 problems, now got it kinda running, but there are still so many bugs and errors.. why isnt that port being updated by somebody from the crew? any intel?..

thanks,
regards,
achix
Posts: 146
Joined: Tue Oct 02, 2007 9:38 am
Location: Greece

Re: FreeBSD port for 1.23.3

Post by achix »

nonofurbiz wrote:hi guys,

awaking a 2-year old thread.. just wanted to ask hows the port update coming? tryed to build this one on the 8.0, run into 10 problems, now got it kinda running, but there are still so many bugs and errors.. why isnt that port being updated by somebody from the crew? any intel?..

thanks,
regards,
For the following reasons :

1) nobody is interested any more
2) nobody gets paid to do it
3) nowadays with all the cheap and good network cameras who do 95% of the work of zm, zm lost its prestige.

PS
are there any alternatives to zm in terms of open source software? just asking.
nonofurbiz
Posts: 8
Joined: Wed Mar 23, 2011 8:29 am

Re: FreeBSD port for 1.23.3

Post by nonofurbiz »

i understand the trouble of maintaining this port, there are just too many depending ports.. updating suxs.. you say there are alternatives, are there? im just looking for a simple web ui of my local usb(10$) cameras, login page, a view of all cameras and a recording function..

ps^2: to anybody else, same question, is there any other software available for the job? :)
achix
Posts: 146
Joined: Tue Oct 02, 2007 9:38 am
Location: Greece

Re: FreeBSD port for 1.23.3

Post by achix »

nonofurbiz wrote:i understand the trouble of maintaining this port, there are just too many depending ports.. updating suxs.. you say there are alternatives, are there? im just looking for a simple web ui of my local usb(10$) cameras, login page, a view of all cameras and a recording function..

ps^2: to anybody else, same question, is there any other software available for the job? :)
You gotta make sure your USB cameras work with FreeBSD "traditionally" (natively) before even thinking about zoneminder.
Maybe you should talk to this guy : http://info.iet.unipi.it/~luigi/FreeBSD ... meras.html
Other people had problems as well : http://forums.freebsd.org/showthread.php?t=4729
BTW why dont you try with Ubuntu?
Anyways, yesterday, i installed Kubuntu for my wife-kids.... and as a result ... i am reinstalling FreeBSD tonight!!

OK
lets not be kidding here. This port has served my surveillance needs very well for all those years.
But i gotta upgrade some time (today). ffmpeg, automake, etc.. all of them would be a pain...
Maybe some time this summer i restart some porting for FreeBSD 8.2.
nonofurbiz
Posts: 8
Joined: Wed Mar 23, 2011 8:29 am

Re: FreeBSD port for 1.23.3

Post by nonofurbiz »

ive spend 10hours porting this port to 8.0, it kinda works now, but none of my cameras is supported by any of the fbsd usb drivers.. so yeah, i gotta write drivers, yuhey.. or ill just skip the coding and go straight to installing a w2k3 server on my esxi host :).. i guess the work will be then done in like 10minutes.. its a shame :)
nonofurbiz
Posts: 8
Joined: Wed Mar 23, 2011 8:29 am

Re: FreeBSD port for 1.23.3

Post by nonofurbiz »

anyway, is there any quality windows software-zoneminder alternatives even available.. wtf?:), maybe found 2 kinda close applications, none as good as zoneminder thats open-source?
achix
Posts: 146
Joined: Tue Oct 02, 2007 9:38 am
Location: Greece

Re: FreeBSD port for 1.23.3

Post by achix »

nonofurbiz wrote:ive spend 10hours porting this port to 8.0, it kinda works now, but none of my cameras is supported by any of the fbsd usb drivers.. so yeah, i gotta write drivers, yuhey.. or ill just skip the coding and go straight to installing a w2k3 server on my esxi host :).. i guess the work will be then done in like 10minutes.. its a shame :)
With windows you get the cameras ok, but loose .... the computer :D

Take a look here:
/usr/ports/multimedia/pwcbsd
and the above link of Luigi Rizzo.

with this you might be able to see the cameras, but only WITHOUT my bktr code.
My bktr code works exclusively for bktr chips/cards.
USB is another story, if you manage to see your USB cameras from within Video4Linux API
then you just try to compile the code as is with ZM video4linux support.
bsam
Posts: 22
Joined: Tue Oct 07, 2008 10:25 am

Re: FreeBSD port for 1.23.3

Post by bsam »

Hello,
actually it's a port for 1.24.2. I've adopted the existing one. I'd like to get a review before committing it. Thanks!

TODO:
1. Create zm.conf.dist and don't delete zm.conf if they are different.

--
WBR, bsam
Attachments
zoneminder.tar.gz
A port for 1.24.2
(25.58 KiB) Downloaded 235 times
Post Reply