Page 1 of 1

PV143 and Nothing

Posted: Fri Aug 06, 2010 4:08 am
by fred1234
I have install a PV143 video capture card on fedora 13 and http://127.0.0.1/zm/ returns an empty page, /var/log/message has no messages (upon loading this webpage) and /var/log/zoneminder/ has no
files in it. I would assume that I should get some sort of output somewhere.


On a working fedora 13 system with httpd(apache) installed and working,
i installed zoneminder using yum. Neglecting to remove Deny from all,
127.0.0.1/zm/ displays an access error. Removing the Deny from all,
127.0.0.1/zm/ complains mysql is not setup. After running 'mysql -u root -p < zm_create.sql' from /usr/share/zoneminder/db, 127.0.0.1/zm/ returns
an empty webpage. So I assume that the basics of the webserver setup is working, i.e. the configuration and files are in the right places.


Messages in /var/log/message suggest that the PV143 was detected:

Code: Select all

Aug  5 16:13:47 xxx kernel: Linux video capture interface: v2.00
Aug  5 16:13:47 xxx kernel: bttv: driver version 0.9.18 loaded
Aug  5 16:13:47 xxx kernel: bttv: using 8 buffers with 2080k (520 pages) each for capture
Aug  5 16:13:47 xxx kernel: bttv: Bt8xx card found (0).
Aug  5 16:13:47 xxx kernel: bttv 0000:09:00.0: PCI INT A -> GSI 21 (level, low) -> IRQ 21
Aug  5 16:13:47 xxx kernel: bttv0: Bt878 (rev 17) at 0000:09:00.0, irq: 21, latency: 16, mmio: 0xf39ff000
Aug  5 16:13:47 xxx kernel: bttv0: detected: Provideo PV143A [card=105], PCI subsystem ID is aa00:1430
Aug  5 16:13:47 xxx kernel: bttv0: using: ProVideo PV143 [card=105,autodetected]
Aug  5 16:13:47 xxx kernel: IRQ 21/bttv0: IRQF_DISABLED is not guaranteed on shared IRQs
Aug  5 16:13:47 xxx kernel: bttv0: tuner absent
Aug  5 16:13:47 xxx kernel: bttv0: registered device video0
Aug  5 16:13:47 xxx kernel: bttv0: registered device vbi0
Aug  5 16:13:47 xxx kernel: bttv0: PLL: 28636363 => 35468950 .. ok

Running 'xawtv -device /dev/video0' returns

Code: Select all

This is xawtv-3.95, running on Linux/x86_64 (2.6.33.6-147.2.4.fc13.x86_64)
xinerama 0: 1920x1080+0+0
WARNING: couldn't find framebuffer base address, try manual
         configuration ("v4l-conf -a <addr>")
v4l2: WARNING: framebuffer base address mismatch
v4l2: me=(nil) v4l=(nil)
Warning: Cannot convert string "7x13bold" to type FontStruct
Warning: Missing charsets in String to FontSet conversion
Warning: Missing charsets in String to FontSet conversion
Oops: can't load any font
I could not find any description as to what to use for <addr>.

Running 'xawtv -hwscan' returns

Code: Select all

This is xawtv-3.95, running on Linux/x86_64 (2.6.33.6-147.2.4.fc13.x86_64)
looking for available devices
port 63-94
    type : Xvideo, image scaler
    name : Nouveau GeForce 8/9 Textured Video

/dev/video0: OK                         [ -device /dev/video0 ]
    type : v4l2
    name : BT878 video (ProVideo PV143)
    flags: overlay capture  
Which seems to suggest that the hardware is detected OK, namely it is a PV143.

Running 'zmu -d /dev/video0 -q -v' returns:

Code: Select all

