ZoneMinder / zoneminder

ZoneMinder is a free, open source Closed-circuit television software application developed for Linux which supports IP, USB and Analog cameras.
http://www.zoneminder.com/
GNU General Public License v2.0
5.08k stars 1.22k forks source link

limited maximum path length for the device path prevents use of some by-id names #301

Closed patmans closed 9 years ago

patmans commented 10 years ago

The maximum length of the Device Path seems to be limited to 64 bytes, so longer by-id names (that should be peristent across reboots) cannot be used.

For example, on my system, I have:

$ ls -l /dev/v4l/by-id/usb-OmniVision_Technologies__Inc._USB_Camera-B4.09.24.1-video-index1 lrwxrwxrwx 1 root root 12 Jan 11 12:20 /dev/v4l/by-id/usb-OmniVision_Technologies__Inc._USB_Camera-B4.09.24.1-video-index1 -> ../../video1

The above by-id name is 84 bytes long, so I'm forced to use the name /dev/video1, but that name can change across boots, where the by-id name should not change across boots.

A maximum of 256 bytes is quite likely good enough in all cases, 128 is probably ok for 99% of the hardware out there.

knight-of-ni commented 9 years ago

udev was designed to address the issue of device names changing across boots. I recommend you create a custom udev rule that always maps your device to /dev/video1

patmans commented 9 years ago

Sure I can do that, but it's much easier to use the existing persistent name that's already created by udev, and going forward that's a much better solution for all users.

connortechnology commented 9 years ago

I agree with the extra length actually. I put this on my todo list, it should be trivial.

connortechnology commented 9 years ago

Okay, I've committed to master the trivial change. This actually brings us in line with the MonitorPresets table.

This will be in 1.28.1 when it is released (soon), or you can run the master branch.

If you would like to just upgrade your db in place, use the following sql to alter the column type: ALTER TABLE Monitors MODIFY Device tinytext;