通过 USB 进行实时数据传输
我想弄清楚如何将计算机上渲染的帧传输到 Android 手机。 Wifi 和蓝牙的速度不够快,无法实现流畅的帧速率,但 USB 连接器上的数据传输速度却绰绰有余(高达 480 兆字节/秒)。问题是,我不知道该怎么做——Android 文档中没有任何内容,而且我在网上也没有找到任何内容。如何访问 USB 连接?
I'm trying to figure out how to transfer frames rendered on a computer to an android phone. Wifi and Bluetooth aren't fast enough for a smooth framerate, but the data transfer speed across the USB connector is more than enough (up to 480 megabytes/ second). Thing is, I can't figure out how to do it- there's nothing in the Android docs and I haven't found anything online. How can I access the USB connection?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您无法以任何记录和支持的方式访问 USB 连接。
You can't access the USB connection in any documented and supported fashion.
根本不可能吗?是否有允许这样做的黑客?
这不是一个用于发布的应用程序,我不介意弄乱我自己的手机。
It's not possible at all? Are there any hacks that allow it?
It's not an app for publication, and I don't mind messing with my own phone.
尝试打开调试模式并使用 adb 连接到设备。您可以手动将文件推送到手机(例如 SD 卡),然后您可以定期在应用程序中检查这些文件。您还可以以相反的方式(从您的应用程序)编写文件,并让您的 PC 应用程序再次通过 ADB 检查该文件。这样您就可以建立简单的通信协议。
我现在也需要这个,但有点困难,因为我尝试从内部带有 USB 主机芯片的可编程集成设备访问手机。这可能意味着对 ADB 进行逆向工程...
无论哪种方式,这都是一个相当老套的解决方案,但只要打开调试模式,它就应该适用于所有手机,这使得它可行。
Try turning debug mode on and using adb to connect to the device. You can manually push files to the phone (e.g. to the sdcard) which you can in turn periodically check in your app. You can also write files the other way around (from your app) and have your PC app check that file, again over ADB. That way you can establish simple protocols for communication.
I also need this right now, but a bit more difficult since I try to access the phone from an programmable integrated device with USB host chip inside. Which probably means reverse engineering ADB...
Either way, it's a pretty hacky solution but it should work over all phones as long as debug mode is turned on, which makes it feasible.