<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックRe: Adding a sensor to Android but HAL doesn't seem to be initialized.</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Adding-a-sensor-to-Android-but-HAL-doesn-t-seem-to-be/m-p/1074911#M157803</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may find it helpful to refer to the following community thread where a sensor implementation to the HAL was made:&amp;nbsp;&lt;A href="https://community.nxp.com/thread/525702"&gt;https://community.nxp.com/thread/525702&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Ivan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Aug 2020 21:08:38 GMT</pubDate>
    <dc:creator>IvanRuiz</dc:creator>
    <dc:date>2020-08-13T21:08:38Z</dc:date>
    <item>
      <title>Adding a sensor to Android but HAL doesn't seem to be initialized.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Adding-a-sensor-to-Android-but-HAL-doesn-t-seem-to-be/m-p/1074910#M157802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to add an Ambient Light Sensor to an imx8mq Android 10 project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steps so far:&lt;/P&gt;&lt;P&gt;BoardConfig:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;+ BOARD_USE_SENSOR_FUSION := true&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MyBoard.mk&lt;/P&gt;&lt;P&gt;&amp;nbsp;+PRODUCT_PACKAGES += \&lt;BR /&gt;&amp;nbsp; &amp;nbsp;android.hardware.sensors@1.0-impl \&lt;BR /&gt;&amp;nbsp; &amp;nbsp;android.hardware.sensors@1.0-service \&lt;BR /&gt;&amp;nbsp; &amp;nbsp;sensors.imx8&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;init.rc&lt;/P&gt;&lt;P&gt;&amp;nbsp;+ added permissions and sys path to my ALS sensor can read lux and set mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/vendor/nxp-opensource/imx/libsensors_sensorhub&lt;/P&gt;&lt;P&gt;+ modified LightSensor to be specific to my device&lt;/P&gt;&lt;P&gt;+ modified sensors.cpp to include my ALS sensor in mSensors and SensorList&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At run time, I've modified the functions in sensors.cpp to have an ALOGD statement in the various functions. &amp;nbsp;open_sensors is called and you can see my sensor in pos 0 (the only sensor) has a valid fd. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;08-07 21:01:55.009 3157 3157 I Sensors : open_sensors&lt;BR /&gt;08-07 21:01:55.009 3157 3157 I Sensors : sensors_poll_context_t&lt;BR /&gt;08-07 21:01:55.504 3157 3157 I Sensors : fillPollFd&lt;BR /&gt;08-07 21:01:55.504 3157 3157 I Sensors : mSensors[0].fd = 7&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is also some statements about the service starting up and being registered.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;08-07 21:01:55.524 3157 3157 I ServiceManagement: Registered android.hardware.sensors@1.0::ISensors/default (start delay of 689ms)&lt;BR /&gt;08-07 21:01:55.524 3157 3157 I ServiceManagement: Removing namespace from process name android.hardware.sensors@1.0-service to sensors@1.0-service.&lt;BR /&gt;08-07 21:01:55.524 3157 3157 I android.hardware.sensors@1.0-service: Registration complete for android.hardware.sensors@1.0::ISensors/default.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;However, adb shell:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;gt;dumpsys sensor server&lt;/P&gt;&lt;P&gt;No Sensors on the device&lt;BR /&gt;devInitCheck : -19&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed also that sensors__get_sensors_list was never called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it seems I'm missing some step in the glue between the system service and the hw implementation. &amp;nbsp;Any suggestions where I might find that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FWIW, I can go to the sys directory and manually check the device is reporting lux right. &amp;nbsp;Also&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;gt; getevent -vl /dev/input/event2&lt;/P&gt;&lt;P&gt;0003 0028 0000000b&lt;BR /&gt;0000 0000 00000000&lt;BR /&gt;0003 0028 00000062&lt;BR /&gt;0000 0000 00000000&lt;BR /&gt;0003 0028 00000034&lt;BR /&gt;0000 0000 00000000&lt;BR /&gt;0003 0028 00000062&lt;BR /&gt;0000 0000 00000000&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The device driver appears to be working correctly and reporting events that are sensitive to when I'm covering up the ALS or not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2020 21:44:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Adding-a-sensor-to-Android-but-HAL-doesn-t-seem-to-be/m-p/1074910#M157802</guid>
      <dc:creator>dennis3</dc:creator>
      <dc:date>2020-08-07T21:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a sensor to Android but HAL doesn't seem to be initialized.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Adding-a-sensor-to-Android-but-HAL-doesn-t-seem-to-be/m-p/1074911#M157803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may find it helpful to refer to the following community thread where a sensor implementation to the HAL was made:&amp;nbsp;&lt;A href="https://community.nxp.com/thread/525702"&gt;https://community.nxp.com/thread/525702&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Ivan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2020 21:08:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Adding-a-sensor-to-Android-but-HAL-doesn-t-seem-to-be/m-p/1074911#M157803</guid>
      <dc:creator>IvanRuiz</dc:creator>
      <dc:date>2020-08-13T21:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a sensor to Android but HAL doesn't seem to be initialized.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Adding-a-sensor-to-Android-but-HAL-doesn-t-seem-to-be/m-p/1074912#M157804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok I found the missing step. &amp;nbsp;Since I started with a board config that had no sensors, the vendor manifest didn't include the HAL entry for the sensors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in /vendor/etc/vintf/manifest.xml&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;+ &amp;lt;hal format="hidl"&amp;gt;&lt;BR /&gt;+ &amp;lt;name&amp;gt;android.hardware.sensors&amp;lt;/name&amp;gt;&lt;BR /&gt;+ &amp;lt;transport&amp;gt;hwbinder&amp;lt;/transport&amp;gt;&lt;BR /&gt;+ &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;BR /&gt;+ &amp;lt;interface&amp;gt;&lt;BR /&gt;+ &amp;lt;name&amp;gt;ISensors&amp;lt;/name&amp;gt;&lt;BR /&gt;+ &amp;lt;instance&amp;gt;default&amp;lt;/instance&amp;gt;&lt;BR /&gt;+ &amp;lt;/interface&amp;gt;&lt;BR /&gt;+ &amp;lt;/hal&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;After adding that, the HAL layer properly communicates the sensors to Android and the light sensor is now available:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2020 21:25:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Adding-a-sensor-to-Android-but-HAL-doesn-t-seem-to-be/m-p/1074912#M157804</guid>
      <dc:creator>dennis3</dc:creator>
      <dc:date>2020-08-17T21:25:38Z</dc:date>
    </item>
    <item>
      <title>integration of lsm6dsm sensor on android 11 with imx8mm board</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Adding-a-sensor-to-Android-but-HAL-doesn-t-seem-to-be/m-p/1720420#M212368</link>
      <description>&lt;P&gt;Can you please help me to integrate the lsm6dsm sensor on Android source code and get the values of the sensor in a application.&lt;/P&gt;&lt;P&gt;Steps that i have followed:&lt;/P&gt;&lt;P&gt;1.Driver was loaded and I can get the values in my pc terminal by:cat sys/class/i2c-dev/i2c-2/device/2-006b/iio\:device1/in_accel_x_raw&lt;/P&gt;&lt;P&gt;Then what i need to modify so that to achive the sensor values in any application??&lt;/P&gt;&lt;P&gt;Thankyou in advance..&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 13:00:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Adding-a-sensor-to-Android-but-HAL-doesn-t-seem-to-be/m-p/1720420#M212368</guid>
      <dc:creator>Pritamsrisahoo_ss</dc:creator>
      <dc:date>2023-09-11T13:00:18Z</dc:date>
    </item>
  </channel>
</rss>

