Usb4java,JNA,IOCTL,库 [英] Usb4java, JNA, IOCTL, library

查看:116
本文介绍了Usb4java,JNA,IOCTL,库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我的程序问题,我在我的linux Pc上编码,应该传输摄像机流。



在Linux上我使用Usb4java库来访问Usb设备并为相机准备流媒体。因此,我必须声称2个CameraInterfaces并且必须发送一些字节代码....



另一方面我必须发送等时线转移,我'我要去Jna图书馆练习,因为Usb4java

Lib不支持Isochronuos转移。 JNA库使用UsbFS设备驱动程序从设备传输数据。



这个程序就像android上的一个魅力,其中android usb.hardware.manager还有一个使用Jna的库连接到设备和它的接口。



在Linux上我遇到问题,我无法访问设备2不同的图书馆当我使用usb4java从usb相机声明一个接口时,我将从JNA lib获得一个错误代码,即设备或资源正忙。如果我从Usb4java lib释放接口,那么JNA部分可以工作,但是不能再通过Usb4java lib访问....



对于工作流来说两个库应声明相机接口。



Jna lib称为UsbIso。



作者来自到目前为止,Usbiso lib还没有在linux上测试他的lib,也没有解决问题的方法。所以也许有人可以帮助我吗?



我尝试过:



也许解决方案可能是使用Usb4java的高级API - > Javax.usb,或者我会遇到与设备繁忙错误相同的问题吗?

欢迎任何其他建议。



谢谢,



Peter

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

推荐答案

到目前为止,我只使用重写的JNA lib来执行iso传输和Usb4Java lib用于查找设备并读出描述符。



该项目的链接是:



GitHub - Peter-St / Linux_Jna_Kamera:Jna上的摄像头流。 [ ^ ]



Peter
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

这篇关于Usb4java,JNA,IOCTL,库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