Support for longer device paths

Anything you want added or changed in future versions of ZoneMinder? Post here and there's a chance it will get in! Search to make sure it hasn't already been requested.
Post Reply
cpick
Posts: 1
Joined: Wed Nov 16, 2011 4:34 am

Support for longer device paths

Post by cpick »

I use ZoneMinder with a USB v4l webcam and it works great. I had to make one small change to support my setup:

When I first installed ZoneMinder, the device path ("Add New Monitor" -> "Source" -> "Device Path") of my webcam happened to be '/dev/video0'. Some time later, I installed some other video hardware and my webcam was relocated to '/dev/video1' so I needed to adjust the device path to get it working again. However, since this is a USB device and its device path is subject to change in the future, I wanted to avoid having to do this reconfiguration again; fortunately udev provides some more permanent paths for this purpose.

I tried to change my device path to '/dev/v4l/by-id/usb-Guillemot_Corporation_Hercules_Dualpix_Exchange-video-index0', but it was truncated to '/dev/v4l/by-id/usb-Guillemot_Corporation_Hercules_Dualpix_Exchan' (without any error message, which caused some confusion). After some poking around I discovered this was due to the database's 'Monitors' table's 'Device' column being a varchar(64), so I increased it to 128 and everything has been working perfectly again:

Code: Select all

mysql zm <<< "alter table `Monitors` modify `Device` varchar(128) NOT NULL DEFAULT '';"
Would it be possible to increase the length of this column by default so others won't have to adjust this for similar reasons in the future? Also, I think it would be a good idea to warn the user when their device path value is being truncated because it's almost certainly not what they intended.

I'd like to thank the community for such a wonderful piece of software!
Post Reply