Video Device: /dev/video0
General Capabilities
  Driver: bttv
  Card: BT878 video (ProVideo PV143)
  Bus: PCI:0000:09:00.0
  Version: 0.9.18
  Type: 0x5000015
    Supports video capture (X)
    Does not support video output
    Supports frame buffer overlay
    Supports VBI capture
    Does not support VBI output
    Does not support sliced VBI capture
    Does not support sliced VBI output
    Does not support video output overlay
    Does not have tuner
    Does not have audio in and/or out
    Does not have radio
    Supports read/write i/o (X)
    Does not support async i/o
    Supports streaming i/o (X)
    Standards:
      NTSC
      NTSC-M
      NTSC-M-JP
      NTSC-M-KR
      PAL
      PAL-BG
      PAL-H
      PAL-I
      PAL-DK
      PAL-M
      PAL-N
      PAL-Nc
      PAL-60
      SECAM
      SECAM-B
      SECAM-G
      SECAM-H
      SECAM-DK
      SECAM-L
      SECAM-Lc
  Formats:
    8 bpp, gray (GREY)
    8 bpp, dithered color (HI24)
    15 bpp RGB, le (RGBO)
    15 bpp RGB, be (RGBQ)
    16 bpp RGB, le (RGBP)
    16 bpp RGB, be (RGBR)
    24 bpp RGB, le (BGR3)
    32 bpp RGB, le (BGR4)
    32 bpp RGB, be (RGB4)
    4:2:2, packed, YUYV (YUYV)
    4:2:2, packed, YUYV (YUYV)
    4:2:2, packed, UYVY (UYVY)
    4:2:2, planar, Y-Cb-Cr (422P)
    4:2:0, planar, Y-Cb-Cr (YU12)
    4:2:0, planar, Y-Cr-Cb (YV12)
    4:1:1, planar, Y-Cb-Cr (411P)
    4:1:0, planar, Y-Cb-Cr (YUV9)
    4:1:0, planar, Y-Cr-Cb (YVU9)
Crop Capabilities
  Bounds: 1063 x 608
  Default: 924 x 576
  Current: 924 x 576
Inputs: 4
  Input 0
    Name: Composite0
    Type: Camera
    Audioset: 00000001
    Standards: 0xffbfff
    Power on  (X)
    Signal detected  (X)
    Colour Signal detected 
    Horizontal Lock detected 
  Input 1
    Name: Composite1
    Type: Camera
    Audioset: 00000001
    Standards: 0xffbfff
    Power on  (X)
    Signal detected  (X)
    Colour Signal detected 
    Horizontal Lock detected 
  Input 2
    Name: Composite2
    Type: Camera
    Audioset: 00000001
    Standards: 0xffbfff
    Power on  (X)
    Signal detected  (X)
    Colour Signal detected 
    Horizontal Lock detected 
  Input 3
    Name: Composite3
    Type: Camera
    Audioset: 00000001
    Standards: 0xffbfff
    Power on  (X)
    Signal detected  (X)
    Colour Signal detected 
    Horizontal Lock detected 
Which seems to suggest that zoneminder can detect the hardware.

I configured SELinux as per http://www.zoneminder.com/wiki/index.ph ... n_from_RPM

Any Ideas as to what I missed?

Thanks in advance,

Fred

Posted: Fri Aug 06, 2010 4:58 am
by bb99
Add index.php to your URL (zm/index.php) or try "localhost/zm". Search up "flowers for candy" and select the forum posting from "hiredguntech" to see what you're missing, if anything. Just added the original post to the wiki with edits; hope this helps.

Posted: Fri Aug 06, 2010 4:21 pm
by fred1234
it looks like I was stuck at line 18 in his instrutions:

Code: Select all

[18] Last thing - took me two days to find that you must edit the SECOND entry of short_open_tag down at line 229. Aurgh. Again as root, edit /etc/php.ini. Change short_open_tag from 'off' to 'on'. If you don't do this the console is blank! 
After a loosing battle to keep selinux enable I finally shut it off and received:

Code: Select all

