Page 1 of 2
really need some help
Posted: Mon Sep 07, 2009 12:33 pm
by barrydocks
Hopefully someone can point me in the right direction as I am fairly new to linux
Background
Ubuntu 8.04 server 64bit edition
PCI-e DVR card with 8 chips - based on phillips SAA7130 chipset
this is the card I have:
http://www.camsecure.co.uk/PCIECapture.html
According to HCL the drivers for the card are installed:
video 0 to 7 are listed in the /dev directory
zmu output:
root@fileserver:~# zmu -d /dev/video0 -q -v
Video Capabilities
Name: UNKNOWN/GENERIC
Type: 45
Can capture
Does teletext
Overlay onto frame buffer
Can clip
Video Channels: 1
Audio Channels: 0
Maximum Width: 720
Maximum Height: 578
Minimum Width: 48
Minimum Height: 32
Window Attributes
X Offset: 0
Y Offset: 0
Width: 0
Height: 0
Picture Attributes
Palette: 4 - 24bit RGB
Colour Depth: 24
Brightness: 46774
Hue: 32896
Colour :33026
Contrast: 35090
Whiteness: 0
Channel 0 Attributes
Name: default
Channel: 0
Flags: 0
Type: 2 - Camera
Format: 0 - PAL
I currently can't get an image from either zoneminder or xawtv
output from xawtvis:
root@fileserver:~# xawtv
This is xawtv-3.95.dfsg.1, running on Linux/x86_64 (2.6.24-24-server)
xinerama 0: 1024x768+0+0
Warning: Cannot convert string "-*-ledfixed-medium-r-*--39-*-*-*-c-*-*-*" to type FontStruct
game over
I have read that there is a bttv.conf or an modprobe.conf file that probably needs modifying but I can't find either!
Some help would be really appreciated!
Posted: Mon Sep 07, 2009 2:42 pm
by knight-of-ni
For Unbuntu, you need to create a configuration file (call it something like "saa7134") in the following folder:
/etc/modprobe.d/
FYI: The /etc/modprobe.conf file is depreciated, which is why you didn't see it.
The next step (the hard part) will be to populate the file with the right configuration info. It looks like this driver is configured similar to the bttv driver so the following may be helpful:
http://www.zoneminder.com/wiki/index.ph ... t8x8_Cards
You'll need to figure out the correct card type for your hardware. You may not have that info on your machine. I had to download the saa7134 driver here:
http://dl.bytesex.org/releases/video4linux/
and then open the file "CARDLIST.saa7134" found under the doc subfolder.
That lists all the available card types.
Posted: Mon Sep 07, 2009 3:28 pm
by barrydocks
Thanks for your reply.
knnniggett wrote:You'll need to figure out the correct card type for your hardware. You may not have that info on your machine. I had to download the saa7134 driver here:
http://dl.bytesex.org/releases/video4linux/
and then open the file "CARDLIST.saa7134" found under the doc subfolder.
That lists all the available card types.
Yeah, I had a look at that - I think it's fairly out of date as it only lists 33 cards and the return from dmsg lists 117! - I tried dmsg and found that the card is listed as indervidual chips (ie 8 of them) plus all the possible card options:
[ 73.955083] saa7130/34: v4l2 driver version 0.2.14 loaded
[ 73.955147] ACPI: PCI Interrupt 0000:03:00.0[A] -> Link [LNEC] -> GSI 19 (lev
el, low) -> IRQ 19
[ 73.955157] saa7130[0]: found at 0000:03:00.0, rev: 1, irq: 19, latency: 64, mmio: 0xfceffc00
[ 73.955164] saa7134: <rant>
[ 73.955165] saa7134: Congratulations! Your TV card vendor saved a few
[ 73.955166] saa7134: cents for a eeprom, thus your pci board has no
[ 73.955167] saa7134: subsystem ID and I can't identify it automatically
[ 73.955168] saa7134: </rant>
[ 73.955169] saa7134: I feel better now. Ok, here are the good news:
[ 73.955169] saa7134: You can use the card=<nr> insmod option to specify
[ 73.955170] saa7134: which board do you have. The list:
[ 73.955173] saa7134: card=0 -> UNKNOWN/GENERIC
[ 73.955176] saa7134: card=1 -> Proteus Pro [philips reference design] 1131:2001 1131:2001
[ 73.955179] saa7134: card=2 -> LifeView FlyVIDEO3000 5168:0138 4e42:0138
[ 73.955183] saa7134: card=3 -> LifeView/Typhoon FlyVIDEO2000 5168:0138 4e42:0138
[
blah, blah
[ 73.955470] saa7134: card=116 -> 10MOONS TM300 TV Card 1131:2304
[ 73.955472] saa7134: card=117 -> Avermedia Super 007 1461:f01d
[ 73.955475] saa7130[0]: subsystem: 1131:0000, board: UNKNOWN/GENE
knnniggett wrote:For Unbuntu, you need to create a configuration file (call it something like "saa7134") in the following folder:
/etc/modprobe.d/
What would happen if I inlcuded several options in the file, I was thinking of adding them all? ie:
options bttv card=1,1,1,1,1,1,1,1
options bttv card =2,2,2,2,2,2,2,2
etc, etc,
knnniggett wrote:FYI: The /etc/modprobe.conf file is depreciated, which is why you didn't see it.
sorry t show my ignorance but why is this and what does it mean? Similar to hiding system files/folders in windows?
Posted: Tue Sep 08, 2009 1:32 pm
by knight-of-ni
Hmmm.... my hunch is that adding all 117 options to your configuration file will not work. My guess is that either the first or the last set of options will be the one that takes effect, but I've never tried it myself. It's possible you could end up with a system that doesn't finish booting (or boots incredibly slow) so, unless you are up to a good challenge, you may want to avoid trying this.
Oh and about the "depreciated" comment....
When a certain way of configuring something in software becomes outdated, we call it "depreciated"... meaning that it's possible you could get your system to run using the old method, but at some point in the future only the new method will work. Consequently, one should typically start using the new method as soon as possible.
In your case, the "old" method is to place module options (for all modules on your system) into a single file called "modprobe.conf". Today some systems may have this file hanging around and some may not. It's possible you could get things working by placing your module options inside this file. However, the "new" way of doing things is to create a separate file for each module in the folder "modprobe.d". At some point, placing your options into the "modprobe.conf" file will no longer work.
I know.... that was the long answer to your question... sorry about that.
But back to addressing the real issue...
You are in what I would call interesting position (maybe I'm weird, but I find it kind of fun). You've got a card with a chipset known by Linux, but it doesn't look like anyone has posted instructions for the specific card you have (at least I did not see any). What I recommend you do is follow the method posted in this thread:
http://www.zoneminder.com/forums/viewtopic.php?t=5921
While the card in that thread is different than yours, the method for determining the card type should work for you.
The author shows how to go through all the card types w/o rebooting. Once you find a set of options that work for your card, to make it permanent, simply place the options into a text file in your modprobe.d folder as mentioned previously.
And lastly, let us know your results so that we all can benefit from your work.
Hope that helps, and I hope you enjoy your Linux experience(es).
Posted: Tue Sep 08, 2009 7:06 pm
by barrydocks
one other thing if I used these commands with the appropriate vales:
rmmod saa7134 (remove current driver)
modprobe saa7134 card=n,n,n,n (Install new driver, n = cardtype)
and then listed dmsg, would this then list the new driver or just the orginal?
Thanks for your help
Posted: Tue Sep 08, 2009 9:56 pm
by knight-of-ni
As changes to your system occur, new information is appended to your dmesg output.
Posted: Fri Sep 11, 2009 4:44 pm
by barrydocks
Sucess! I found card=2,2,2,2,2,2,2,2 worked and also card=3,3,3,3,3,3,3,3 - can't decide which gives the best picture.
I also found that adding -v to the "rmmod saa7134" and "modprobe saa7134 card=n,n,n,n" line was useful to esnsure things were actually happening becuase:
knnniggett wrote:As changes to your system occur, new information is appended to your dmesg output.
Not accutally sure if they do when an option is specified in a config file in the /etc/modprobe.d direcetory. I foud if I removed this then there was less of a problem.
I think I will write this up with a pitcure of the card as a how to post?
Thanks for your help.
Just one other thing I realise that I need to install cambozola to allow streaming to IE. I have downloaded the tar.gz file but have no idea how what to do with it once extracted? I have installed the ant command but just get errors (will post these for you to see on monday), any suggestions in the meantime?
Posted: Sat Sep 12, 2009 11:09 pm
by knight-of-ni
Glad you got your card working. I bet you are glad that your card was number 2 or 3 in the list rather than number 115.
IMO the easiest way to get Cambozola to work is to simply download the one from the Zoneminder Downloads section. After downloading simply uncompress and copy the cambozoola.jar file to your zm web root folder. Then it just magically works... no need to use ant.
Posted: Mon Oct 19, 2009 11:52 am
by barrydocks
Ok after many hours trying to get this card to work I threw in the towel and got Phil to SSH into my server to sort it! Here is a list of the CLI history for those that are interested. I have not had a chance to go through it myself yet, I would be grateful if someone has the time to interpret which are the important commands and what they do?
Code: Select all
67 v4l-info | more
68 v4l-info | more
69 v4l-info | more
70 v4l-conf
71 v4l-conf -h
72 vi /etc/apache2/sites-available/default
73 ls -l /usr/share/zoneminder/
74 vi /etc/apache2/sites-available/default
75 fg
76 apache2ctl restart
77 tail -f /var/log/messages
78 ls -l /dev/video*
79 v4l-info | more
80 v4l-info | more
81 tail -f /var/log/messages
82 ps -edalf | grep zmc
83 tail -f /var/log/messages
84 zmpkg.pl stop
85 ps -edalf | grep zm
86 export ZM_DBG_PRINT=1
87 ./zmc -d /dev/video0
88 zmc -d /dev/video0
89 export ZM_DBG_LEVEL=5
90 zmc -d /dev/video0
91 zmc -d /dev/video0
92 export ZM_DBG_LEVEL=9
93 zmc -d /dev/video0
94 export ZM_DBG_PRINT=0
95 zmc -d /dev/video0 &
96 zmu -m 1 -t
97 zmu -m 1 -t
98 zmu -m 1 -t
99 zmu -m 1 -t
100 zmu -m 1 -t
101 zmu -m 1 -t
102 zmu -m 1 -t
103 zmu -m 1 -t
104 top
105 zmu -m 1 -t
106 zmu -m 1 -t
107 zmu -m 1 -i
108 ls -lrt
109 pwd
110 zmu -m 1 -i
111 ls -lrt
112 zmu -m 1 -i
113 ls -lrt
114 fg
115 export ZM_DBG_PRINT=1
116 export ZM_DBG_LEVEL=5
117 zmc -d /dev/video0
118 zmc -d /dev/video0
119 v4l-info /dev/video1 | more
120 v4l-info /dev/video1 | more
121 zmc -d /dev/video1
122 export ZM_DBG_PRINT=0
123 zmc -d /dev/video1
124 zmc -d /dev/video1 &
125 zmu -m 2 -i
126 ls -lrt
127 lsmod | more
128 fg
129 jobs
130 zmc -d /dev/video1 &
131 zmu -m 2 -i
132 ls -lrt
133 ls -lrt
134 zmu -m 2 -i
135 ls -lrt
136 fg
137 zmc -d /dev/video1 &
138 zmu -m 2 -i
139 ls -lrt
140 fg
141 zmc -d /dev/video0 &
142 zmu -m 1 -i
143 ls -lrt
144 fg
145 zmpkg.pl start
146 tail -f /var/log/messages
147 zmdc.pl stop zmwatch.pl
148 tail -f /var/log/messages
149 ls -l /var/log
150 ls -l /var/log/zm/
151 tail -f /var/log/messages
152 tail -f /var/log/apache2/error.log
153 tail -f /var/log/apache2/access.log
154 vi /etc/apache2/sites-available/default
155 ls -l /usr/share/zoneminder/cgi-bin/
156 ls -l /usr/share/zoneminder/cgi-bi
157 ls -l /usr/share/zoneminder/cgi-bin
158 ls -l /usr/lib/cgi-bin/
159 fg
160 apache2ctl restart
161 tail -f /var/log/apache2/access.log
162 ls -l /usr/share/zoneminder/images
163 ls -l /usr/share/zoneminder/images/
164 ls -l /var/cache/zoneminder/images/
165 ls -lrt
166 apt-get
167 man apt-get
168 man apt-get
169 dpkg
170 dpkg -h
171 dpkg -L zoneminder | more
172 vi /etc/zm/apache.conf
173 fg
174 cd /etc/apache2/
175 ls -lrt
176 ls conf.d/
177 cd sites-available/
178 vi default
179 ln -s /etc/zm/apache.conf /etc/apache2/conf.d/zoneminder
180 apache2ctl restart
181 tail -f /var/log/apache2/error.log
182 ls -l /usr/bin/
183 ls -l /usr/bin/zmfix
184 chmod 4755 /usr/bin/zmfix
185 ls -l /usr/bin/zmfix
186 zmfix -a
187 ls -l /dev/video*
188 tail -f /var/log/apache2/error.log
189 chown www-data:www-data /usr/share/zoneminder/temp
190 tail -f /var/log/apache2/error.log
191 tail -f /var/log/messages
192 zmu -m 1 -t
193 zmu -m 1 -t
194 tail -f /var/log/messages
195 ps -edalf | grep zmc
196 ps -edalf | grep zm
197 zmpkg.pl stop
198 ps -edalf | grep zm
199 zmpkg.pl start
200 ps -edalf | grep zm
201 ps -edalf | grep zm
202 tail -f /var/log/messages
203 uptime
204 df
205 tail -f /var/log/messages
206 ls -l /usr/share/zoneminder/
207 ls -l /usr/share/zoneminder/events
208 ls -l /var/cache/
209 ls -l /var/cache/zoneminder/
210 ls -l /media/disk/
211 ls -l /media/disk/cctv/
212 ls -ld /media/disk/cctv/
213 mount
214 cp -P /usr/share/zoneminder/events/* /media/disk/cctv/
215 cp -pR /usr/share/zoneminder/events/* /media/disk/cctv/
216 zmpkg.pl stop
217 cd /media/disk/cctv/
218 ls -lrt
219 vi /etc/modprobe.d/libsane
220 cd /usr/share/zoneminder/
221 rm events
222 ln -s /media/disk/cctv events
223 ls -l
224 ls -ld
225 ls -ld events
226 cd events
227 ls
228 more CCTV\ Phillips\ cards.txt
229
230 ls -lrt
231 rm CCTV\ Phillips\ cards.txt Phillips\ DVR\ cards.doc Screenshot.jpg xawtv
232 ls
233 ls -lrt
234 rm New2
235 ln -s New 1
236 ln -s New2 2
237 ls -lrt
238 ls 1
239 rm 1/New
240 rm 2/New2
241 ln -s 1 New
242 ln -s 2 New2
243 ls -l
244 chown www-data:www-data New*
245 ls -lrt
246 chown -h
247 chown --help
248 chown -h www-data:www-data New*
249 lsmod | grep bttv
250 ls-l
251 ls -l
252 zmpkg.pl start
253 tail -f /var/log/messages
254 ls l /media/disk/cctv/1/
255 ls l /media/disk/cctv/1
256 ls -l /media/disk/cctv/1
257 ls -l /media/disk/cctv/1/1/
258 ls -lrt
259 history
260 history > /root/cctv-history.txt
Posted: Thu Oct 22, 2009 1:52 pm
by knight-of-ni
I've skimmed through Phil's command history a few times and here is my take on what was done:
- - gather info about your video device with v4l-info
- Turn up zm debug
- Check that the Ubuntu deb package you used put everything in the right places with the right permissions
- Check zm log, apache log, and syslog for errors
- Edit/Read apache config file (my guess is to determine the proper user and group names ...e.g. www-data and www-data)
- Check /etc/modprobe.d/libsane for blacklisted bbtv module?
- Delete all existing zm events
- Create a new events folder, linked to the following disk /media/disk/cctv
- Change user and group ownership of your events folder to www-data:www-data
- (re)start zm, check log files for errors
- Done
Barrydocks, unless I overlooked something, to me it looks like the root cause of your problem was an incorrectly configured events folder. Based on what you told me privately and what I see in the history, it does not appear that any configuration files (zm, apache, or your driver modules) needed to be changed.
Perhaps we could get Phil to confirm or deny this.
Posted: Thu Oct 22, 2009 1:59 pm
by barrydocks
hmmm...
I didn't think there was anything spectacular going on, I think I might hook up a spare HHD with a fresh Ubuntu install and try to replicate the steps (not sure when mind).
Thanks for your help.
PS how are you with SAMBA problems? have a look at:
http://ubuntuforums.org/showthread.php?t=1297825
Posted: Thu Oct 22, 2009 3:10 pm
by knight-of-ni
If you feel you must share your zm events folder, I recommend setting the read only flag on your cctv samba share just to prevent any accidental deletions or modifications.
Posted: Thu Oct 22, 2009 3:22 pm
by barrydocks
knnniggett wrote:If you feel you must share your zm events folder, I recommend setting the read only flag on your cctv samba share just to prevent any accidental deletions or modifications.
yes the thought had crossed my mind, I was a bit worried about preventing the zm filter I have set up from deleting events and ending up with a full HDD
ps have replyed to the other thread with even more questions
thanks for your time
Posted: Fri Oct 23, 2009 3:19 pm
by barrydocks
I've just realised that if I limit the access to the CCTV folder via samba, it will no affect data being written to the folder by ZM as this is not governed by samba, right?
Posted: Fri Oct 23, 2009 4:10 pm
by knight-of-ni
There are two layers of permissions we are dealing with here: file permissions and samba permissions.
The way your system is configured, Zoneminder records directly to /media/disk/cctv. It doesn't use samba to do this. Consequently, you can set your Samba permissions to anything you want, and it will not affect Zoneminder.
Out of curiosity sake, for what purpose do you want to remotely access your Zonemidner Events folder? Backups perhaps?