0

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. What can be the best way to define the HAL or in simple language the fastest HAL. I have implemented a binderized HAL and it is taking around 17 ms.

wasnaz
  • 89
  • 1
  • 2

1 Answers1

0

A passthrough HAL is what you can use if latency matters that much. 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.

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.

I am not sure if there is a selinux rule that forbids your service to access sysfs directly, though. You might as well just access the sysfs entry from within the service and forget about the HAL.

Simpl
  • 1,938
  • 1
  • 10
  • 21
  • 1) But Android 8 onwards they suggest to use only binderized HALs right? 2) I will try point number 2 for sure, thats a good point. 3) I need to do few other works also in the same HAL apart from accessing the sysfs Anyway thanks for the points – wasnaz Apr 13 '20 at 08:35
  • Binderized HALs where introduced with Android 8. There are still valid use-cases for passthrough HALs such as latency critical accesses though. – Simpl Apr 13 '20 at 09:51