Saturday, August 23, 2014

Linux Compatible DVR PCI Card for CCTV

Ok I've been searching for a linux compatible DVR PCI card for my CCTV security system. This will be for home security, but knowledge gain, can be used in business or future business plans. Being an investor, what I've learned is, Security is the backbone of investing, like one time our business Internet Cafe got robbed and all the computers was taken out, good thing it was insured, so if there is something you shouldn't be taking for granted is security.

Yeah well anyone could just buy those stand alone CCTV DVR box, but I want something more flexible, because I will put it on an existing computer system, an all-in-one system. I have this computer that runs 24/7, its a data storage, media server, downloads, media streaming and all you can think of, adding a CCTV capability is one of it. Basically if you are running the Windows Operating System(OS) you won't have problems looking for a DVR PCI card that is compatible because all manufacturers made them for that OS, but I am not using that Windows OS especially for a 24/7 server system let alone for security, the system would crash or succumb to malwares or viruses if someone downloaded nasty files, or somebody poking on the system without being asked for an administrative password . I want something more stable, secured and solid Operating System, like a Linux one, Ubuntu Linux is the one I use because its more user friendly.

Its really hard to find one compatible cards, it will cost you just for looking and finding out it was not compatible. Its like looking for a girlfriend, its about searching for the right one from the start and not you hurriedly just get this one then later on you fix the problem because it doesn't work, its a big headache, you should know from the start what you should get.

If you are still not sure which dvr pci card to get, for starters, the sure way is checking out the chipset, it should be using a Conexant chipset, see that black square chips on the picture below, this thing are older versions but it will work on linux as HD cctv box starting to pop up in the market. One chipset will give you 640x480 resolution with 30 frames per second(fps) per camera, if you add additional camera, the quality and resolution will be reduced and be shared on a single chipset, example is 2 cameras running at 320x240 15fps, so if you want to add more camera with good quality resolution and frame rate then you should get the one with multiple chipset.



Generic Kodicom 4400 DVR PCI with 4 Conexant chipset
XV400 Lite with only 1 Conexant chip
Conexant Chip

I got the XV400 Lite, it was on sale price of P1,450, but it only has one Conexant chipset, its like using those old tv tuners with Conexant chips minus the tv-tuner like on my current system, I have 2 old tv-tuner for 2 cameras, but I want 4 cameras using one PCI slot, the XV400 didn't help, its like I bought another tv-tuner, unlike the one I got from Gilmore I.T center building, I found one generic kodicom4400 card for P840 only, its in the ground floor a stall named A&R, but their main store is in the 2nd floor right on the one that sells branded CCTV shop, just inquire inside if there is no person manning the ground floor stall.

DVR Card Blunder

Before that, I was actually looking for that kodicom4400 card for a long time here locally in the Philippines, at first I got one from an online store, it was shipped with a broken Integrated Cuircuit(IC) and some bent pins probably due to delivery. That thing cost $57(P2,470) including the paid delivery, then after that when it arrived to my house, I have to pay for another P1,320 for taxes and stuff just to realize it was broken, it was so frustrating that thinking of returning it is a headache and it was better to drop the idea, sometimes I think I should have just bought a standalone box. The detached IC pin is so small that its impossible to solder back, I tried but it bloated out, so I just went to Quiapo and find a similar IC for P40 each and it was an easy solder, still it doesn't work on my linux box, it was detected as /dev/video but it doesn't work, it should as I researched this card on the net already, so I thought it may be really damaged not just the IC.
 
Broken IC, 100uf 16v and bend pin


Resolder using different IC bought at Quiapo with same rating

So I gave up with the idea and just headed to Gilmore to get a 2TB hard drive. Until I saw that another generic kodicom4400 brand for P840. It was so hard to resist, my curiosity is killing me. And so I bought it, just to realize its not working like the first card, and so that struck me, maybe its not the hardware, and yes, it was on the software side. So now I have 2 working kodicom cards, I really mess up this one, but nevertheless I would charge it to experience. I might be keeping the other kodicom card in case the other one fails, its hard to find this card locally anyway let alone import one from abroad. Also that XV400 will go to storage along with the other old TV-tuner card I used. Well at least its working with Linux, the last thing I would not want is getting a card that is incompatible with Linux.

Configuring the software

In the Ubuntu 12.04 LTS Linux system, I run the terminal app and type ls /dev/video*
This shows that a video device is detected, since I use the 4 chip kodicom card, it shows 4 device. There is the new version called 14.04 LTS but I don't intend to use it yet since there is no tutorial yet available floating around online on how to make the kodicom card work on it, this trick no longer works on the new version, I tried it, so I stick to the one that works for me personally.








If you type dmesg on the terminal or command prompt, you will see this UNKNOWN/GENERIC thing.














All you need to do is type sudo gedit /etc/modprobe.conf and add that line on the notepad that will pop up.

alias char-major-81 bttv
options bttv gbuffers=16 card=133,132,133,133 tuner=4,4,4,4













You add the line chroma_agc=1 if your camera input turned black and white then save the notepad, a restart might be required.

Then after that, once you type in the dmesg again on the terminal, you will see it now as Kodicom 4400R, it can now be used in Zoneminder.











Zoneminder is a free CCTV software for Linux, you can install it here for the instructions.

There are HD dvr out there but I haven't test it on Linux, so what I described are based on personal experience. 640x480 30fps is actually good VGA quality, its next to HD, what you need is a good camera if you want clearer shots not more resolution, get a good camera first not dvr card, that's where you should be spending money in the first place, that will define clarity, night shots and zoom. A P1,700 camera is only the minimum camera you can get with decent quality, any lower than that is like using a webcam quality.




Conexant Systems, Inc. is an American semiconductor company, formerly the semiconductor division of Rockwell International.