Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

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.

Thanks,

Peter
Posted

1 solution

So far I only use the rewritten JNA lib for performing the iso transfer now and Usb4Java lib for finding the devices and read out the descriptors.

Link for the project is:

GitHub - Peter-St/Linux_Jna_Kamera: Camera stream over Jna.[^]

Peter
 
Share this answer
 
Comments
OriginalGriff 4-Mar-19 3:43am    
Please don't repost if your answer does not appear immediately: all of these went to moderation and required a human being to review them for publication. In order to prevent you being kicked off as a spammer, both had to be accepted, and then I have to clean up the spares. Have a little patience, please!
I've deleted the spare ...

You also need to take care about what questions you answer - this one is over 6 months old, and it's unlikely that the OP is interested in a solution now. Posting solutions to old questions can look like rep point farming which will get you kicked off the site. I don't think that is what you intended with this post, so I won't start the process, but some of our more "trigger-happy" member may if you aren't careful. I'd suggest sticking to newer questions, particularly when your other solution is to your own question.
Richard Deeming 5-Mar-19 12:04pm    
"... it's unlikely that the OP is interested in a solution now ..."

The solution was posted by the OP. :)
Peter____ 5-Mar-19 23:50pm    
Yes, the only reason was, to answered the open question and not being showed any more in the open question part and link a project with a working solution, so everyone having such a problem, can have a look.

So far...
Peter

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900