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.
curtishall
Posts: 440
Joined: Sat Sep 25, 2004 12:45 am
Location: Fulton, MO

Post by curtishall »

robertfullarton wrote:There's no install section in the Makefile anymore.
You have to copy tw68.ko to /lib/modules/ "current kernel" /kernel/somewhere. Doesn't seem to matter exactly which sub dir you put it in.
then run sudo depmod -a
I would do this:
cp tw68.ko /lib/modules/`uname -r`/extra ; depmod -a
--
Curtis Hall
Bluecherry
www.bluecherrydvr.com
store.bluecherry.net
moorsey
Posts: 53
Joined: Sun Jan 03, 2010 8:56 am

Post by moorsey »

many many thanks for the replies, another stage closer to getting this working hopefully!

Well, I tried both of the above, copying the created tw68.ko to /lib/modules/2.6.31-14-generic/kernel/drivers and running depmod -a

Then I tried curtishall's command also

Running xawtv gives:
# sudo xawtv
This is xawtv-3.95.dfsg.1, running on Linux/i686 (2.6.31-14-generic)
xinerama 0: 800x600+0+0
can't open /dev/video0: No such file or directory
v4l-conf had some trouble, trying to continue anyway
v4l2: open /dev/video0: No such file or directory
v4l2: open /dev/video0: No such file or directory
v4l: open /dev/video0: No such file or directory
no video grabber device available
running xawtv -hwscan gives:
# sudo xawtv -hwscan
This is xawtv-3.95.dfsg.1, running on Linux/i686 (2.6.31-14-generic)
looking for available devices
port 57-57
type : Xvideo, image scaler
name : NV Video Overlay

port 58-89
type : Xvideo, image scaler
name : NV Video Blitter
is this right? How exactly can I get a picture to see if it is actually working?

I want to see if it does before I wipe this box and get going with ZoneMinder

Thanks for the info so far!
bensttech
Posts: 6
Joined: Wed Jan 06, 2010 3:27 pm

tw68

Post by bensttech »

HI guys, I have the tw68 sort of working, I am using gentoo linux and the latest git source driver. Has anyone had contact with guys developing he driver?

i have a 4 port card, xawtv shows all for ports but you get cross pictures from the other ports in the stream on any of the 4 inputs, like the sample timing is wrong or something (assuming it uses 1 adc?) ZM works the same using channels 0-3 but the interference is far worse.

The kernel shows the following on load,
[10588.995601] tw68: v4l2 driver version 0.0.2 loaded
[10588.995633] tw6804[0]: found at 0000:01:06.0, rev: 16, irq: 19, latency: 64, mmio: 0xdffffc00
[10588.995640] tw6804[0]: subsystem: 0000:0000, board: GENERIC [card=0,autodetected]
[10588.995673] tw6804[0]: Unable to determine board type, using generic values
[10589.096169] IRQ 19/tw6804[0]: IRQF_DISABLED is not guaranteed on shared IRQs
[10589.096249] tw6804[0]: registered device video0 [v4l2]
[10589.096267] tw6804[0]: registered device vbi0



Do i need to pass the modules some prams as it detected it as a generic card. or is the driver just buggy. i have some c skills and hardware so can offer some help debugging. I have this in an installation which i really need to get working.

cheers
bensttech
Posts: 6
Joined: Wed Jan 06, 2010 3:27 pm

Post by bensttech »

moorse,

try # make insmod

also if you look in the make file you can see whats its doing and what external modules it needs
moorsey
Posts: 53
Joined: Sun Jan 03, 2010 8:56 am

Post by moorsey »

bensttech

thanks for that, gave that a try also, still no luck though

could this be because I am running a live CD on this system and not rebooting in between trying these commands? I assumed not as Linux generally doesn't need rebooting for things!

Also tried "modprobe bttv" and then "insmod tw68.ko" from advice here http://ubuntuforums.org/showthread.php?p=8449428

Still getting the same no video grabber found message on xawtv.

Finally, I did take a look in the makefile, not understanding most of it, but installed mplayer and v4l2ucp that were mentioned in the file, no joy though
wbrack
Posts: 16
Joined: Fri Jan 08, 2010 1:00 am
Location: Hong Kong

