Page 4 of 9

Posted: Wed Jan 13, 2010 7:26 pm
by whatboy
Ok, so cameras are red...

dmesg

Code: Select all

tw6804[0]/0: [f28019c0/0] timeout - dma=0x31106000
tw6804[0]/0: [f28019c0/0] timeout - dma=0x31818000
tw6804[0]/0: [f28019c0/0] timeout - dma=0x310e5000
tw6804[0]/0: [f2801780/0] timeout - dma=0x310e1000
tw6804[0]/0: [f2801840/0] timeout - dma=0x310e1000
tw6804[0]/0: [f2801780/0] timeout - dma=0x3193e000
tw6804[0]/0: [f2801600/0] timeout - dma=0x310e6000
tw6804[0]/0: [f2801840/0] timeout - dma=0x310eb000
tw6804[0]/0: [f2801b40/0] timeout - dma=0x31105000
tw6804[0]/0: [f28019c0/0] timeout - dma=0x3107e000
tw6804[0]/0: [f2801840/0] timeout - dma=0x2f492000
tw6804[0]/0: [f2801300/0] timeout - dma=0x3285b000
/var/log/messages/

Code: Select all

Jan 13 13:17:28 localhost zmc_dvideo0[3340]: WAR [Capture failure, possible signal loss?: Input/output error]
Jan 13 13:17:28 localhost kernel: tw6804[0]/0: [f2801300/0] timeout - dma=0x3285b000
Jan 13 13:17:28 localhost zmc_dvideo0[3340]: ERR [Failed to capture image from monitor 5 (0/2)]
Jan 13 13:17:28 localhost zmdc[3001]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
service zm restart does nothing... have to restart PC, cameras are green again...

Posted: Thu Jan 14, 2010 1:02 pm
by robby
Thank you guys !

At last I managed to see some images from my refurbished TW6800 based card also with zm using the tw68 device driver .

Working settings for zm and my camera are:

Code: Select all

Device format  PAL I
Capture palette BGR 24
Capture Witdth 384
Capture Height 288

CAPTURES_PER_FRAME = 2
With bigger resolution than 384x288 zm does not work (but mplayer does).
I will try changing dimension of shared memory later.

And now bad news: the images I get are somehow corrupted (see below) and after a while (from few minutes to half an hour) the device driver stops working and zm gets errors.

If I remove the device driver and install it again (make instmod) , I get images again.


Here some more informations:

dmesg

Code: Select all

tw68: v4l2 driver version 0.0.2 loaded
tw68 0000:02:04.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
tw6800[0]: found at 0000:02:04.0, rev: 17, irq: 17, latency: 64, mmio: 0xfb000000
tw6800[0]: subsystem: 0000:0000, board: GENERIC [card=0,autodetected]
tw6800[0]: Unable to determine board type, using generic values
IRQ 17/tw6800[0]: IRQF_DISABLED is not guaranteed on shared IRQs
tw6800[0]: registered device video1 [v4l2]
tw6800[0]: registered device vbi1
lspci

Code: Select all

02:04.0 Multimedia video controller [0400]: Techwell Inc. Device [1797:6800] (rev 11)
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort>SERR- <PERR- INTx-
	Latency: 64 (8000ns min, 18000ns max), Cache Line Size: 32 bytes
	Interrupt: pin A routed to IRQ 17
	Region 0: Memory at fb000000 (32-bit, non-prefetchable) [size=16M]
	Kernel driver in use: tw68
Why size is so big (16M)? (For the bt878 size is only 4K)


var/log/messages

Code: Select all


