Can Usb4Java and Jna Library claim the same Interface?

Skip to first unread message

Peter Stoiber

Aug 30, 2018, 12:36:09 PM8/30/18
to usb4java


I'll have a problem with a program which I code on my linux Pc, where a camera stream should be transmitted.

On Linux I use the Usb4java Library to access the Usb Device and prepair the camera for the streaming. Therefore I have to claim the 2 CameraInterfaces and have to send some byte codes....

On the other side I have to transmit an isochronuos transfer, which I'm going to practise over an Jna Library, because the Isochronuos transfer is not supported from the Usb4java Lib. The JNA library uses the UsbFS Device Driver to transmit the data from the Device.

This procedure works like a charm on android, where ones the android usb.hardware.manager and also a library which uses the Jna were connected to the device and it's Interfaces.

On Linux I face the problem, that I can't access the device with 2 different libraries. When I claim an Interface from the usb camera with the Usb4java, the I'll get an error code from the JNA lib, that the device or resource is busy. If I release the interface from the Usb4java lib, then the JNA part works, but no more access over the Usb4java lib....

For a working stream both libs should be claimed to the Camera Interfaces.

The Jna lib is called UsbIso.

The author from the Usbiso lib hasn't tested his lib on linux up to now and also knows no solution for the problem. So perhaps someone here could help me out?

What I have tried:

Perhaps a Solution could be to use the high level API from Usb4java --> Javax.usb, or will I face then the same problem with the device busy error? Any other suggestions would be welcome.



Reply all
Reply to author
0 new messages