Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Equal only by usb paths #1481

Merged
merged 2 commits into from
Oct 21, 2024
Merged

Conversation

Juniormunk
Copy link
Contributor

This bug would only appear when there are cameras with the same naming. Old config matching would also match using the by-id this was problematic. When one camera is disconnected it would assign the by-id path to the other camera with the
same name. When the camera is replugged in it would not be reassigned the by-id path and would fail the camerainfo equals check.

For example:

Camera A (other paths contains) :
/dev/v4l/by-path/platform-fc800000.usb-usb-0:1:1.0-video-index0
/dev/v4l/by-id/usb-Arducam_Technology_Co.__Ltd._Arducam_OV9782_USB_Camera_UC852-video-index0

Camera B (other paths contains) :
/dev/v4l/by-path/platform-fc880000.usb-usb-0:1:1.0-video-index0

When camera A is unplugged:

Camera A (other paths contains) :
(nothing its unplugged)

Camera B (other paths contains) :
/dev/v4l/by-path/platform-fc880000.usb-usb-0:1:1.0-video-index0
/dev/v4l/by-id/usb-Arducam_Technology_Co.__Ltd._Arducam_OV9782_USB_Camera_UC852-video-index0

When camera A is plugged in again:

Camera A (other paths contains) :
/dev/v4l/by-path/platform-fc800000.usb-usb-0:1:1.0-video-index0

Camera B (other paths contains) :
/dev/v4l/by-path/platform-fc880000.usb-usb-0:1:1.0-video-index0
/dev/v4l/by-id/usb-Arducam_Technology_Co.__Ltd._Arducam_OV9782_USB_Camera_UC852-video-index0

@Juniormunk Juniormunk requested a review from a team as a code owner October 21, 2024 02:14
@mcm001
Copy link
Contributor

mcm001 commented Oct 21, 2024

So by-id is only assigned to one of the two cameras? what the fuck, v4l

@Juniormunk
Copy link
Contributor Author

seems like it... ¯_(ツ)_/¯

@mcm001
Copy link
Contributor

mcm001 commented Oct 21, 2024

Can we get a couple unit tests added as well to cover two identical cameras then? Both the unplug one of the two and move it case, and the i have one duplicate and i unplug and plug into the same port?

Copy link
Contributor

@mcm001 mcm001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests look good

@Juniormunk Juniormunk merged commit 8eaa690 into PhotonVision:master Oct 21, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants