intel / ipu6-drivers

GNU General Public License v2.0
160 stars 51 forks source link

intel_ipu6_isys: Add video_nr module parameter #138

Closed jwrdegoede closed 1 year ago

jwrdegoede commented 1 year ago

Add a video_nr module parameter so that the isys /dev/video# node can be assigned a fixed number instead of taking the first available free number.

Both Ubuntu and Fedora by default use the IPU6 camera stack together with v4l2loopback for compat with apps which expect a regular video4linux2 device.

Most apps open /dev/video0 by default so we want that to be the v4l2loopback device. But currently if the ipu6-drivers load first they become /dev/video0.

This new video_nr module parameter allows distros to specify a different fixed number for intel_ipu6_isys so that v4l2loopback becomes /dev/video0 independent of the probe ordering.

hao-yao commented 1 year ago

@jwrdegoede Appreciate your commit! But this seems only work when IPU6 driver only create 1 video device. In many complicated situations such as multiple cameras and Ser-Des case, multiple video devices are created. What do you suggest in such cases?

jwrdegoede commented 1 year ago

@jwrdegoede Appreciate your commit! But this seems only work when IPU6 driver only create 1 video device. In many complicated situations such as multiple cameras and Ser-Des case, multiple video devices are created. What do you suggest in such cases?

Ah I was not aware that there can be multiple /dev/video# devices. In that case the video_nr parameter should be an int array instead of a single int. I'll prepare a new version for this.

jwrdegoede commented 1 year ago

Ok, I have just pushed new version adding your Ubuntu 23.04 fix for the CI and changing the video_nr parameter into an array.

jwrdegoede commented 1 year ago

Any further comments on this ?

We are using this in the Fedora/rpmfusion packages so it would be nice to get this merged.