Page 1 of 1

Failed to open video device /dev/video0

Posted: Wed Jun 30, 2004 4:34 pm
by pchan
Yes, i've actually tried to search the boards a bit for an answer but haven't found it yet so I'm posting now :)

ZM 1.19.3
OS RH9 with 2.6 kernel
BT848 Capture Card
Memory: 1165588k/1179648k available (2072k kernel code, 12940k reserved, 752k data, 396k init, 262144k highmem)

Everything had been running nicely until recently when I stopped using X on this system. Now i'm having trouble with /dev/video0 permissions.

Why is zmfix changing permissions to 20606 and 20660 which causes a permission denied error when opening /dev/video0?
Jun 27 14:12:39 gw zmfix[26816]: INF [Resetting permissions on /dev/video0 to 20606]
Jun 28 07:00:29 gw zmfix[10370]: INF [Resetting permissions on /dev/video0 to 20606]
Jun 30 08:00:30 gw zmfix[26170]: INF [Resetting permissions on /dev/video0 to 20660]
have all been followed by
Jun 30 08:00:14 gw zmc-d0[26157]: ERR [Failed to open video device /dev/video0: Permission denied]
Most of the time zmfix works properly so when I run 'gdb zmfix', it exits normally.

Corresponding zmwatch.log shows
Restarting capture daemon ('/usr/local/bin/zmdc.pl restart zmc -d 0'), time since last capture 46186 seconds (1088370740-1088324554)
'zmc -d 0' starting at 04/06/27 14:12:20, pid = 26767
'zmc -d 0' started at 04/06/27 14:12:20
Watchdog starting at 04/06/27 14:12:45
Watchdog pausing for 30 seconds

Other info:
root@zoneminder# cat /proc/sys/kernel/shmmax
734003200
root@zoneminder# cat /proc/sys/kernel/shmall
734003200

From dmesg:
bttv0: detected: AVermedia TVCapture 98 [card=13], PCI subsystem ID is 1461:0002
bttv0: using: AVerMedia TVCapture 98 [card=13,autodetected]
bttv0: gpio: en=00000000, out=00000000 in=000477c3 [init]
bttv0: Hauppauge/Voodoo msp34xx: reset line init [11]
bttv0: Avermedia eeprom[0x4001]: tuner=2 radio:no remote control:yes
bttv0: using tuner=2
bttv0: i2c: checking for MSP34xx @ 0x80... not found
bttv0: i2c: checking for MSP34xx (alternate address) @ 0x88... not found
bttv0: i2c: checking for TDA9875 @ 0xb0... not found
bttv0: i2c: checking for TDA7432 @ 0x8a... not found
bttv0: registered device video0
bttv0: registered device vbi0
bttv0: PLL: 28636363 => 35468950 .. ok
bttv0: add subdevice "remote0"

Posted: Thu Jul 01, 2004 10:24 am
by davide
try adding this line in /usr/local/bin/zmpkg.pl just after line 257:

Code: Select all

execute( ZM_PATH_BIN."/zmfix -a" );
here is how my zmpkg.pl looks like:

Code: Select all

                                        execute( ZM_PATH_BIN."/zmdc.pl start zma -m $monitor->{Id}" );
                                }
                        }
                }
                $sth->finish();

                # This is now started unconditionally
                execute( ZM_PATH_BIN."/zmdc.pl start zmfilter.pl" );
                execute( ZM_PATH_BIN."/zmdc.pl start zmaudit.pl -d 900 -y" );
                # fix
                execute( ZM_PATH_BIN."/zmfix -a" );

                if ( ZM_OPT_X10 )
                {
                        execute( ZM_PATH_BIN."/zmdc.pl start zmx10.pl -c start" );
                }
                execute( ZM_PATH_BIN."/zmdc.pl start zmwatch.pl" );

see: http://www.zoneminder.com/forums/viewto ... highlight=

for more info.

regards,
davide