Driver setup

Post by wbrack »

moorsey and all

I'm the principal developer of the TW68 driver, and I just discovered this forum thread. Although the driver is certainly not complete or perfect, I am not aware of any significant trouble with it that might cause problems when used with zoneminder, xawtv or tvtime. If any troubles are encountered, I'll be happy to try to find and fix them.

The driver is currently only available in source form on http://gitorious.org/tw68. "tw68-v2" is the one which should be used. Before asking for help, please be sure you have downloaded and compiled the latest version of the source.

The latest source includes some enhancements to the Makefile, including a new target "make install" to permanently put the module into the current modules directory. I recommend that people should start with just a "make insmod", however, until they are happy that the driver is working satisfactorily. Further information can be found in the comments at the top of the file "Makefile".

Most Live CD's do not retain information once the system is shutdown and restarted. That means that, after a restart, you would have to fetch the source files again and do another "make insmod" to install them. The tw68.ko module requires some other kernel modules in order to work, and "make insmod" takes care of making sure those other modules are (automatically) loaded.
TW68xx Driver Developer
whatboy
Posts: 304
Joined: Mon Aug 31, 2009 10:31 pm

Post by whatboy »

I have this weird problem, have a tw6805a 16ch card, when I set up the cameras... only 4... and using inputs video0(0), video1(0), video2(0) and video3(0) all comes right, but it is at 30fps... and load goes up to >4 if I set fps to 7 then cameras get mixed up and screw up everything!!!

Fedora 12...
bensttech
Posts: 6
Joined: Wed Jan 06, 2010 3:27 pm

Post by bensttech »

moorsey you got the driver at least loading now?

checking out git clone git://gitorious.org/tw68/tw68-v2.git or dowloading the tar ball from the site.

building it with make, and assuming no errors

make insmod

should get you a /dev/video0

also once you have done a make insmod, check your kernel messages bottom of #dmesg it should show the driver loading.


Eveyone i am working with Wbrack, The developer to try and get to the bottom of the aparent channel cross talk. I sure it real real close!. one thing to note is that if you only have 1,2,3 camera connected you should terminate any spare ports to avoid capacitve cross talk showing on used ports.
bensttech
Posts: 6
Joined: Wed Jan 06, 2010 3:27 pm

Post by bensttech »

can any one experiencing weird channel cross talk post there # lspci | grep 68

Cheers
bensttech
Posts: 6
Joined: Wed Jan 06, 2010 3:27 pm

tw68 channel cross talk solved

Post by bensttech »

Hi to anyone that has been frustrated by nearly getting there but no quite with tw68nn based boards. Today i have got to the bottom of the problem of channel cross talk well certainly on the card i am using which is listed by pci id as

lspci
01:06.0 Multimedia video controller: JumpTec h, GMBH Device 6804 (rev 10)
01:06.1 Multimedia controller: JumpTec h, GMBH Device 6805 (rev 10)