Jan 13 15:43:49 pentium4 zmdc[12273]: INF ['zmc -d /dev/video1' started at 10/01/13 15:43:49]
Jan 13 15:43:49 pentium4 zmc_dvideo1[12273]: INF [Debug Level = 0, Debug Log = <none>]
Jan 13 15:43:49 pentium4 zmdc[12236]: INF ['zmc -d /dev/video1' starting at 10/01/13 15:43:49, pid = 12273]
Jan 13 15:43:50 pentium4 zmc_dvideo1[12273]: INF [Starting Capture]
Jan 13 15:43:50 pentium4 zma_m2[12265]: INF [In mode 3/0, warming up]
Jan 13 15:43:50 pentium4 zmdc[12277]: INF ['zmfilter.pl' started at 10/01/13 15:43:50]
Jan 13 15:43:50 pentium4 zmdc[12236]: INF ['zmfilter.pl' starting at 10/01/13 15:43:50, pid = 12277]
Jan 13 15:43:50 pentium4 kernel: tw6800[0]/0: [ccce7f00/0] timeout - dma=0x049aa000
Jan 13 15:43:50 pentium4 kernel: tw6800[0]/0: [ccce7840/1] timeout - dma=0x1ad05000
Jan 13 15:43:50 pentium4 kernel: tw6800[0]/0: [ccce7900/2] timeout - dma=0x18d63000
Jan 13 15:43:50 pentium4 kernel: tw6800[0]/0: [da54bd80/3] timeout - dma=0x048a6000
Jan 13 15:43:50 pentium4 kernel: tw6800[0]/0: [da54b540/4] timeout - dma=0x0fd8e000
Jan 13 15:43:50 pentium4 kernel: tw6800[0]/0: [da54bf00/5] timeout - dma=0x08aac000
Jan 13 15:43:50 pentium4 kernel: tw6800[0]/0: [da54bb40/6] timeout - dma=0x17e04000
Jan 13 15:43:50 pentium4 kernel: tw6800[0]/0: [da54b840/7] timeout - dma=0x0e56e000
Jan 13 15:43:50 pentium4 zmc_dvideo1[12273]: WAR [Capture failure, possible signal loss?: Input/output error]
Jan 13 15:43:50 pentium4 zmc_dvideo1[12273]: ERR [Failed to capture image from monitor 5 (0/1)]
Jan 13 15:43:50 pentium4 zmdc[12236]: ERR ['zmc -d /dev/video1' exited abnormally, exit status 255]
Here a picture :

Image
What are those black an green stripes on the left border?
(The camera is OK because using the bt878 card the image is good.)

Posted: Thu Jan 14, 2010 6:18 pm
by moorsey
Robby,

Looks like you have the same card as me.

Unfortunately, the driver isn't specifically designed to work with 6800 cards. I got the exact same bars on the side of my image. I also got the same thing with the driver stopping after a while.

Martin

Posted: Thu Jan 14, 2010 11:15 pm
by whatboy
Frack... I thought someone was working on another driver, but looks abandon

http://tw98.sourceforge.net/

tw6800 problems

Posted: Fri Jan 15, 2010 1:23 am
by wbrack
robby,

Thanks for the further info on the tw6800. That card's very difficult for me, because I don't have any card with that chip for testing (mine are all tw6802 and tw6805).

The timeout messages are certainly a problem, but I'm pretty sure that's the same problem others are reporting (and I'm currently working on that). I think your "Device format" should probably be PAL (rather than PAL I), but with the current version of the driver it shouldn't make any difference. For the vertical bars on the left side of the picture, I would guess that is caused by the driver code which does the picture "size", setting up registers including the delay of the position of the horizontal sync pulse. Apparently the tw6800 has some differences from the tw6802/tw6805 in these settings. We can work on that after some of the other problems have been resolved.

For the rest, I'll need to get a log of the driver's messages when the problems occur. I'm not sure what your level of knowledge is for linux setup; I'll be glad to give more details on whatever additional information you need to do this. To produce this log, do the following

Code: Select all

insmod tw68.ko video_debug=7
That will produce kernel messages with "facility"="kern" and "priority"="debug". I'm looking for messages like this:

Code: Select all

Jan 15 09:15:33 bb64 kernel: tw6801[0]/0: video_mux: input = 0 [Composite1]
Jan 15 09:15:33 bb64 kernel: tw6801[0]/0: set_tvnorm: PAL-BG
Jan 15 09:15:41 bb64 kernel: tw6801[0]/0: buffer_prepare: Generating new risc code [384x288x32](1536)
Jan 15 09:15:41 bb64 kernel: tw6801[0]/0: tw68_set_scale: width=384, height=144, both=1
Jan 15 09:15:41 bb64 kernel:  Crop rect: top=24, left=0, width=720 height=288
Jan 15 09:15:41 bb64 kernel:  tvnorm h_delay=3, h_start=0, h_stop=719, v_delay=24, v_start=24, v_stop=311
Jan 15 09:15:41 bb64 kernel: tw6801[0]/0: tw68_set_scale: 384x144 [TB,PAL-BG]
Jan 15 09:15:41 bb64 kernel: tw6801[0]/0: tw68_set_scale: hactive=720, hdelay=3, hscale=480; vactive=288, vdelay=24, vscale=512
Jan 15 09:15:41 bb64 kernel: tw6801[0]/0: tw68_set_scale: setting CROP_HI=12, VDELAY_LO=18, VACTIVE_LO=120, HDELAY_LO=03, HACTIVE_LO=2d0
Jan 15 09:15:41 bb64 kernel: tw6801[0]/0: tw68_set_scale: setting SCALE_HI=21, VSCALE_LO=200, HSCALE_LO=1e0
Once you have that log, email me a copy of it (my email address is given in any of the source code files) and I'll see if I can guess what's happening.

Bill

Posted: Fri Jan 15, 2010 6:35 am
by whatboy
I did insmod tw68.ko video_debug=7 but it gave me insmod: error inserting 'tw68.ko': -1 File exist, I did Make clean then make, and insmod: error inserting 'tw68.ko': -1 File exists, but still the same error...

Posted: Fri Jan 15, 2010 8:31 am
by wbrack
whatboy,

uhhh... perhaps "rmmod tw68" to remove the one already installed?

Bill

Posted: Fri Jan 15, 2010 12:33 pm
by antov
i have tw6802
installed with tw68-tw68-v2 driver

zenith:~# lspci | grep 68
01:03.0 Multimedia video controller: JumpTec h, GMBH Device 6801 (rev 10)
01:03.1 Multimedia controller: JumpTec h, GMBH Device 6802 (rev 10)
zenith:~#
zenith:~# dmesg | grep tw
[ 9.702372] tw68: v4l2 driver version 0.0.2 loaded
[ 9.702426] tw68 0000:01:03.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20
[ 9.702437] tw6801[0]: found at 0000:01:03.0, rev: 16, irq: 20, latency: 32, mmio: 0xff0ff800
[ 9.702446] tw6801[0]: subsystem: 0000:0000, board: GENERIC [card=0,autodetected]
[ 9.702478] tw6801[0]: Unable to determine board type, using generic values
[ 9.812326] IRQ 20/tw6801[0]: IRQF_DISABLED is not guaranteed on shared IRQs
[ 9.812456] tw6801[0]: registered device video0 [v4l2]
[ 9.812501] tw6801[0]: registered device vbi0
zenith:~#
zenith:~# ls -lsa /dev/video0
0 crw-rw-rw- 1 root video 81, 0 2010-01-15 14:14 /dev/video0
zenith:~#



and i have no video from the camera
can someone please help me ?

Posted: Fri Jan 15, 2010 2:17 pm
by robby
antov,

if you have installed mplayer, you can try to do the followings in tw68-tw68-v2 directory:

rmmod tw68.ko
make run

to see if your card and camera work out of zm.

If this works for you (like it worked for me) it means that you have to tune up your settings on zm.

Posted: Fri Jan 15, 2010 11:41 pm
by antov
robby, thanks for your answer, but i don't have installed X on this machine

Posted: Sat Jan 16, 2010 5:21 am
by whatboy
So I did what you told Me, AND incremented the resolution to 740x480 and CAPTURES_PER_FRAME = 3, so is recording at ~ 4.5fps... and hasn't crash since then...

Posted: Sat Jan 16, 2010 6:11 pm
by robby
antov,
mplayer works also without X, it can use vesa compatible or svga video cards
(even EGA!!) see documentation at http://www.mplayerhq.hu/.
It is very important to understand where the problem is : device driver or zm settings.
Sometimes also cameras, cables and connectors make troubles :)

Posted: Sun Jan 17, 2010 12:15 pm
by antov
robby thanks
the camera is working on my DVR geovision device
the problem is not in the connections to the camera
i will try mplayer and i will post the results
thanks a lot

Posted: Mon Jan 18, 2010 7:58 am
by robby
moorsey and wbrack,

I have played a little with my TW6800 based card and the device driver settings.
Changing the h_delay value from 3 to 133 in souce file tw68-video.c (line 20) , I can now see images without black stripes. Stability issue remain.......more playing needed.....

Posted: Mon Jan 18, 2010 12:02 pm
by antov

Code: Select all

