[英]What is the best way to write a HAL to access hardware in Android9
I need to write a HAL to access sysfs entry from android APP but the thing is, the whole processing should not take more that 2 ms.我需要编写一个 HAL 来从 android APP 访问 sysfs 条目,但问题是,整个处理过程不应超过 2 毫秒。 What can be the best way to define the HAL or in simple language the fastest HAL.
什么是定义 HAL 的最佳方式,或者用简单的语言定义最快的 HAL。 I have implemented a binderized HAL and it is taking around 17 ms.
我已经实现了一个绑定的 HAL,它大约需要 17 毫秒。
A passthrough HAL is what you can use if latency matters that much.如果延迟很重要,您可以使用直通HAL。 But I doubt that your overall stack will be that fast, since your app will have have to use a (vendor) service in between, which it can only access via the "slow" framework Binder.
但我怀疑你的整体堆栈会那么快,因为你的应用程序必须在两者之间使用(供应商)服务,它只能通过“慢”框架 Binder 访问。
However, if you can move the time critical parts of your software to your (vendor) service process and let that use a passthrough HAL to access sysfs you might at least come close to 2ms.但是,如果您可以将软件的时间关键部分移动到您的(供应商)服务进程并让它使用直通 HAL 访问 sysfs,那么您可能至少接近 2 毫秒。
I am not sure if there is a selinux rule that forbids your service to access sysfs directly, though.不过,我不确定是否有禁止您的服务直接访问 sysfs 的 selinux 规则。 You might as well just access the sysfs entry from within the service and forget about the HAL.
您不妨只从服务中访问 sysfs 条目而忘记 HAL。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.