Should I upgrade?
-
@Eric-Katzfey Sure... I just ran it again, and didn't even get to run VLC on my host and the server crashed. Here are the outputs...
voxl-uvc_server:/ # voxl-uvc-server -v045e -p0772 -r640x480 -d Enabling debug messages voxl-uvc-server starting Vendor ID 0x045e chosen Product ID 0x0772 chosen Image resolution 640x480, 30 fps chosen UVC initialized Device 045e:0772 found Device opened uvc_get_stream_ctrl_format_size succeeded for format 0 Streaming starting Got frame callback! frame_format = 3, width = 640, height = 480, length = 613388, ptr = (nil) * got image 30 * got image 60 * got image 90 * got image 120 * got image 150 * got image 180 * got image 210 * got image 240 * got image 270 * got image 300 * got image 330 * got image 360 * got image 390 * got image 420 * got image 450 * got image 480 * got image 510 * got image 540 * got image 570 * got image 600 Segmentation fault / #
voxl-streamer:
/ # voxl-streamer -c uvc-generic -d Using configuration uvc-generic Enabling debug messages Using configuration file /etc/modalai/voxl-streamer.conf MPA interface chosen Input pipe name /run/mpa/uvc/ Output stream width 640 Output stream height 480 Output stream bitrate 1000000 Output stream rotation 0 Output frame decimator 1 No image overlay specified Camera server Connected First frame timestamp: 5791926161024 Second frame timestamp: 5791958239848 Calculated frame delta in ns: 32078824 Calculated frame delta in 100us: 320 Calculated input frame rate is: 31 Output frame rate will be: 31 Meta data from incoming frame: magic_number 0x564F584C timestamp_ns: 5791958239848 frame_id: 519 width: 640 height: 480 size_bytes: 614400 stride: 1280 exposure_ns: 100 gain: 100 format: 8 Input parameters initialized Made rtsp_server Created RTSP server main loop context Created RTSP server main loop Created RTSP server main loop source for callback Got 2 from gst_rtsp_server_attach Stream available at rtsp://127.0.0.1:8900/live Camera server Disconnected ERROR in pipe_client_init_channel opening request pipe: No such device or address Most likely the server stopped without cleaning up Client is cleaning up pipes for the server ^CGot SIGINT, exiting Trying to stop loop g_main_loop exited voxl-streamer ending / #
You can see in the voxl-streamer output that it was running till voxl-uvc-server crashed. Eventually, I used Ctrl-C to terminate voxl-streamer.
If you want me to try anything, just let me know. I've worked with several USB cameras myself but primarily with V4L2/OpenCV/Gstreamer. I haven't used LibUVC, can't find much documentation. Can you point me to the libuvc source? -
@Ed-Sutter We use our own version of libuvc. You can find our project here: https://gitlab.com/voxl-public/voxl-sdk/third-party/voxl-libuvc
-
@Ed-Sutter I think the problem is the varying frame size. That's probably causing a problem somewhere (either memory leak or overflow).
-
@Eric-Katzfey I agree, but I don't understand why the frame size varies! Its not compressed, so it should be a fixed size per frame. Know what I mean?
-
@Ed-Sutter Yes. But maybe just a quirk of the camera. There are a few ways to go about fixing this. It looks like the frames are either the correct size or smaller. If that's the case, you could always add "fake" data to the end of the received buffer to make it the correct size in voxl-uvc-server and then write it into the pipe. You could try this and see if that makes the stream work.
-
@Eric-Katzfey Ok, I'll dig into this more. I need to understand it anyway, so I'll look at libuvc and voxl-uvc-server and let you know what I figure out.
-
@Ed-Sutter Excellent, thanks!
-
@Eric-Katzfey FYI... Using a Logitech BRIO camera seems to work fine... the frame size always returns the same value (614400 in my case). Still, I wanna spend some time attempting to figure out why the Microsoft HD camera doesn't work as well...
-
@Ed-Sutter We have tested with these cameras:
- Logitech C270
- Logitech C930e
- Logitech Brio (USB 2.0 and USB 3.0 on VOXL 2)
- Videology 5MP Micro USB 2.0 Board Camera
- PureThermal Mini with Flir Lepton
- Flir Boson 640
- Blue Robotics h264 camera
-
@Eric-Katzfey By the way, regarding "upgrading"... All I did was opkg update; opkg upgrade. I really don't know what all that updated (aside from /etc/modalai/voxl-streamer.conf); but the output of "voxl-version" didn't change at all.
Based on that it appears I'm running with a system-image that was built on 2021-06-06 (about 15 months ago). Is that the most recent? -
@Ed-Sutter We are preparing a new VOXL platform release but are still completing an update of our ToF camera support. Once that is complete the release will go out.
-
@Eric-Katzfey Ok, no rush (just curious)... Is that updated by the same procedure (opkg update; opkg upgrade)?
-
@Ed-Sutter No, there is a bash script to handle it. The opkg method is good for SDK and package updates but the full platform release also contains a new system image that needs to be flashed via fastboot.
-
@Eric-Katzfey Update regarding the intermittent frame size when using the MS-1080P-HD camera... I pulled down the latest libuvc code from github and built it on my Ubuntu 18.04 machine. I was then able to run uvc_test on that camera and it always came back with the same (correct) frame size.
Is there any chance that the libuvc version you guys have on voxl-public is a bit out-of-date? -
@Eric-Katzfey Just to gather a little more data, I took the voxl-libuvc code and built it on Ubuntu18.04. Then I ran uvc_test with the MS-1080P-HD camera and it worked fine.
To do this I cloned libuvc and voxl-libuvc, then prior to building libuvc, I copied all the source files (*.[ch]) from voxl-libuvc to libuvc. This allowed me to use voxl-libuvc source code, but still build on a native ubuntu host.
Anyway, that eliminates voxl-libuvc from the suspect list. Since voxl-uvc-server's callback is fed the frame size, that kinda points to the driver as a possible suspect.
Any thoughts?
If interested, I can post the script I used to do that build.
-
@Ed-Sutter What is uvc_test?
-
@Eric-Katzfey Its the output of building test.c which is part of the libuvc code. It just uses libuvc to grab frames and they are pushed to the console with OpenCV.
-
@Ed-Sutter It looks like it prints the length each frame. Do you see it show same frame length each time or does it ever change?
-
@Eric-Katzfey Yes, it does print every frame, and it is consistently (i.e. always) 614400 in my case.
-
@Eric-Katzfey I modified the voxl-libuvc/build.sh script so that it would build the uvc_test (from test.c) program I mentioned earlier. Refer to the README.md file in the original libuvc code)...
cmake ../libuvc -DBUILD_TEST=ON -DBUILD_EXAMPLE=ON
The test.c code uses opencv to display to a monitor, so I also stubbed that code out so that the callback simply prints the received frame size.
With those changes I was able to install the uvc_test program on my Voxl Flight Deck and I see the same inconsistent frame size. That eliminates any suspicion of a problem with voxl-uvc-server code; and since this works correctly on a standard x86 linux machine, this points to the driver. Are there any open issues with this that you are aware of?