This card is based on the tw6805 ic. The problem of channel cross talk is nothing to do with a bug in the driver for the tw68 (http://gitorious.org/tw68/tw68-v2)

The problem on this board comes down to a small so14 pin multiplexer switch ic (u5) that supports a video output connector on this particular card. This is completely independent to the tw68 aside from 4 gpio lines that enable the switch channels. because the driver does not know about this device and bad hardware design means that all the mux switches are enable by default means channel cross talk and chaos for the video signals.

I have removed the mux ic and have it working well with the driver using both xawtv and zoneminder using 1,2,3 or 4 ports. This is not the final solution as most will not be able to remove the ic and should not attempt to remote the ic unless they know what they are doing as it would be very easy to distroy your card. The real solution is the driver needs some work to add support for hardware specifics like this and hence carry out the correct initialisation.
moorsey
Posts: 53
Joined: Sun Jan 03, 2010 8:56 am

Post by moorsey »

Hi all, thanks for the further replies and info!

I think this must be a live CD issue as I am not getting anywhere, but don't seem to be getting any error messages either.

make insmod:

Code: Select all

root@ubuntu:/home/ubuntu/Downloads/tw68-tw68-v2# make insmod
make -C /lib/modules/2.6.31-14-generic/build M=/home/ubuntu/Downloads/tw68-tw68-v2 modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.31-14-generic'
  CC [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68-core.o
  CC [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68-cards.o
  CC [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68-video.o
  CC [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68-vbi.o
  CC [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68-ts.o
  CC [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68-risc.o
  CC [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68-tvaudio.o
  LD [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/ubuntu/Downloads/tw68-tw68-v2/tw68.mod.o
  LD [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.31-14-generic'
sudo rmmod tw68 2>&1 > /dev/null
sudo modprobe v4l2_common
sudo modprobe videobuf_dma_sg
sudo modprobe btcx_risc
sudo insmod tw68.ko
xawtv:

Code: Select all

root@ubuntu:/home/ubuntu/Downloads/tw68-tw68-v2# xawtv
This is xawtv-3.95.dfsg.1, running on Linux/i686 (2.6.31-14-generic)
xinerama 0: 800x600+0+0
can't open /dev/video0: No such file or directory
v4l-conf had some trouble, trying to continue anyway
v4l2: open /dev/video0: No such file or directory
v4l2: open /dev/video0: No such file or directory
v4l: open /dev/video0: No such file or directory
no video grabber device available
lspci (just in case I am missing something!):

Code: Select all

root@ubuntu:/home/ubuntu/Downloads/tw68-tw68-v2# lspci
00:00.0 Host bridge: nVidia Corporation nForce CPU bridge (rev b2)
00:00.1 RAM memory: nVidia Corporation nForce 220/420 Memory Controller (rev b2)
00:00.2 RAM memory: nVidia Corporation nForce 220/420 Memory Controller (rev b2)
00:00.3 RAM memory: nVidia Corporation Device 01aa (rev b2)
00:01.0 ISA bridge: nVidia Corporation nForce ISA Bridge (rev c3)
00:01.1 SMBus: nVidia Corporation nForce PCI System Management (rev c1)
00:02.0 USB Controller: nVidia Corporation nForce USB Controller (rev c3)
00:03.0 USB Controller: nVidia Corporation nForce USB Controller (rev c3)
00:04.0 Ethernet controller: nVidia Corporation nForce Ethernet Controller (rev c2)
00:05.0 Multimedia audio controller: nVidia Corporation nForce Audio Processing Unit (rev c2)
00:06.0 Multimedia audio controller: nVidia Corporation nForce AC'97 Audio Controller (rev c2)
00:08.0 PCI bridge: nVidia Corporation nForce PCI-to-PCI bridge (rev c2)
00:09.0 IDE interface: nVidia Corporation nForce IDE (rev c3)
00:1e.0 PCI bridge: nVidia Corporation nForce AGP to PCI Bridge (rev b2)
01:06.0 Ethernet controller: Marvell Technology Group Ltd. 88w8335 [Libertas] 802.11b/g Wireless (rev 03)
01:07.0 PCI bridge: Hint Corp HB6 Universal PCI-PCI bridge (non-transparent mode) (rev 11)
02:0c.0 Multimedia video controller: Techwell Inc. Device 6800 (rev 11)
02:0d.0 Multimedia video controller: Techwell Inc. Device 6800 (rev 11)
02:0e.0 Multimedia video controller: Techwell Inc. Device 6800 (rev 11)
02:0f.0 Multimedia video controller: Techwell Inc. Device 6800 (rev 11)
03:00.0 VGA compatible controller: nVidia Corporation NVCrush11 [GeForce2 MX Integrated Graphics] (rev b1)
make run (after doing a make clean and installing mplayer):

Code: Select all

root@ubuntu:/home/ubuntu/Downloads/tw68-tw68-v2# make run
make -C /lib/modules/2.6.31-14-generic/build M=/home/ubuntu/Downloads/tw68-tw68-v2 modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.31-14-generic'
  CC [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68-core.o
  CC [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68-cards.o
  CC [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68-video.o
  CC [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68-vbi.o
  CC [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68-ts.o
  CC [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68-risc.o
  CC [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68-tvaudio.o
  LD [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/ubuntu/Downloads/tw68-tw68-v2/tw68.mod.o
  LD [M]  /home/ubuntu/Downloads/tw68-tw68-v2/tw68.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.31-14-generic'
sudo rmmod tw68 2>&1 > /dev/null
sudo modprobe v4l2_common
sudo modprobe videobuf_dma_sg
sudo modprobe btcx_risc
sudo insmod tw68.ko
test -x /usr/bin/v4l2ucp && v4l2ucp &
test -x /usr/bin/mplayer && mplayer tv:// -tv device=/dev/video0:outfmt=yuy2:normid=3:width=640:height=480
Creating config file: /root/.mplayer/config
MPlayer SVN-r29237-4.4.1 (C) 2000-2009 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing tv://.
TV file format detected.
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski <olschewski>
 comment: first try, more to come ;-)
v4l2: unable to open '/dev/video0': No such file or directory
v4l2: ioctl set mute failed: Bad file descriptor
v4l2: 0 frames successfully processed, 0 frames dropped.


Exiting... (End of file)
killall v4l2ucp
v4l2ucp: no process found
make: *** [run] Error 1
Will try and get a proper Ubuntu install on another HDD to test from a normal install, the reason for the livecd is just so I don't have to frazz the Windows install just yet, I'm sure I can get a HDD from somewhere

Thanks again
moorsey
Posts: 53
Joined: Sun Jan 03, 2010 8:56 am

Post by moorsey »

Update

Took the plunge and unplugged the whole PC, got a spare HDD in and did a fresh Ubuntu 9.10 install

Same results though :(

One thing I did notice, the first time "make insmod" is ran, there is one error, this does not show on further runs though:

Code: Select all

root@ZONEMINDER1:/home/pop/Downloads/tw68-tw68-v2# make insmod
make -C /lib/modules/2.6.31-14-generic/build M=/home/pop/Downloads/tw68-tw68-v2 modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.31-14-generic'
  CC [M]  /home/pop/Downloads/tw68-tw68-v2/tw68-core.o
  CC [M]  /home/pop/Downloads/tw68-tw68-v2/tw68-cards.o
  CC [M]  /home/pop/Downloads/tw68-tw68-v2/tw68-video.o
  CC [M]  /home/pop/Downloads/tw68-tw68-v2/tw68-vbi.o
  CC [M]  /home/pop/Downloads/tw68-tw68-v2/tw68-ts.o
  CC [M]  /home/pop/Downloads/tw68-tw68-v2/tw68-risc.o
  CC [M]  /home/pop/Downloads/tw68-tw68-v2/tw68-tvaudio.o
  LD [M]  /home/pop/Downloads/tw68-tw68-v2/tw68.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/pop/Downloads/tw68-tw68-v2/tw68.mod.o
  LD [M]  /home/pop/Downloads/tw68-tw68-v2/tw68.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.31-14-generic'
sudo rmmod tw68 2>&1 > /dev/null
ERROR: Module tw68 does not exist in /proc/modules
make: [insmod] Error 1 (ignored)
sudo modprobe v4l2_common
sudo modprobe videobuf_dma_sg
sudo modprobe btcx_risc
sudo insmod tw68.ko
May be nothing at all. There are no errors on insmods after that
wbrack
Posts: 16
Joined: Fri Jan 08, 2010 1:00 am
Location: Hong Kong

tw68 driver problems

Post by wbrack »

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
TW68xx Driver Developer
moorsey
Posts: 53
Joined: Sun Jan 03, 2010 8:56 am

Post by moorsey »

ahh I see, I had sort of assumed that my card was supported from various threads etc. Not to worry, a good learning curve all this driver stuff!

If you have the time/get the chance, then I am quite happy to give the enhanced driver with PCI-ID change a go, see what the results are at least. Much appreciated Bill
wbrack
Posts: 16
Joined: Fri Jan 08, 2010 1:00 am
Location: Hong Kong

tw68 driver channel interference bug, TW6800 recognition

Post by wbrack »

Good news for those affected by "ghosting", or interference between channels - thanks to some really great hardware debugging by bensttech, the problem has been fixed. Just update to the latest source from gittorious, recompile and reinstall, and all should be good (and let me know if this isn't true).

The latest source also now includes code which should recognize the TW6800. moorsey, please give it a try and let me know the results.

Bill
TW68xx Driver Developer
Post Reply