Jan 18 13:54:34 zenith zmc_dvideo0[1960]: INF [Starting Capture]
Jan 18 13:54:34 zenith zmdc[1938]: INF ['zmfilter.pl' starting at 10/01/18 13:54:34, pid = 1962]
Jan 18 13:54:34 zenith kernel: [  346.117041] tw6801[0]/0: video_mux: input = 0 [Composite1]
Jan 18 13:54:34 zenith kernel: [  346.117252] tw6801[0]/0: video_mux: input = 0 [Composite1]
Jan 18 13:54:34 zenith kernel: [  346.117264] tw6801[0]/0: set_tvnorm: PAL-BG
Jan 18 13:54:34 zenith kernel: [  346.117277] tw6801[0]/0: tw68_g_ctrl_internal
Jan 18 13:54:34 zenith kernel: [  346.117284] tw6801[0]/0: tw68_g_ctrl_internal
Jan 18 13:54:34 zenith kernel: [  346.117289] tw6801[0]/0: tw68_g_ctrl_internal
Jan 18 13:54:34 zenith kernel: [  346.117293] tw6801[0]/0: tw68_g_ctrl_internal
Jan 18 13:54:34 zenith kernel: [  346.117962] tw6801[0]/0: buffer_prepare: Generating new risc code [720x288x24](2160)
Jan 18 13:54:34 zenith kernel: [  346.118581] tw6801[0]/0: buffer_prepare: Generating new risc code [720x288x24](2160)
Jan 18 13:54:34 zenith kernel: [  346.119228] tw6801[0]/0: buffer_prepare: Generating new risc code [720x288x24](2160)
Jan 18 13:54:34 zenith kernel: [  346.119917] tw6801[0]/0: buffer_prepare: Generating new risc code [720x288x24](2160)
Jan 18 13:54:34 zenith kernel: [  346.152644] tw6801[0]/0: buffer_prepare: Generating new risc code [720x288x24](2160)
Jan 18 13:54:34 zenith kernel: [  346.153330] tw6801[0]/0: buffer_prepare: Generating new risc code [720x288x24](2160)
Jan 18 13:54:34 zenith kernel: [  346.153447] tw6801[0]/0: tw68_set_scale: width=720, height=144, both=1
Jan 18 13:54:34 zenith kernel: [  346.153450]   Crop rect: top=24, left=0, width=720 height=288
Jan 18 13:54:34 zenith kernel: [  346.153452]   tvnorm h_delay=3, h_start=0, h_stop=719, v_delay=24, v_start=24, v_stop=311
Jan 18 13:54:34 zenith kernel: [  346.153459] tw6801[0]/0: tw68_set_scale: 720x144 [TB,PAL-BG]
Jan 18 13:54:34 zenith kernel: [  346.153463] tw6801[0]/0: tw68_set_scale: hactive=720, hdelay=3, hscale=256; vactive=288, vdelay=24, vscale=512
Jan 18 13:54:34 zenith kernel: [  346.153469] tw6801[0]/0: tw68_set_scale: setting CROP_HI=12, VDELAY_LO=18, VACTIVE_LO=120, HDELAY_LO=03, HACTIVE_LO=2d0
Jan 18 13:54:34 zenith kernel: [  346.153474] tw6801[0]/0: tw68_set_scale: setting SCALE_HI=21, VSCALE_LO=200, HSCALE_LO=100
Jan 18 13:54:35 zenith zmdc[1964]: INF ['zmaudit.pl -c' started at 10/01/18 13:54:35]
Jan 18 13:54:35 zenith zmdc[1938]: INF ['zmaudit.pl -c' starting at 10/01/18 13:54:35, pid = 1964]
Jan 18 13:54:36 zenith zmfilter[1962]: INF [Scanning for events]
Jan 18 13:54:36 zenith zmdc[1966]: INF ['zmwatch.pl' started at 10/01/18 13:54:36]
Jan 18 13:54:36 zenith zmdc[1938]: INF ['zmwatch.pl' starting at 10/01/18 13:54:36, pid = 1966]
Jan 18 13:54:36 zenith zmwatch[1966]: INF [Watchdog starting]
Jan 18 13:54:36 zenith zmwatch[1966]: INF [Watchdog pausing for 30 seconds]
Jan 18 13:54:36 zenith zmdc[1968]: INF ['zmupdate.pl -c' started at 10/01/18 13:54:36]
Jan 18 13:54:36 zenith zmdc[1938]: INF ['zmupdate.pl -c' starting at 10/01/18 13:54:36, pid = 1968]
Jan 18 13:55:14 zenith zmc_dvideo0[1960]: INF [outdoor: 1000 - Capturing at 25.00 fps]
Jan 18 13:55:54 zenith zmc_dvideo0[1960]: INF [outdoor: 2000 - Capturing at 25.00 fps]

and again no picture :(

Code: Select all

Playing /dev/video0.
Cannot seek backward in linear streams!
Seek failed
Cannot seek backward in linear streams!
Seek failed
Cannot seek backward in linear streams!
Seek failed
this is from mplayer