st-mems-android-linux-sensors-hal icon indicating copy to clipboard operation
st-mems-android-linux-sensors-hal copied to clipboard

Error multi-hal build android.hardware.sensors has a conflict

Open kataklysmo opened this issue 1 year ago • 2 comments

During the build i got the following error:

getDeviceHalManifest: -2147483648 VINTF parse error: Cannot add manifest fragment /vendor/etc/vintf/manifest/android.hardware.
[email protected]:HAL "android.hardware.sensors" has a conflict.

The content of the file [email protected] is the same as [email protected] located into st/sensors-hal/2.0

android.hardware.sensors hwbinder 2.0 ISensors default

I have not seen/found anything in the documentation about this error, is there any aditional information about it?

kataklysmo avatar Jan 23 '24 11:01 kataklysmo

Hello,

What Android version are you building the HAL for ? What Sensors HAL binary do you want to integrate into your Android distribution? the one for Multi-hal or HIDL 2.0 or AIDL? please, may you list the PRODUCT_PACKAGES being included into the device.mk files related to your build of sensors_hal ?

mariotesi avatar Jan 25 '24 16:01 mariotesi

Hi Mario,

I'm building the HIDL 2.0 version under android 12.

There is a default hardware/interfaces/sensors/2.0/multihal already defined in my build, and it's why it's failing as the version defined is the same as the one used in the ST build.

Android Manifests

HIDL and native HALs may use multiple version fields as long as they represent distinct major versions, with only one minor version per major version provided. For example, 3.1 and 3.2 can't coexist, but 1.0 and 3.4 can. This applies to all hal elements with the same name, unless override="true".

Using the override property inside [email protected] the build is working.

<manifest version="1.0" type="device">
    <hal format="hidl" override="true">
        <name>android.hardware.sensors</name>
        <transport>hwbinder</transport>
        <version>2.0</version>
        <interface>
            <name>ISensors</name>
            <instance>default</instance>
        </interface>
    </hal>
</manifest>

Once the system is booted up i can see how the service is started: 01-01 02:07:15.180 0 0 I init : starting service 'vendor.sensors-hal-2-0-multihal'... 01-01 02:07:15.195 0 0 I init : starting service 'vendor.sensors-hal-2.0-stmicroelectronics'... 01-26 09:52:52.599 0 0 I init : starting service 'vendor.sensors.qti'...

In my case i'm using the lsm6dso and the lis3mdl_magn, both chips are working fine and i can read raw data from them. imagen imagen imagen

But once i try to check the number of sensors available is 0.

dumpsys sensorservice
No Sensors on the device
devInitCheck : 0

I tested it with and without selinux enabled with the same result. About the PRODUCT_PACKAGES there is nothing relevant in my board.mk config, i will check the default ones and let you know.

Thanks Mario.

kataklysmo avatar Jan 26 '24 10:01 kataklysmo