TW6805 card - xawtv OK - zmu OK - ZM does not display images

Post here to ask any questions about hardware suitability, configuration in ZoneMinder, or experiences. If you just want to know if something works with ZoneMinder or not, please check the Hardware Compatibility sections in the forum, and the Wiki first. Also search this topic as well.
moorsey
Posts: 53
Joined: Sun Jan 03, 2010 8:56 am

Post by moorsey »

thanks for that Bill

well, compiled and installed OK and I got video!!

Although, it lasted for about 30 seconds before the preview window went green, mplayer now gives an input/output error, as does xawtv

Code: Select all

v4l2: ioctl dequeue buffer failed: Input/output error, idx = 0
So, there is something there that works, I will have more of a play over the weekend anyway and post back with what I find :D
whatboy
Posts: 304
Joined: Mon Aug 31, 2009 10:31 pm

Post by whatboy »

I have an 8 chips, 16 channels but xawtv -hwscan gives out like if I had 4 chips and 4 composites...

Code: Select all

This is xawtv-3.95, running on Linux/i686 (2.6.31.9-174.fc12.i686.PAE)
looking for available devices
port 63-94
    type : Xvideo, image scaler
    name : NV40 texture adapter

port 95-126
    type : Xvideo, image scaler
    name : NV40 high quality adapter

port 127-142
    type : Xvideo, image scaler
    name : NV Video Blitter

/dev/video0: OK                         [ -device /dev/video0 ]
    type : v4l2
    name : GENERIC
    flags:  capture  

/dev/video1: OK                         [ -device /dev/video1 ]
    type : v4l2
    name : GENERIC
    flags:  capture  

/dev/video2: OK                         [ -device /dev/video2 ]
    type : v4l2
    name : GENERIC
    flags:  capture  

/dev/video3: OK                         [ -device /dev/video3 ]
    type : v4l2
    name : GENERIC
    flags:  capture

And I still see ghostly images... Image
jamhed
Posts: 4
Joined: Mon Jan 11, 2010 7:02 am

Post by jamhed »

I have 1797:6804 with two cameras connected. I've downloaded latest version, and it seems to be working - i've got video from both of them. But eventually video degrades - it looks like cameras go out of sync. This process repeats periodically.
Is it a bug in a driver?
wbrack
Posts: 16
Joined: Fri Jan 08, 2010 1:00 am
Location: Hong Kong

multi-channel systems

Post by wbrack »

jamhed and whatboy,

Don't get confused between chips and channels. A TW68xx chip can handle up to 4 inputs (that's why the driver labels them 'Composite 1' through 'Composite 4'). Board manufacturers like to talk about "Channels" (it sounds better). A single-chip card is often advertised as a "4-Channel card". However, usually a multi-chip card will be advertised as a number of channels equal to twice the number of chips. In any event, a single chip can handle at most 25fps for PAL, or 30fps for NTSC. If a single chip is taking care of more than one camera, the chip's input must be switched back and forth between the different cameras, thus reducing the maximum framerate (and reducing by more than half, because it take some time to do the switching).

