venerdì 17 luglio 2009

Having fun with conexant bt878 chip...


Dear all,
it's almost 3 days I'm fighting against an old capture card based on the famous bt878a chip produced by Conexant. The bt878a is able to acquire one PAL signal at 25fps (NTSC is supported too). This is the theory, now let's see the practice!

The card I'm using is a very cheap 4 composite input card. The design reference name is ucc4. More info are availables here. This card was born to be used (and this is what I'm trying to do) with video surveillance software.
The 4 inputs are all handled by the same bt878 chip, infact the bt878 integrates one programmable video mux.
This card was born during old win95/NT times and its official software (PICO 2000) is not much improved since then. Well, I'm not telling the complete truth. The 99% of PICO2000 implementations you may find online are an unsupported beta version, which calling it buggy would be an honor. The official version (PICO2000 1.9 when I'm writing this post) is not a wonderful example about "HOWTO design a GUI in 21st century" but I must admit is fast and reliable. So, what's the problem? Well, the problem is you have to pay for it. Nothing against commercial software (take a look at the job I do to live!) but nowdays the hw market offers much better DVR cards in terms of acquisition (having one chip only and 4 inputs means 7fps per input...) and video compression (i.e. h.264 compression onboard). So I believe UCC4 is nowdays a good solution for homemade video surveillance systems and I would like to have it working with a freeware solution.
I must say I'm a linux fan (I use it since almost ten years), but in this case I had the requirement to use Windows XP (for those interested, the card works under linux...). The motivation is trivial: most of home users have Redmond's o.s. on their pc and would not install linux just because of a 10$ card (yes this is ucc4 current value in Europe. In china it is sold at 0.99$)
Problem: the drivers bundled with these cards work with pico2000 sw only. Googling around I then found btwincap a sourceforge project aiming to produce WDM compatible drivers for these conexant chipsets. As you may read on btwincap websites each card can have different pins assignments, requiring the drivers to be aware about it (bt878a has 24 programmable I/O pins used for example to control external muxes). thanks to btspy, a tool available from btwincap guy and able to detect the pin assignments and produce a config file to be used during the driver install procedure, I was able to have ucc4 working with almost all my video acquisition softwares (I usually use AmCap for testing video acquisition hw).
Unfortunately all the sw I tested are unaware about the video mux issue, so I'm unable to display two or more channels concurrently. What I would need is a sw able to switch channels 4times per seconds, so driving the mux dynamically...this is what pico2000 probably does.
I'm very interested in solving this issue so I'm thinking about wiriting a piece of sw to do this. If you know some solution let me know!

A possible solution. Ok since there are tons of video surveillance sw, it would be a waste of time and efforts trying to write a new sw just to support a 10 years old card. What I'm thinking about is a sort of intermediate layer between btwincap drivers and video capture software. It would be enough a btwincap wrapper switching sequentially between enabled channels (so driving the video mux) . then this wrapper would expose 4 virtual channels to app layer with particular attention to video buffers. When a channel is freezed (because the chip is working in a time slot dedicated to another input channel) this wrapper would have to continue displaying the same frame. So even if the digital output is one (because we have one chip only) 4 buffers would be required anyway...

Here's attached the btspy report in order to have ucc4 working with btwincap:

General information:
Name:ucc4
Chip: Bt878 , Rev: 0x00
Subsystem: 0x00000000
Vendor: Gammagraphx, Inc.
Values to MUTE audio:
Mute_GPOE : 0xf00000
Mute_GPDATA: 0xf00000
Has TV Tuner: No
Number of Composite Ins: 4
Composite in #1
Composite1_Mux : 2
Composite1_GPOE : 0xf00000
Composite1_GPDATA: 0xf00000
Composite in #2
Composite2_Mux : 3
Composite2_GPOE : 0xf00000
Composite2_GPDATA: 0xf00000
Composite in #3
Composite3_Mux : 1
Composite3_GPOE : 0xf00000
Composite3_GPDATA: 0xf00000
Composite in #4
Composite4_Mux : 0
Composite4_GPOE : 0xf00000
Composite4_GPDATA: 0xf00000
Has SVideo: No
Has Radio: No

Nessun commento:

Posta un commento