Page 1 of 1

Error, failed to get channel 0 attributes: Invalid argument

Posted: Sat Nov 28, 2009 4:33 pm
by hryamzik
Ubuntu 9.04 server (well I tried in others too) + all updates, zoneminder v1.23.3 from ports (apt-get).

I've tried 5 different webcams, all of them do work in XawTV, but when I try

Code: Select all

zmu -d /dev/video0  -q -v
I get

Code: Select all

Error, failed to get channel 0 attributes: Invalid argument
video0 does exist and is not busy.

I'm a bit confused with that. I know I could share cam to zm using stream software but I'd prefer to use more direct way...

My primary cam for those experiments is i-sight one on my mbp, shared to ubuntu using parallels usb sharing.

Code: Select all

root@ZSU94:~# lsusb 
Bus 001 Device 004: ID 05ac:8507 Apple, Inc.
UPD:

I have the following in /var/log/messages:

Code: Select all

Nov 28 21:53:58 ZSU94 zmwatch[24947]: INF [Restarting capture daemon for New, shared memory not valid] 
Nov 28 21:53:58 ZSU94 zmdc[24745]: INF ['zmc -d /dev/video0' stopping at 09/11/28 21:53:58] 
Nov 28 21:53:58 ZSU94 zmwatch[24947]: INF ['zmc -d /dev/video0' stopping at 09/11/28 21:53:58]
I've edited shared memory:

Code: Select all

echo 134217728 >/proc/sys/kernel/shmall && echo 134217728 >/proc/sys/kernel/shmmax
and fixed permissions:

Code: Select all

sudo chmod 4755 /usr/bin/zmfix
zmfix -a
sudo chown www-data.www-data /usr/share/zoneminder/temp
and restarted zm. Still no luck.

Posted: Sun Nov 29, 2009 2:33 am
by vaderj
what does your /tmp/zmwatch.log look like?
btw im having the same issue on jaunty x64 with a usb cam which works w/ xawtv also.
also i am getting shared memory issues

Posted: Sun Nov 29, 2009 9:03 am
by hryamzik

Code: Select all

11/29/09 12:01:43.960200 zmwatch[30909].INF [Watchdog starting]
11/29/09 12:01:43.960801 zmwatch[30909].INF [Watchdog pausing for 30 seconds]
11/29/09 12:02:13.966950 zmwatch[30909].ERR [Can't get shared memory id '7a6d0005', 5: No such file or directory]
11/29/09 12:02:13.968043 zmwatch[30909].INF [Restarting capture daemon for New, shared memory not valid]
11/29/09 12:02:14.240115 zmwatch[30909].INF ['zmc -d /dev/video0' starting at 09/11/29 12:02:14, pid = 32189]
11/29/09 12:02:24.244806 zmwatch[30909].ERR [Can't get shared memory id '7a6d0005', 5: No such file or directory]
11/29/09 12:02:24.245733 zmwatch[30909].INF [Restarting capture daemon for New, shared memory not valid]
....

Posted: Sun Nov 29, 2009 2:48 pm
by hryamzik
I didn't play with SELinux, but does it exist in ubuntu?

Code: Select all

root@ZSU94:~/zm-stuff# checkmodule -M -m -o local_zoneminder.mod local_zoneminder.te 
The program 'checkmodule' is currently not installed.  You can install it by typing:
apt-get install checkpolicy
bash: checkmodule: command not found
Looks line there are no policies at all.

UPD:
Ok, I've borrowed a camera that is detected:

Code: Select all

zmu -d /dev/video1 -q -v
Video Capabilities
  Name: PC Camera
  Type: 1
    Can capture
  Video Channels: 1
  Audio Channels: 0
  Maximum Width: 640
  Maximum Height: 480
  Minimum Width: 48
  Minimum Height: 32
Window Attributes
  X Offset: 0
  Y Offset: 0
  Width: 320
  Height: 240
Picture Attributes
  Palette: 0 - Unknown
  Colour Depth: 8
  Brightness: 32896
  Hue: 0
  Colour :0
  Contrast: 32768
  Whiteness: 39321
Channel 0 Attributes
  Name: zc3xx
  Channel: 0
  Flags: 0
  Type: 2 - Camera
  Format: 0 - PAL
So let it be the first cam to get working.
I have also enabled cambozola.jar, chmod'ed it and enabled in gui. And still no image, but now there's a white screen instead of black, a red point in the left upper corner and the name of a monitor.

I use ff to work with zm's interface.

Any suggestions?

Posted: Fri Dec 04, 2009 9:31 pm
by hryamzik
Ok, one of my 5 cameras works, without any errors in logs.
Others have errors I've listed.

All of them work in xawtv.

What can I do to get them working in zm?
Here they edit /etc/modprobe.d, but do I have to edit it if my cam is working in xawtv? If so, where could I find out card types?

Guys, any suggestions...

Posted: Tue Dec 08, 2009 10:52 am
by cordel
Error, failed to get channel 0 attributes: Invalid argument
Apparently that device does not provide for channel 0 or at that time did not have permission.

Shared memory not valid is a result of zmc not being able to access the device so not really a shared memory error per say. If zmc can't capture an image, there will not be any shared memory initialized since zmc can't get any images to put in it.

Try turning on debug around level 4 for zmc and find what errors are being returned.

Also try seeing what settings xawtv is using to access the cam.