/dev/v4l/by-path not supported in device path?

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
C0ng0Blu3
Posts: 9
Joined: Sat Mar 28, 2020 5:09 pm

/dev/v4l/by-path not supported in device path?

Post by C0ng0Blu3 »

I am trying to use absolute path to the cameras, just in case the sources get swapped around between reboots.
But setting device source from /dev/video2 to /dev/v4l/by-path/pci-0000:01:01.2-usb-0:1:1.0-video-index0
does not seem to bring the camera up.
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: /dev/v4l/by-path not supported in device path?

Post by iconnor »

Should work.
C0ng0Blu3
Posts: 9
Joined: Sat Mar 28, 2020 5:09 pm

Re: /dev/v4l/by-path not supported in device path?

Post by C0ng0Blu3 »

iconnor wrote: Sun Mar 29, 2020 4:56 pmShould work.
Hmmm, i will look @ the deb source.
running debian sid, using ZM-1.34.6...
Maybe i thought it was a field length problem, tried /dev/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././video0
and that still worked :)

But, the devices: /dev/v4l/by-path/"device" are symlinks to /dev/"device", Could this be a limitation from the database?

Getting this from log:
2020-03-30 09:50:43 zma_m2 374046 ERR Got empty memory map file size 0, is the zmc process for this monitor running?
2020-03-30 10:00:26 zmdc 1863 ERR 'zma -m 2' exited abnormally, exit status 255

---
P.S. ( slightly off this topic)
The media server was running weird last night, stopped responding, crashed on reboot, would not restart from remote location.
I am running AoE to that appliance for the OS and nfs4 for the pictures dir to my main server...
Went out to the shed with a keyboard and monitor ( where it resides) , the machine was reporting ram errors from post,
Checked each ram stick one at a time, all seem to be ok.
Turns out the processor was dying. ( the memory controller logic ?northbridge? was on its way out )
So i used the pre-upgrade part and it is behaving normally again.
C0ng0Blu3
Posts: 9
Joined: Sat Mar 28, 2020 5:09 pm

Re: /dev/v4l/by-path not supported in device path?

Post by C0ng0Blu3 »

Having a look @ README.md in section ## Contribution Model and Development...
Looks a bit intimidating.
I have never done anything with git-pulls or code Contribution yet.
If i find or apply a fix, could/would you or somebody else that is a developer here apply a patch from me?
C0ng0Blu3
Posts: 9
Joined: Sat Mar 28, 2020 5:09 pm

Re: /dev/v4l/by-path not supported in device path?

Post by C0ng0Blu3 »

Currently looking in zm_local_camera.h
...
Might as well grep for it.
~/deb-src/zoneminder-1.34.6/src# grep -r video0 .

./zmc.cpp: -d, --device <device_path> - For local cameras, device to access. e.g /dev/video0 etc
./zmc.cpp: fprintf(stderr, " -d, --device <device_path> : For local cameras, device to access. E.g /dev/video0 etc\n");

I dunno the cpp :? I have written a little embedded/gnu C some years back...
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: /dev/v4l/by-path not supported in device path?

Post by iconnor »

You are going to want to turn on debugging under Options->Logging.

I will apply your patch if need be.
C0ng0Blu3
Posts: 9
Joined: Sat Mar 28, 2020 5:09 pm

Re: /dev/v4l/by-path not supported in device path?

Post by C0ng0Blu3 »

I guess I am close?
~/deb-src/zoneminder-1.34.6/src# grep -r device.c_str .

