mainsail-crew / crowsnest

Webcam Service for multiple Cams
GNU General Public License v3.0
316 stars 76 forks source link

Refactor device enumeration in logging.sh #5

Closed WatskeBart closed 2 years ago

WatskeBart commented 2 years ago

Is your feature request related to a problem? Please describe

When using a HDMI-to-CSI module (eg B101 or C780), these devices or not found by logging.sh.

These kind of devices are not listed in /dev/v4l/by-id/ (only USB devices are)

Describe the solution you'd like

Instead of using /dev/v4l/by-id/ try /dev/v4l/by-path/

This way all possible video devices are enumerated.

Describe alternatives you've considered

In my setup i've changed line 88 to /dev/v4l/by-path/ and everything works as expected.

Additional information

Example of /dev/v4l/by-path/:

  1. pi@klipper:~ $ ll /dev/v4l/by-path/
  2. total 0
  3. lrwxrwxrwx 1 root root 12 Feb 13 10:47 platform-3f801000.csi-video-index0 -> ../../video0
  4. lrwxrwxrwx 1 root root 12 Feb 13 10:47 platform-3f801000.csi-video-index1 -> ../../video1
  5. lrwxrwxrwx 1 root root 12 Feb 13 11:17 platform-3f980000.usb-usb-0:1.4:1.0-video-index0 -> ../../video2
  6. lrwxrwxrwx 1 root root 13 Feb 13 10:47 platform-bcm2835-codec-video-index0 -> ../../video10
  7. lrwxrwxrwx 1 root root 13 Feb 13 10:47 platform-bcm2835-isp-video-index0 -> ../../video13
  8. lrwxrwxrwx 1 root root 13 Feb 13 10:47 platform-bcm2835-isp-video-index1 -> ../../video14
  9. lrwxrwxrwx 1 root root 13 Feb 13 10:47 platform-bcm2835-isp-video-index2 -> ../../video15
  10. lrwxrwxrwx 1 root root 13 Feb 13 10:47 platform-bcm2835-isp-video-index3 -> ../../video16

Example of /dev/v4l/by-id/:

  1. pi@klipper:~ $ ll /dev/v4l/by-id
  2. total 0
  3. lrwxrwxrwx 1 root root 12 Feb 13 11:35 usb-OmniVision_Technologies__Inc._USB_Camera-B4.09.24.1-video-index0 -> ../../video2

I really like the crowsnest addon because of ustreamer. Previously I used mjpg-streamer as part of KIAUH, but it slower and more limited then ustreamer.

meteyou commented 2 years ago

I would not replace it. For example: you use a usb webcam and change the port, by-id would also fit after the change. By-path would not fit and have to be modified.

WatskeBart commented 2 years ago

For me to use my HDMI-to-CSI platform-3f801000.csi-video-index0 -> ../../video0, /dev/v4l/by-path/ is the only option.

KwadFan commented 2 years ago

So, I thinkered around that. Replacing by-id isnt an Option for me, because its mainly made to support webcams and not hdmi2csi hats, besides the fact I dont know why you want to use a hdmi source as feed for a webcam daemon. But I dont want to give it up, maybe as additional input for the logging function, but it is last on my todo for now. As a reminder, if you use moonrakers update Manager to update crowsnest it will fail if you modify files. Regards

KwadFan commented 2 years ago

@WatskeBart

Please checkout the new branch https://github.com/mainsail-crew/crowsnest/tree/feat/csi-adaptors and test the changes. If you report success, I will merge it ASAP. Shouldnt you react in any form on this I will drop it.

Regards

KwadFan commented 2 years ago

Hello @WatskeBart , sad that you didnt response, but I think I did it. If this wont work for you feel free to open a new Issue.

Closing Issue due commit 62ee73b

Regards