You can look at your board and see exactly how many TW68xx chips are on it. I have a "16 Channel" card (8 chips), which looks like this (sorry, it's a high-res image, and my server is a little old and slow, like me): http://www.bbrack.org/~bill/Techwell/img_0779.jpg

For that board, I get the following:

Code: Select all

[bill@bbi7a tw68-v2]$ lspci | grep 680
09:00.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
09:00.1 Multimedia controller: Techwell Inc. Device 6805 (rev 10)
09:02.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
09:02.1 Multimedia controller: Techwell Inc. Device 6805 (rev 10)
09:04.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
09:04.1 Multimedia controller: Techwell Inc. Device 6805 (rev 10)
09:06.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
09:06.1 Multimedia controller: Techwell Inc. Device 6805 (rev 10)
09:08.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
09:08.1 Multimedia controller: Techwell Inc. Device 6805 (rev 10)
09:0a.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
09:0a.1 Multimedia controller: Techwell Inc. Device 6805 (rev 10)
09:0c.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
09:0c.1 Multimedia controller: Techwell Inc. Device 6805 (rev 10)
09:0e.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
09:0e.1 Multimedia controller: Techwell Inc. Device 6805 (rev 10)
[bill@bbi7a tw68-v2]$ 
and, after the driver has been loaded,

Code: Select all

[bill@bbi7a tw68-v2]$ ls /dev/vid*
/dev/video0  /dev/video2  /dev/video4  /dev/video6
/dev/video1  /dev/video3  /dev/video5  /dev/video7
[bill@bbi7a tw68-v2]$ 
I also have a single-chip "4-Channel" card. Similar listings look like this:

Code: Select all

[bill@bb64 tw68-v2]$ lspci | grep 680
04:09.0 Multimedia video controller: Techwell Inc. TW6802 multimedia video card (rev 10)
04:09.1 Multimedia controller: Techwell Inc. TW6802 multimedia other device (rev 10)
[bill@bb64 tw68-v2]$ 
and this:

Code: Select all

[bill@bb64 tw68-v2]$ ls -l /dev/video*
crw-rw----+ 1 root video 81, 0 2010-01-11 16:01 /dev/video0
[bill@bb64 tw68-v2]$ 
Regarding the ghosting problem, I'm quite sure it's unrelated to the previous postings on that subject. I believe there is a problem when more than one camera is connected to a single chip, and the application software (zoneminder) switches back and forth between channels. I'm still looking into that, but here's what my 4-chip interface looks like with one camera connected to each chip (one of my cameras is NTSC, the other 3 are PAL):
Image

and here's the system status:
Image
It's an Intel Core2 4-core system, and two people were monitoring the Montage view. There doesn't seem to be anything in the way of cross-camera interference, and (since each camera is being controlled by a separate chip, and separate video buffers are allocated for each chip) it would really be difficult, even for me, to get that screwed up.

I'll let people know if and when I find the suspected problem with channel-switching.

Bill
TW68xx Driver Developer
whatboy
Posts: 304
Joined: Mon Aug 31, 2009 10:31 pm

Post by whatboy »

Code: Select all

lspci | grep 680
02:04.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
02:04.1 Multimedia controller: Techwell Inc. Device 6805 (rev 10)
02:05.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
02:05.1 Multimedia controller: Techwell Inc. Device 6805 (rev 10)
02:06.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
02:06.1 Multimedia controller: Techwell Inc. Device 6805 (rev 10)
02:07.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
02:07.1 Multimedia controller: Techwell Inc. Device 6805 (rev 10)
02:08.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
02:08.1 Multimedia controller: Techwell Inc. Device 6805 (rev 10)
02:09.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
02:09.1 Multimedia controller: Techwell Inc. Device 6805 (rev 10)
02:0a.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
02:0a.1 Multimedia controller: Techwell Inc. Device 6805 (rev 10)
02:0b.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
02:0b.1 Multimedia controller: Techwell Inc. Device 6805 (rev 10)

Code: Select all

ls /dev/vid*
/dev/video0  /dev/video1  /dev/video2  /dev/video3  /dev/video4  /dev/video5  /dev/video6  /dev/video7

I had to add the 666 because it was 660 to the last 4 /dev/video4 .. /dev/video7

Code: Select all

ls -l /dev/video*
crw-rw-rw-+ 1 root video 81,  0 2010-01-10 16:21 /dev/video0
crw-rw-rw-+ 1 root video 81,  2 2010-01-10 16:21 /dev/video1
crw-rw-rw-+ 1 root video 81,  4 2010-01-10 16:21 /dev/video2
crw-rw-rw-+ 1 root video 81,  6 2010-01-10 16:21 /dev/video3
crw-rw-rw-+ 1 root video 81,  8 2010-01-09 09:46 /dev/video4
crw-rw-rw-+ 1 root video 81, 10 2010-01-09 09:46 /dev/video5
crw-rw-rw-+ 1 root video 81, 12 2010-01-09 09:46 /dev/video6
crw-rw-rw-+ 1 root video 81, 14 2010-01-10 00:09 /dev/video7

Mine looks like this...
Image
whatboy
Posts: 304
Joined: Mon Aug 31, 2009 10:31 pm

Post by whatboy »

Oh wait... I do have great pic... no ghost images... but at 30 FPS... which is a lot of load for my PC... I want to reduce the FPS to 7... and that's when shit happens!!!

No ghost @ 30FPS
Image

Ghost @ 7FPS
Image
wbrack
Posts: 16
Joined: Fri Jan 08, 2010 1:00 am
Location: Hong Kong

Post by wbrack »

whatboy,

I assume (from the 30fps) that you're running 2 NTSC cams on 2 chips for your current testing. How about your "options"? bensttech pointed out to me a post in another forum suggesting setting options, "config" tab, CAPTURES_PER_FRAME to a higher value. When I experiment with 2 cams on 1 chip, I find that increasing that setting to 8 results in a perfect capture on both cams (the bad news, though, is that framerate drops to <2 fps). Give that a try, and also let me know what type/speed of CPU you are running on.

Bill
TW68xx Driver Developer
whatboy
Posts: 304
Joined: Mon Aug 31, 2009 10:31 pm

Post by whatboy »

whatboy,

I assume (from the 30fps) that you're running 2 NTSC cams on 2 chips for your current testing. How about your "options"? bensttech pointed out to me a post in another forum suggesting setting options, "config" tab, CAPTURES_PER_FRAME to a higher value. When I experiment with 2 cams on 1 chip, I find that increasing that setting to 8 results in a perfect capture on both cams (the bad news, though, is that framerate drops to <2 fps). Give that a try, and also let me know what type/speed of CPU you are running on.

Bill
I know about that... but I have two PCs with the same CPU, Memory... CPU is Intel CeleronD 2.93Ghz, 2Gb Memory... but the other PC has two Hauppauge ImpactVCB, using two channels on each card @5FPS with a res740x480... load .50~.60 and have a value of 1 on CAPTURES_PER_FRAME... the way to set the FPS is on the Monitor options... where its says HERE, you put the value you want...

Image
jamhed
Posts: 4
Joined: Mon Jan 11, 2010 7:02 am

Post by jamhed »

Yeah, I have one chip on board and four channels advertised by a card vendor - there is one /dev/video0 node, and 4 "channels" in zoneminder corresponds to four composite inputs on card, so I guess it switches one chip among them. I'd like to see 5fps per camera for example, and it really gets, except that problem with loosing sync.

How can it be fixed? And how can I help? :)
jamhed
Posts: 4
Joined: Mon Jan 11, 2010 7:02 am