Aug  6 10:54:39 xxx zms[20443]: INF [Debug Level = 0, Debug Log = <none>]
Aug  6 10:54:39 xxx zms[20443]: ERR [Can't shmget, probably not enough shared memory space free: Permission denied]
Aug  6 10:54:40 xxx zmwatch[20045]: ERR [Can't read from shared memory '7a6d0001/3735583': Permission denied]
Aug  6 10:54:40 xxx zmwatch[20045]: ERR [Unable to read 'shared_data:size' from memory for monitor 1]
From http://www.zoneminder.com/wiki/index.ph ... n_from_RPM
I added this to /etc/sysctl.conf and execute 'sysctl -p'

Code: Select all

kernel.shmall = 134217728
kernel.shmmax = 134217728
and now receive this in /var/log/messages:

Code: Select all

Aug  6 11:17:10 xxx zmwatch[20045]: ERR [Can't read from shared memory '7a6d0001/3735583': Permission denied]
Aug  6 11:17:10 xxx zmwatch[20045]: ERR [Unable to read 'shared_data:size' from memory for monitor 1]
Any Suggestions?

Posted: Fri Aug 06, 2010 4:45 pm
by bb99
Increase shared memory by 50 to 100%. Documentation settings are pretty much minimal. Keep increasing until everything works. Don't forget to reboot.

edit /etc/sysctl.conf too make changes permanent.

Posted: Fri Aug 06, 2010 8:02 pm
by fred1234
I changed the shared memory, as per http://www.zoneminder.com/wiki/index.php/FAQ, to:

Code: Select all

kernel.shmall = 2048000
kernel.shmmax = 4194304000
As per the aforementioned web page the 128MB amount should be more than enough, 380x380 single camera. This above mention recent value is 8GB. This seems a little high to me. Is this RAM sequestered only for zoneminder now?


... and now I get these messages in /var/log/messages:

Code: Select all

Aug  6 14:44:06 xxx zmdc[22499]: INF [Starting pending process, zmc -d /dev/video0]
Aug  6 14:44:06 xxx zmdc[22499]: INF ['zmc -d /dev/video0' starting at 10/08/06 14:44:06, pid = 22720]
Aug  6 14:44:06 xxx zmdc[22720]: INF ['zmc -d /dev/video0' started at 10/08/06 14:44:06]
Aug  6 14:44:06 xxx zmc_dvideo0[22720]: INF [Debug Level = 0, Debug Log = <none>]
Aug  6 14:44:06 xxx zmc_dvideo0[22720]: INF [Starting Capture]
Aug  6 14:44:06 xxx zmc_dvideo0[22720]: FAT [Failed to set video format: Invalid argument]
Aug  6 14:44:06 xxx zmc_dvideo0[22720]: INF [Got signal 6 (Aborted), exiting and forcing backtrace]
Aug  6 14:44:06 xxx zmc_dvideo0[22720]: ERR [Signal address is 0x206, no eip]
Aug  6 14:44:06 xxx zmc_dvideo0[22720]: ERR [Backtrace: /lib64/libpthread.so.0() [0x3eb8a0f440]]
Aug  6 14:44:06 xxx zmc_dvideo0[22720]: ERR [Backtrace: /lib64/libc.so.6(gsignal+0x35) [0x3eb82329a5]]
Aug  6 14:44:06 xxx zmc_dvideo0[22720]: ERR [Backtrace: /lib64/libc.so.6(abort+0x175) [0x3eb8234185]]
Aug  6 14:44:06 xxx zmc_dvideo0[22720]: ERR [Backtrace: /usr/bin/zmc() [0x40d21e]]
Aug  6 14:44:06 xxx zmc_dvideo0[22720]: ERR [Backtrace: /usr/bin/zmc() [0x41eef3]]
Aug  6 14:44:06 xxx zmc_dvideo0[22720]: ERR [Backtrace: /usr/bin/zmc() [0x41f7d2]]
Aug  6 14:44:06 xxx zmc_dvideo0[22720]: ERR [Backtrace: /usr/bin/zmc() [0x4052ec]]
Aug  6 14:44:06 xxx zmc_dvideo0[22720]: ERR [Backtrace: /lib64/libc.so.6(__libc_start_main+0xfd) [0x3eb821ec5d]]
Aug  6 14:44:06 xxx zmc_dvideo0[22720]: ERR [Backtrace: /usr/bin/zmc() [0x404ee9]]
Aug  6 14:44:06 xxx zmc_dvideo0[22720]: INF [Backtrace complete, please execute the following command for more information]
Aug  6 14:44:06 xxx zmc_dvideo0[22720]: INF [addr2line -e /usr/bin/zmc() 0x3eb8a0f440 0x3eb82329a5 0x3eb8234185 0x40d21e 0x41eef3 0x41f7d2 0x4052ec 0x3eb821ec5d 0x404ee9]
Aug  6 14:44:06 xxx zmdc[22499]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 6]
The monitor window now displays a frame for the video stream but it is
just white. I am not sure what 'video format' that the log message is
complaining about but the 'Device format' is NTSC and the 'Capture Palette' is JPEG.

Posted: Fri Aug 06, 2010 10:00 pm
by bb99
"Can't shmget" is always shared memory, period. Return to your original values and select gray scale as your pallette. Do you even have That much available? Not really sure how 50 to 100% of 134217728 ends up at 419430400; your link for the wiki leads to a blank page so I can't look at how this came about. Changing to gray scale will lower the required value huge, right now the goal is to just get it working.

Better yet, is it possible that I could talk you into starting over and following the "hiredguntech" step by step. I tried to include every key stroke in the wiki post (under fedora) and avoided any "implied knowledge" inferences. I did just complete a FC12 install by saving the wiki post as a .txt file and doing a cut and paste into a terminal when necessary. I did have to edit the shared memory value (increased 10% at a time untill everything worked) and the ffmpeg path within the options.

Posted: Wed Aug 11, 2010 1:57 am
by fred1234
My last post was posted as I was running out the door on a trip...

I tried to use a shmall/shmmax that was so large that shared memory was
not a problem. I mistook the web page values for recommended values
of latest cameras. The webpage referenced was:
www.zoneminder.com -> Wiki -> FAQ -> 1.2 -> box at end of section.

When I changed the "/dev/video0 (0)" -> Source -> 'Capture palette' to GREY
(or YUYV) the images from the camera show up in the 'Monitor - 1' window.

After getting this working, and installing ffmpeg and updating options::images for ffmpeg, I changed the values of shmall/shmmax back to 134217728 as recommended in several of the instructions. The shmget problem does not seem to reappear.

The 'Capture palette' set to JPEG still does not work. I assume that when I try and share the pictures/video I will need this to work???
Is this what ffmpeg is for or is there some other problem?

Any idea why the xawtv test to see if the camera works is not working?

Bonus optional Question: The documentation for the camera states that the number of TV lines is 380. Is there a standard for the number of columns for this number of rows?

Thanks,

Fred

Posted: Wed Aug 11, 2010 2:41 am
by bb99
I'm glad to hear you have a picture. I've noticed jpeg as an option but I'm sure it's not a choice for the PV-143. Try the rgb24 or bgr24 first. Note: if you set the resolution to 320 x 240 shared memory shouldn't be an issue while adjusting capture palettes. Your going to notice that you can adjust the resolution to about any odd ball setting so long as you maintain the aspect ratio 4:3 (answered the bonus question). I've got a remote PV-143 running at 560 x 420 on all 4 inputs (use noticeable interlacing as a limit). But there are many posts that discuss native resolution versus tv lines (search). I'm unqualified to tell you exactly what ffmpeg's total function in ZM is but I've used the PV-143 in 1.21.3 without it installed (couldn't get ffmpeg to work) without any problem except no video generation. The jpeg libs do most of what your thinking(?).
The capture palette doesn't affect your ability to remotely view or share any events or live feeds unless you've selected an unsupported one then: nothing for everyone. ZM and your card do the heavy lifting.