Open NatePolizogo opened 3 years ago
Freezing is very unexpected. I have only worked with the Nano for some short tests about a year ago and I remember also being slightly underwhelmed by the USB speed, but a complete freeze should not happen and to me indicates a problem with the code you are trying to run on the board.
In order to see if there is still room in the settings to improve the streaming speed it would be helpful if you could list the following settings.
MaxTransferSize
in your VimbaUSBTL.xml
file (file is located next to the VimbaUSBTL.cti
file. See content of the GENICAM_GENTL64_PATH
environment variable to find out where exactly the transport layer is installed)DeviceLinkSpeed
for the camera you are trying to use.Regarding the freezing you are reporting, as I said I feel this might be more related to the code you are trying to run. Perhaps your code is only receiving incomplete frames and you are silently ignoring those so it looks like nothing is happening? To troubleshoot this a minimal code example would be very helpful.
I would however like to point out, that this does not appear to be a VimbaPython issue, but rather a more general Connection/Vimba issue. For those our support team is likely more experienced in handling the issue and can provide further insight. They might also have some further ideas on how to troubleshoot this that I am not aware of as I am not as experienced with embedded systems. So please feel free to also contact our support via the form on our website.
After writing this I noticed, that I never suggested the use of the DeviceLinkThroughputLimit
feature. This is a feature, that reduces the amount of data sent (thereby also decreasing the number of recorded frames per second) to not overload the used communication bus. If the problem stems from incomplete frames due to too high bandwidth demands, it might be a helpful setting for you to reduce in order to be able to stream more than a few frames. I suggest you try reducing the value of this setting and see if it does improve the number of frames you are receiving. The 1236c is a camera which does need quite some bandwidth to transfer its data and your streaming might therefore be limited by the available bandwidth on the USB bus.
While skimming our knowledge base to answer #30 I remembered we also provide a short pdf on optimizing the Performance for Jetson boards. This does include a small section related to USB performance which might also be of interest for you. I do however believe that upgrading to Vimba 4.2 should be the first thing you attempt due to the mentioned improvements to the USB transport layer in that version.
I run the same code on a desktop pc and it works just fine. No incomplete frames and solid 7 fps. After some debuging I found out that the program does not freeze but all the frames acquired are incomplete, that's the reason I thought it freezed. Also, when I connect to nano through ssh on Visual Studio Code, that triggers incomple frames too. I use Vimba 4.1, I'd prefer to not updrage because I've developed an API on this version (I want to avoid incompatibilities between 4.1 and 4.2), but if the issue insists I'll do it. Although I'd prefer a solution without changing version.
The VimbaUSBTL.xml file looks like this: `<?xml version="1.0" standalone="no" ?>
I use Vimba 4.1, I'd prefer to not updrage because I've developed an API on this version (I want to avoid incompatibilities between 4.1 and 4.2), but if the issue insists I'll do it. Although I'd prefer a solution without changing version.
I am not aware of any breaking changes from Vimba4.1 to Vimba4.2 so you should be safe to update with no need for you to change your API. But I do understand, that you are hesitant.
The first thing I would suggest you try is changing the value of MaxTransferSize
in the VimbaUSBTL.xml file to use a value of 262144
(this is also the new default value in Vimba4.2 and above for Linux). In my experience this already had a great impact on the USB streaming performance. Also remember to uncomment the actual setting itself in that file (xml comments are indicated by <!-- THIS IS COMMENTED OUT -->
). Please perform the following change to apply the larger value for MaxTransferSize
:
- <!-- <MaxTransferSize>262144</MaxTransferSize> -->
+ <MaxTransferSize>262144</MaxTransferSize>
I hope this stabilizes your USB streaming. However you should definitely handle incomplete frames in your code as they can happen during normal operation. USB does not provide bandwidth guarantees and might occasionally fail to transfer all data for a frame in time. So having code that is able to work around such cases is definitely recommended.
One last thing: If you share code (especially larger sections like the VimbaUSBTL.xml file or your example code) you can let Github know so it will display the text in a more readable fashion (monotype, no line breaks, optionally with syntax highlighting) by surrounding it with three backticks (```) like this:
```
<your code goes in here>
```
More info and possibly other helpful tips can be found on this github help page.
I'm sorry for the code I was not aware about that syntax, yes I agree that I have to handle incomplete frames, but it does not help me somehow if all the frames are incomplete. Anyway, I'm flashing a fresh sdcard for nano right now to try the new Vimba version. By the way, I am using this camera for ML tasks and so I am using nvidia's Tensor RT that comes with nano's jetpack in python 3.6. It is really imposible to reinstall in on a later python version, and I had to make a patch file to make Vimba SDK run on python 3.6 last time. Is there any posibility to support python 3.6 for aarch64 devices as nano and jetson in general, that comes with all the nvidia goodies ?
I agree that I have to handle incomplete frames, but it does not help me somehow if all the frames are incomplete. Anyway, I'm flashing a fresh sdcard for nano right now to try the new Vimba version.
It is true, if all frames are incomplete then even handling them in a more elegant way would not be of any use. I sincerely hope, that Vimba 4.2 will help with the transmission as I have also experienced problems where only incomplete frames were transmitted in Vimba 4.1 and earlier. But since 4.2 the USB transfers on Linux improved for me dramatically. Have you already tried changing the MaxTransferSize
in the VimbaUSBTL.xml file as suggested? If so, did that bring an improvement? As mentioned this was already a very big factor when I last tried this.
I am using this camera for ML tasks and so I am using nvidia's Tensor RT that comes with nano's jetpack in python 3.6. It is really imposible to reinstall in on a later python version, and I had to make a patch file to make Vimba SDK run on python 3.6 last time. Is there any posibility to support python 3.6 for aarch64 devices as nano and jetson in general, that comes with all the nvidia goodies ?
I understand and agree, this makes it hard to impossible to upgrade as you would use the nice NVidia support for all those other libraries. As explained in #16 there is unfortunately currently no plan to backport VimbaPython to Python3.6. I am afraid you would have to keep that patch file around. But since it is essentially only commenting out three lines, I believe this is manageable.
Hello, I am trying to use the VimbaPythonAPI with an Allied Vision ALVIUM 1800 U-1236c color camera alongside with a jetson nano. I've written a asynchronous acquisition script and it runs just fine on desktop, solid 7 fps. Trying to run the same code on nano it makes my code freeze after a few frames. I've edited '/boot/extlinux/extlinux.conf' by adding usbcore.usbfs_memory_mb=1024 but it did not solved the problem.