Post by jamhed »

it looks like that (images are rotated by 90 deg).
Image Image
wbrack
Posts: 16
Joined: Fri Jan 08, 2010 1:00 am
Location: Hong Kong

tw68 driver updated

Post by wbrack »

I found another control register on the TW68xx which has a big effect on the resynchronization after switching the chip's input, and I adjusted the initialisation of that register. The updated source is on gitorious.org/tw68.

For multiple cameras per chip, it will be necessary to set the variable CAPTURES_PER_FRAME (on the "config" tag under "options") to at least 2. I think this is because, on the TW68xx chip, the changing of the input takes place immediately, which could easily be in the middle of a frame (I say "I think", because the chip's datasheet isn't clear on this). Unfortunately, that means that the maximum framerate that can be achieved (assuming Maximum FPS is left blank) will be
  • framerate / 2 / # cameras per chip
i.e. for 2 cameras per chip, PAL should be about 6.25fps; for NTSC, about 7.5. Note this only applies to boards with multiple cameras per chip - if there is only one input being used on each chip, there should be no problem.

Bill
TW68xx Driver Developer
jamhed
Posts: 4
Joined: Mon Jan 11, 2010 7:02 am

Post by jamhed »

Thanks! It works. I found just another glitch - one of my cameras is colour, and the image from that camera goes black&white and then colour, in cycle. If I'm viewing still images one frame is black and white, and other is colour. It's not a big problem, however, but strange.
whatboy
Posts: 304
Joined: Mon Aug 31, 2009 10:31 pm

Post by whatboy »

Thank you very much WBrack...

but the value of 2 for CAPTURES_PER_FRAME didn't work for Me... I set it to 3... because I still see some "jumpings"... with 3 I get 5FPS which is what I got on the other system... and that is just great...

Image


Edit: nope... I still see some jumpings... might couse alarms... I'm gonna set the system to modrecd and see what it captures...
robby
Posts: 5
Joined: Wed Jan 13, 2010 1:20 pm
Location: Romania

Re: tw68 driver problems

Post by robby »

wbrack wrote:mooresey,

Some bad news, I'm afraid. According to your lspci, your board is using TW6800 chips, while all of the other people posting have TW6802 or TW6805 chips. On my 4-chip TW6805 board, for instance, I get:

Code: Select all

[bill@bbsuper tw68-v2]$ lspci | grep 68
06:04.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
06:05.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
06:06.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
06:07.0 Multimedia video controller: Techwell Inc. Device 6804 (rev 10)
(the '6804' is the common sub-module of the chip which handles video processing for both the TW6802 and TW6805). The TW6800 was the "Grandfather" of the series, and isn't altogether compatible. During driver development, there has been no testing of the TW6800, for the simple reason that I don't have access to one.

Because there was no testing, at the moment the driver won't even recognize the chip. For anyone technically inclined, this is related to the PCI-ID, which for the TW6802 and TW6805 is 1797:6804, while for the TW6800 it is 1797:6800 - you can see for yourself by giving the command

Code: Select all

lspci -n
If you'd like, I can enhance the driver to make it recognize your PCI-ID (that's fairly simple). However, it is likely there will be further problems once it's been recognized.

Bill

I've installed the latest TW68 driver and I get my TW6800 based card working with mplayer, but not in ZM.
I also have installed a Bt878 based card and it works fine in ZM.

This is my lspci:
02:03.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
02:03.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)
02:04.0 Multimedia video controller: Techwell Inc. Device 6800 (rev 11)

These are some errors from dmesg:
bttv0: PLL can sleep, using XTAL (28636363).
tw6800[0]/0: [dac94240/1] timeout - dma=0x19d0c000
tw6800[0]/0: [dac94000/0] timeout - dma=0x1bbfe000
tw6800[0]/0: [dac94cc0/0] timeout - dma=0x11546000
tw6800[0]/0: [dac94a80/1] timeout - dma=0x12eb0000
bttv0: PLL: 28636363 => 35468950 .. ok
tw6800[0]/0: [dac94000/1] timeout - dma=0x0c790000
tw6800[0]/0: [dac94d80/0] timeout - dma=0x11348000
tw6800[0]/0: [dac94000/1] timeout - dma=0x0c790000
tw6800[0]/0: [dac94d80/0] timeout - dma=0x11348000
mtrr: no MTRR for d8000000,4000000 found
tw6800[0]/0: [dac940c0/0] timeout - dma=0x08130000
tw6800[0]/0: [dac94600/1] timeout - dma=0x09fb8000
tw6800[0]/0: [dac94e40/1] timeout - dma=0x01b30000
tw6800[0]/0: [dac94900/0] timeout - dma=0x01a06000
whatboy
Posts: 304
Joined: Mon Aug 31, 2009 10:31 pm

Post by whatboy »

Ok, alarm jumping can be eliminated by incrementing the Alarm_Frame_Count to more than 2 since jumping only occurs in 1 frame...


I do get a lot of those messages in dmesg too...

Code: Select all

tw6804[4]/0: [f59c6f00/0] timeout - dma=0x33cba000
tw6804[4]/0: [f59c6d80/1] timeout - dma=0x33db4000
tw6804[4]/0: [f59c6c00/2] timeout - dma=0x306ae000
tw6804[4]/0: [f59c6540/3] timeout - dma=0x307a8000
tw6804[4]/0: [f4538cc0/0] timeout - dma=0x33c90000
tw6804[4]/0: [f4538540/1] timeout - dma=0x33dca000
tw6804[4]/0: [f4538000/2] timeout - dma=0x2fcc4000
tw6804[4]/0: [f4538f00/3] timeout - dma=0x2fdbe000
tw6804[4]/0: [f3d419c0/0] timeout - dma=0x2fc2c000
tw6804[4]/0: [f3d41240/1] timeout - dma=0x30556000
tw6804[4]/0: [f58a9900/2] timeout - dma=0x2fc70000
tw6804[4]/0: [f58a9f00/3] timeout - dma=0x2fcea000
tw6804[4]/0: [f58a9540/0] timeout - dma=0x2fca0000
tw6804[4]/0: [f2b87d80/1] timeout - dma=0x33cc0000
tw6804[4]/0: [f2b87240/2] timeout - dma=0x305fa000
tw6804[4]/0: [f2b87840/3] timeout - dma=0x2f8b4000
tw6804[0]/0: [f59c6000/1] timeout - dma=0x33d12000
tw6804[0]/0: [f59c6b40/2] timeout - dma=0x2fdfe000
tw6804[0]/0: [f59c6f00/3] timeout - dma=0x33cd8000
tw6804[0]/0: [f59c6840/0] timeout - dma=0x338bc000
tw6804[4]/0: [f4538540/2] timeout - dma=0x33da8000
tw6804[4]/0: [f4538cc0/3] timeout - dma=0x2f9a2000
tw6804[4]/0: [f45380c0/0] timeout - dma=0x33cb4000
tw6804[4]/0: [f4538000/1] timeout - dma=0x3386e000
tw6804[4]/0: [f2b87d80/2] timeout - dma=0x304d8000
tw6804[4]/0: [f2b879c0/3] timeout - dma=0x2fd12000
tw6804[4]/0: [f2b87840/0] timeout - dma=0x2fce4000
tw6804[4]/0: [f2b87240/1] timeout - dma=0x2fc5e000
tw6804[4]/0: [f59c6000/2] timeout - dma=0x2fc62000
tw6804[4]/0: [f59c6840/3] timeout - dma=0x2fbdc000
tw6804[4]/0: [f59c6780/0] timeout - dma=0x2f98c000
tw6804[4]/0: [f59c6b40/1] timeout - dma=0x304e8000
tw6804[4]/0: [f59c6b40/2] timeout - dma=0x2fcbe000
tw6804[4]/0: [f59c6780/3] timeout - dma=0x2f478000
tw6804[4]/0: [f59c6f00/0] timeout - dma=0x2fc4a000
tw6804[4]/0: [f59c6000/1] timeout - dma=0x33824000
tw6804[4]/0: [f59c6000/3] timeout - dma=0x33cbe000
tw6804[4]/0: [f59c6840/0] timeout - dma=0x2fcc4000
tw6804[4]/0: [f59c6780/1] timeout - dma=0x2f98a000
tw6804[4]/0: [f59c6b40/2] timeout - dma=0x304c4000
Post Reply