-
Notifications
You must be signed in to change notification settings - Fork 30
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
Google Coral camera not detected on /dev/video3 #273
Comments
Hi @steamfoundry, the logs are not even mentioning the Could you also provide:
Thanks |
Here is some more that might be helpful Output of v4l2-ctl --list-devices
Output to show the v4l subdevices
ls of dev/v4l/by-path/
Yet more information
|
After a little more digging, I suspect these extra devices are extra functionality of the i.MX8MP processor. Because the image I'm using is Ubuntu on a Yocto kernel instead of a pure Yocto build, it's missing the drivers needed to fully identify the extra devices. Here is a little more detail on them.
/dev/video1
/dev/video2
/dev/video3
|
Sorry if none of that was helpful. But it looks like the original log does see the device.
It just didn't give the device name in the error report. |
So from reading /src/video/video_source_local.rs , it says the udevadm info might help.
So if I'm understanding right, this isn't matching the platform regex in |
Sorry for the delay responding you, that's great info, it indeed makes sense, It seems there's something wrong in the device discovery, by design it should work with You might need to add a couple of debug for us to understand it better, for instance, we can start with the following one: diff --git a/src/video/video_source_local.rs b/src/video/video_source_local.rs
index 1aea91b..15c5b25 100644
--- a/src/video/video_source_local.rs
+++ b/src/video/video_source_local.rs
@@ -650,6 +650,7 @@ impl VideoSourceAvailable for VideoSourceLocal {
cameras.push(VideoSourceType::Local(source));
}
+ debug!("cameras available: {cameras:#?}");
cameras
}
} Thanks |
Here was the output
|
Okay, the problem must be right in that function, let's try to see where: diff --git a/src/video/video_source_local.rs b/src/video/video_source_local.rs
index 1aea91b..a124781 100644
--- a/src/video/video_source_local.rs
+++ b/src/video/video_source_local.rs
@@ -599,6 +599,7 @@ impl VideoSourceAvailable for VideoSourceLocal {
return cameras;
}
};
+ debug!("read_dir: {read_dir:#?}");
read_dir
.filter_map(|dir_entry| {
@@ -615,6 +616,7 @@ impl VideoSourceAvailable for VideoSourceLocal {
.filter(|entry_str| entry_str.starts_with("/dev/video"))
.collect::<Vec<String>>()
};
+ debug!("cameras path: {cameras_path:#?}");
for camera_path in &cameras_path {
let device = match Device::with_path(camera_path) {
@@ -632,11 +634,13 @@ impl VideoSourceAvailable for VideoSourceLocal {
continue;
}
};
+ debug!("caps: {caps:#?}");
let typ = VideoSourceLocalType::from_str(&caps.bus);
if let Err(error) = device.format() {
- if error.kind() != std::io::ErrorKind::InvalidInput {
+ // if error.kind() != std::io::ErrorKind::InvalidInput
+ {
debug!("Failed to capture formats for device: {camera_path}\nError: {error:?}");
}
continue;
@@ -650,6 +654,7 @@ impl VideoSourceAvailable for VideoSourceLocal {
cameras.push(VideoSourceType::Local(source));
}
+ debug!("cameras available: {cameras:#?}");
cameras
}
} |
Build failed on the commented out if statement. Was this correct?
The compile error was
|
Sorry: diff --git a/src/video/video_source_local.rs b/src/video/video_source_local.rs
index 1aea91b..78fe7a7 100644
--- a/src/video/video_source_local.rs
+++ b/src/video/video_source_local.rs
@@ -599,6 +599,7 @@ impl VideoSourceAvailable for VideoSourceLocal {
return cameras;
}
};
+ debug!("read_dir: {read_dir:#?}");
read_dir
.filter_map(|dir_entry| {
@@ -615,6 +616,7 @@ impl VideoSourceAvailable for VideoSourceLocal {
.filter(|entry_str| entry_str.starts_with("/dev/video"))
.collect::<Vec<String>>()
};
+ debug!("cameras path: {cameras_path:#?}");
for camera_path in &cameras_path {
let device = match Device::with_path(camera_path) {
@@ -632,13 +634,14 @@ impl VideoSourceAvailable for VideoSourceLocal {
continue;
}
};
+ debug!("caps: {caps:#?}");
let typ = VideoSourceLocalType::from_str(&caps.bus);
if let Err(error) = device.format() {
- if error.kind() != std::io::ErrorKind::InvalidInput {
- debug!("Failed to capture formats for device: {camera_path}\nError: {error:?}");
- }
+ // if error.kind() != std::io::ErrorKind::InvalidInput {
+ debug!("Failed to capture formats for device: {camera_path}\nError: {error:?}");
+ // }
continue;
}
@@ -650,6 +653,7 @@ impl VideoSourceAvailable for VideoSourceLocal {
cameras.push(VideoSourceType::Local(source));
}
+ debug!("cameras available: {cameras:#?}");
cameras
}
} |
Here is the new log
|
Okay.
I need some time to investigate it, it is a direct response from the v4l library we are using. |
Thanks for looking into this. |
Hi @steamfoundry, can you test this PR? It's updating the v4l library, which might solve the problem. |
Didn't seem to do it.
|
Thanks, I'll work on a better solution using GStreamer instead of relying on that v4l library. |
Not sure if this would be too small of a use case for you. The NXP i.MX 8M Plus has a lot of support for hardware encoding/decoding that works with Gstreamer. NXP also wrote a user guide. https://community.nxp.com/pwmxy87654/attachments/pwmxy87654/imx-processors%40tkb/15/2/i.MX8GStreamerUserGuide.pdf If there was the choice using Gstreamer to enable hardware encoding that would be great. |
Excellent, thanks for the docs, as we are already using GStreamer in our pipelines, I believe it's just a matter of using the correct plugins, like perhaps We have a plan to allow users to use and configure and/or transcoding in our pipelines, it's being discussed here, you are more than welcome to participate :) |
Hi @steamfoundry, could you test this PR and post the full log here? I still need to work on some details, but it should detect your camera and its formats using the added GStreamer's Device Monitor API. Thanks |
Verbose output
|
And the trace log |
@steamfoundry it seems all right, GStreamer seems to be able to detect your camera formats. Have you tried to open the page and create the stream? I'd like the log after you try, if possible :) |
Sorry, I tried but it's still not showing the camera in my available screens. I tried to add it manually but that failed too. Let me gather the logs for you. |
Hi @steamfoundry, have you done anything about this? |
The V4L compatible camera on /dev/video3 isn't detected currently.
Camera
Google Coral connected via MIPI-CSI
Example Gstreamer command that will stream to QGroundControl (As UDP)
sudo gst-launch-1.0 v4l2src device=/dev/video3 ! video/x-raw,width=640,height=480,framerate=30/1 ! vpuenc_h264 bitrate=500 ! rtph264pay ! udpsink host=192.168.1.103 port=5600 sync=false
Board details
Output from mavlink-camera-manager
mavlink-camera-manager.2023-08-22-15.log
The text was updated successfully, but these errors were encountered: