Page 1 of 2
Please help! Can't get camera to work with ZM
Posted: Wed Jul 04, 2007 2:52 pm
by harty83
Hello,
I have a cheapy usb digital camera that works with all my other linux camera programs. I am trying to get it to run under ZM.
I am running ZM under Ubuntu Feisty and have followed all the instructions specific to this OS.
I am getting the following in my logs:
zmdc.log
Code: Select all
07/04/07 10:45:57.613476 zmdc[20291].INF ['zmc -d /dev/video0' starting at 07/07/04 10:45:57, pid = 20651]
07/04/07 10:45:57.848137 zmdc[20291].ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
Over and over and over
zmwatch.log
Code: Select all
07/04/07 10:46:45.545971 zmwatch[20918].INF ['zmc -d /dev/video0' starting at 07/07/04 10:46:45, pid = 25639]
07/04/07 10:46:55.557022 zmwatch[20918].ERR [Can't get shared memory id '7a6d2001', 1: No such file or directory]
07/04/07 10:46:55.559423 zmwatch[20918].INF [Restarting capture daemon for Cam, shared memory not valid]
Over and over and over
It seems that ZM is at least trying to communicate with it.
Any help would be greatly appreciated!!!!
device
Posted: Wed Jul 04, 2007 3:05 pm
by darkpaw
I just had a problem silimar to this when I moved to a new system, because bttv wasn't being run correctly due to an interrupt conflict.
But it was on a capture card, not a USB camera. Do USB cameras use the bttv drivers?
If you run:
sudo dmesg | grep bttv
(sudo needed for Ubuntu, can run without if running as root on Fedora)
What do you get? You should see the bttv driver being picked up (if that happens with USB -- somebody else will need to confirm)? And should see it at least try to autodetect your camera.
What if you run:
ls -l /dev/video*
Do you see a file for /dev/video0? If so, what are the permissions on it? You may need to run /usr/lib/zm/bin/zmfix but if you do, then it's likely that there's an issue with bttv. That, or bttv won't pick it up, and it is creating a FAT directory being mounted somewhere under /media or something, rather than a raw device file.
Posted: Wed Jul 04, 2007 3:32 pm
by harty83
I have the camera permissions wide open. I get nothing in dmesg about bttv.
Code: Select all
alan@desktop:~$ sudo dmesg | grep bttv
alan@desktop:~$ ls -l /dev/video*
crwxrwxrwx 1 root video 81, 0 2007-07-04 09:52 /dev/video0
Posted: Wed Jul 04, 2007 7:53 pm
by Lee Sharp
bttv is a driver for the brrotrout capture chip. USB cams use other drivers. Use xawtv to see what you have.
Posted: Wed Jul 04, 2007 9:36 pm
by harty83
This is what I get. What do I do with it?
Code: Select all
alan@desktop:~$ xawtv -hwscan
This is xawtv-3.95.dfsg.1, running on Linux/i686 (2.6.20-16-generic)
looking for available devices
port 73-73
type : Xvideo, image scaler
name : ATI Rage128 Video Overlay
/dev/video0: OK [ -device /dev/video0 ]
type : v4l
name : Pixart PAC207-BCA
flags: capture
Posted: Thu Jul 05, 2007 5:30 am
by Lee Sharp
Well, you have not said what cam you have, but it looks like it is a Pixart PAC-207?
Try 'xawtv -device /dev/vodeo0' and see what happens. If it fails, try it with sudo. If it works with sudo, but not without it is a permissions problem with zmfix. If it fails either way, we have other problems.
Posted: Thu Jul 05, 2007 1:06 pm
by harty83
Lee Sharp wrote:Well, you have not said what cam you have, but it looks like it is a Pixart PAC-207?
Right, I really don't know other than what xawtv says. It was on sale for extremely cheap and was packed with "Webcams for Dummies" or something like that. I obviously don't need anything fancy.
Try 'xawtv -device /dev/vodeo0' and see what happens. If it fails, try it with sudo. If it works with sudo, but not without it is a permissions problem with zmfix. If it fails either way, we have other problems.
xawtv opens fine and I can see the video through the camera. But that is all ran through my account. Since zm runs through www-data, I don't know if it is still a permissions problem. But wouldn't the log say it was a permissions problem if that was the case rather than "exited abnormally, exit status 255?"
I followed the Ubuntu wiki howto to supposedly fix all the permissions problems. The little light on the camera flashes consistently with the repeated log errors. So it seems that zm is communicating with the camera but then hits a wall somewhere for some reason.
Thanks for your help. I really appreciate it![/quote]
permissions
Posted: Thu Jul 05, 2007 2:08 pm
by darkpaw
The reason permissions are suspected is the message in your initial post, from the zmwatch.log. The shared memory error is kind of a red herring...it is throwing that error because it isn't able to properly open /dev/video0 ("no such file or directory"). I had a similar problem when I went from Fedora Core 3 to Fedora Core 5, but it was caused because of an improperly installed library...the device file was there, but it couldn't read it.
Posted: Thu Jul 05, 2007 2:14 pm
by harty83
Uh. Okay. Well I'm not for sure what is going on. I mean I've chmod'ed 777 /dev/video0 and still get the errors. I've sudo chmod 4755 /usr/bin/zmfix as said here
http://www.zoneminder.com/wiki/index.php/Ubuntu_7.04 with no results.
I'm at a total lost!
Posted: Thu Jul 05, 2007 4:07 pm
by Lee Sharp
Me too, now. Hopefully with the holiday over, better people than I will be able to help.
Posted: Fri Jul 06, 2007 9:58 pm
by heythisisnate
I'm having exactly the same problem, but in my case I'm using a Axis IP camera. I still think the problem might be permissions related, but I'm not sure where. Does anyone know how to find out what path zmwatch failed to find in the following log? I think that would be a clue to the source of the problem.
Code: Select all
07/06/2007 17:40:50.338071 zmwatch[8282].ERR [Can't get shared memory id '7a6d2001', 1: No such file or directory]
07/06/2007 17:40:50.338856 zmwatch[8282].INF [Restarting capture daemon for Rear_Door, shared memory not valid]
07/06/2007 17:40:50.625568 zmwatch[8282].INF ['zmc -m 1' starting at 07/07/06 17:40:50, pid = 8352]
My setup is also on Ubuntu Feisty 7.04. I compiled zm myself on an AMD64 architecture. zm is running as
www-data which is the same user that runs apache2.
Lee -- I'll keep trying to figure it out and let you know if I get anywhere ... seems like we have a very similar problem.
Posted: Fri Jul 06, 2007 11:45 pm
by harty83
heythisisnate wrote:Lee -- I'll keep trying to figure it out and let you know if I get anywhere ... seems like we have a very similar problem.
heythisisnate, it is actually me who is having the issue. Lee was trying to help me out. Please do keep me posted if you figure anything out. Like I've said before, I've followed the wiki page for Feisty and am still having the issue. I've also tried making the permissions wide open for the camera but still no go. I read in a forum posting (linked in
http://www.zoneminder.com/wiki/index.php/Ubuntu_7.04) that ubuntu adds users to a "video" group, but it does not actually create the group. He made the group video then added www-data to it and his problems were solved. I tried that, but still get the posted errors.
Please keep us posted!
Posted: Sat Jul 07, 2007 2:36 am
by heythisisnate
harty,
I figured out my problem, hopefully this will work for you, too. It turns out that it has nothing to do with permissions on the video device. Since I'm using an IP camera and you're using a USB cam, that makes sense.
I turned on debug mode (go to Config and then the Debug tab in the ZM web console) and then set it to debug level 1. After that, I started getting tons of log message about not having enough shared memory. I'm sorry I didn't capture the exact output.
To fix this, you can allocate more shared memory or use less memory. Try lowering the resolution and the buffer size settings in your video source configuration.
I also bumped up the max shared memory. Since this will be a box dedicated pretty much 95% for ZM, I don't mind doing this. Edit /etc/sysctl.conf and add this to the bottom of the file:
Code: Select all
# raise shared memory limit for ZoneMinder
kernel.shmmax = 67108864
You can see what your current shared memory max is by doing
I doubled my shmmax and lowered the capture resolution, restarted ZM, and that seemed to work.
Posted: Sat Jul 07, 2007 7:22 pm
by harty83
I tried what you said but I'm still getting no results. Grrr.
Posted: Sat Jul 07, 2007 7:34 pm
by heythisisnate
hmm ... that's frustrating. Maybe I can still help though. Did you try turning on debug mode (from the web panel)? Set it to debug level 1, restart ZM and check your logs directory for a bunch of files. Paste the output of some of them here
Also, if you modify the kernel shared memory max, you need to restart Ubuntu.