./zm_local_camera.cpp: Debug(3, "Opening video device %s", device.c_str());
./zm_local_camera.cpp: //if ( (vid_fd = open( device.c_str(), O_RDWR|O_NONBLOCK, 0 )) < 0 )
./zm_local_camera.cpp: if ( (vid_fd = open(device.c_str(), O_RDWR, 0)) < 0 )
./zm_local_camera.cpp: Fatal("Failed to open video device %s: %s", device.c_str(), strerror(errno));
./zm_local_camera.cpp: if ( stat(device.c_str(), &st) < 0 )
./zm_local_camera.cpp: Fatal("Failed to stat video device %s: %s", device.c_str(), strerror(errno));
./zm_local_camera.cpp: Fatal("File %s is not device file: %s", device.c_str(), strerror(errno));
./zm_local_camera.cpp: if ( (enum_fd = open(device.c_str(), O_RDWR, 0)) < 0 ) {
./zm_local_camera.cpp: device.c_str(), strerror(errno));
./zm_ffmpeg_camera.cpp: (hwaccel_device != "" ? hwaccel_device.c_str(): NULL), NULL, 0);
./zm_ffmpeg_camera.cpp: Debug(1, "Created hwdevice for %s", hwaccel_device.c_str());

...
I can't seem to follow device.c_str()
Is there any other way to get guaranteed device persistence using local UVC webcams?
C0ng0Blu3
Posts: 9
Joined: Sat Mar 28, 2020 5:09 pm

Re: /dev/v4l/by-path not supported in device path?

Post by C0ng0Blu3 »

2020-03-30 11:53:16 zmwatch 2060 ERR Unable to run "/usr/bin/zmdc.pl restart zmc -d /dev/v4l/by-path/pci-0000:00:02.1-usb-0:5:1.0-video-index0", output is "", status is 255 zmwatch.pl

LOL export log file for attachment -> txt says:
Export Failed: 500 / Internal Server Error

OK i think export log.txt current zmwatch? attachment.
zm-log.txt
(26.53 KiB) Downloaded 64 times
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: /dev/v4l/by-path not supported in device path?

Post by iconnor »

So zmwatch is unhappy, but that tells us nothing about why it isn't capturing. You need zmc logs. With debug on.

Please note that my local cams work fine with either /dev/video0 or the /dev/v4l/by-id string.
C0ng0Blu3
Posts: 9
Joined: Sat Mar 28, 2020 5:09 pm

Re: /dev/v4l/by-path not supported in device path?

Post by C0ng0Blu3 »

Cannot seem to output the whole debugging log, when exporting to txt file the page has a little white box and
does not give me any kind of output.
zm-log (4).txt
(26.56 KiB) Downloaded 69 times
zm-log (5).txt
(38.61 KiB) Downloaded 61 times
zm-log (6).txt
(19.46 KiB) Downloaded 71 times

I made sure in options/logging that debugging was turned on.
C0ng0Blu3
Posts: 9
Joined: Sat Mar 28, 2020 5:09 pm

Re: /dev/v4l/by-path not supported in device path?

Post by C0ng0Blu3 »

iconnor wrote: Mon Mar 30, 2020 10:00 pm So zmwatch is unhappy, but that tells us nothing about why it isn't capturing. You need zmc logs. With debug on.

Please note that my local cams work fine with either /dev/video0 or the /dev/v4l/by-id string.
I have 2 webcams that are the same.
by-id:
lrwxrwxrwx 1 root root 12 Mar 29 16:54 usb-Vimicro_Corp._Venus_USB2.0_Camera-video-index0 -> ../../video2
lrwxrwxrwx 1 root root 12 Mar 29 16:54 usb-Vimicro_Corp._Venus_USB2.0_Camera-video-index1 -> ../../video3

by-path:
lrwxrwxrwx 1 root root 12 Mar 29 16:54 pci-0000:00:02.1-usb-0:5:1.0-video-index0 -> ../../video0
lrwxrwxrwx 1 root root 12 Mar 29 16:54 pci-0000:00:02.1-usb-0:5:1.0-video-index1 -> ../../video1
lrwxrwxrwx 1 root root 12 Mar 29 16:54 pci-0000:01:01.2-usb-0:1:1.0-video-index0 -> ../../video2
lrwxrwxrwx 1 root root 12 Mar 29 16:54 pci-0000:01:01.2-usb-0:1:1.0-video-index1 -> ../../video3

video0 is the inside cam and video2 the outside one.
video1 and video3 are control channels.

by-id does not work at all for me.
I guess i could set it back to use /dev/video~ but it would be nice to have device persistence.
Post Reply