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
Testing under macOS Apple Silicon #137
Comments
Error messages are like this.
|
Interestingly the old 2.2.8 binary still works under my Mac Mini M1 with Rosetta 2 and Homebrew x86_64 Mono.
|
Mono info.
|
I can actually Mono xbuild to build 2.2.8 source.
|
Is the following considered a success for the build process under macOS? Sorry I have no clue on dotnet under macOS.
But then the test failed. I am using Rosetta x86_64 emulation here under my Mac Mini M1.
|
My main target is actually to run the examples as I have the associated HW (Benchmark USB device) to carry out the tests. For the old 2.2.8 release (released back in 29-Oct-2010) I can only run the benchmarkcon console application but it is actually the most important app for me. The other GUI examples will just crash. |
Right now the examples seem to point to .NET Framework 4.5, and not .Net 5.0, or .NetCore 3.1/5.0. |
@mcuee "Modern" C#/.NET code should work just fine when compiled for arm/rpi. This project (still) uses Updating this has been on my backburner for quite a while (admittedly, too long). Let me see if I can free up time the coming weeks to get this done. It will make things easier for everyone. The goal still is:
|
@qmfrederik That will be great. I would like to use BenchmarkCon to test both libusbdotnet and libusb in Windows/Linux/Mac, I did that last time when I was able to build libusbdotnet using SharpDevelop under Windows and MonoDevelop under Linux/Mac. |
Here is the build log for BenchmarkCon with latest git under macOS. Looks like Core LibUsbDotNet project is fine but not the example yet.
|
There is a warning when building main libusbdotnet library.
|
@mcuee Yes, you are correct. The benchmark library uses async transfers which haven't been ported yet to the 3.0 series. That's causing the errors you are seeing. On a related note - I'd like to add some sort of integration tests to LibUsbDotNet. Do you have any tips for that? (E.g. a QEMU VM with emulated USB devices, a Linux kernel driver which loads phony devices,...)? |
Yes from the very beginning of working with Travis Robinson on libusb-win32/libusbdotnet/libusbk back in 2009/2010 time, we were thinking about how to carry out tests, in the end he settled on using PIC MCU based USB examples as both of us were familiar with PIC USB stuff. Later Tarvis ported it to AVR32 as we need high speed USB examples as well and I got the support from Microchip/Atmel with some tools for Travis at that time. Pete Batard (original developer of libusb-1.0 Windows backend) actually ported the example to ARM as well. I admit I knew very little about dotnet so I was not able to support it, but I did use the libusbdotnet benchmark example extensively over the years as a testing tool for my engagement in libusb-1.0 project as it is cross-platform. It is great that you took over libusbdotnet project from Travis. I was also involved in pyusb and we had similar discussion as well. Right now Jonas has to disable the HW based tests as he does not have the necessary HW. Original pyusb developer adopted the same PIC MCU based approach but new developer does not have the HW. A virtual testing device mentioned by Emmanuel Blot (developer of pyftdi) is interesting. |
Using a QEMU VM to emulate the USB device may be a good idea if it is possible, I am not familiar with QEMU myself. Or maybe a Raspberry Pi running Linux USB Gadget driver. Raspberry Pi Pico may be interesting as well. Under Windows there is this one (older version of WDK has similar stuff but was obsolete). OLD WDK USB Emulation sample (I tested it last time back in July 2011): |
Thanks, @mcuee . Both the Linux loopback driver and the QEMU approach look interesting, then. I'll explore them a bit further. The QEMU/VirtualBox approach has the advantage that it should be trivial to set up a "standard" test environment which we can use on developer desktops and in CI systems, and we can run the test on different platforms (e.g. Windows or Linux as a guest). The Linux USB gadget driver/USB loopback device look very interesting because they involve much less overhead. On the other hand, it may be more difficult to deploy to CI environments (we'll have to test). |
As it stands, the benchmark example doesn't work on the master (v3) branch because async transfers are not implemented. .NET has a new model for async I/O and I would like to see if we can use that model. This will take some time. I'll have a look at the v2 branch, and see if I can the v2 version to compile correctly with .NET core. It should enable you to use the benchmark tool on all platforms which .NET Core supports. I only want to make changes related to build tooling on the v2 branch, the master branch is for refactoring work. |
Please refer to #138. Now you can use v2 branch under macOS if you need async examples. It also works under Windows and Linux. |
BTW, benchmarkcon can be very flexible and test any FW with loopback FW (interrupt transfer, bulk transfer and isochronous transfer). Test done back in 2013. With Cypress's cystream firmware and tested under Mac OS X Firmware: http://www.cypress.com/?app=forum&id=167&rID=48493 Board: An ADC demo board from ADI, just take out the
|
Somehow this no longer works (CyStreamer FW) since I can not change to a different alternative interface. I will need to check again. |
I have made some progress with Linux USB Gadget here. Still learning how to configure the usb gadget. The HW devices are really cheap (eg: Raspberry Pi Zero, Orange Pi Zero). |
@qmfrederik I will highly recommend the following US$49 Cypress FX3 development board. |
Benchmarkcon results under my Mac Mini M1 (8GB RAM, 256GB SSD).
|
@qmfrederik |
Sorry but I can not seem to be able to build libusbdotnet under my Mac Mini M1. Just wondering if there is any reference. I have installed Visual Studion for Mac.
The text was updated successfully, but these errors were encountered: