<?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>topic Re: Automatic Brgihtness Control on IMX8MQ Android 11 in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Automatic-Brgihtness-Control-on-IMX8MQ-Android-11/m-p/2179171#M241100</link>
    <description>&lt;P&gt;ALSO, ı can not change the flag type of sensor. You can see on dumpsys sensorservice output, it is&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;Sensor List:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x00000001) OPT3001 Ambient Light | Texas Instruments | ver: 1 | type: android.sensor.light(5) | perm: n/a | flags: 0x00000002&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;on-change | maxDelay=0us | maxRate=5.00Hz | no batching | non-wakeUp |&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;I have set in service file as flag 0x00 which is contnuous but it never change. Do you know how can i change this sensor flag from 0x02 to 0x00.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;/P&gt;</description>
    <pubDate>Thu, 02 Oct 2025 07:50:57 GMT</pubDate>
    <dc:creator>topkarag</dc:creator>
    <dc:date>2025-10-02T07:50:57Z</dc:date>
    <item>
      <title>Automatic Brgihtness Control on IMX8MQ Android 11</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Automatic-Brgihtness-Control-on-IMX8MQ-Android-11/m-p/2179167#M241098</link>
      <description>&lt;P&gt;Hello guys. I have a strange issue about Adaptive Brightness feature on IMX8MQ. I have used OPT3001 Ambient light sensor. I have succesfully add this sensor on kernel side, ı have seen it on dmesg log and ı can read the lux value successfully.&amp;nbsp; Let me show you some useful outputs.&amp;nbsp;&lt;BR /&gt;----------------------------------------------------------------------&lt;BR /&gt;smarc_mx8mq:/sdcard $ dmesg | grep opt3001&lt;BR /&gt;[ 2.901412] opt3001 0-0044: Found TI OPT3001&lt;BR /&gt;smarc_mx8mq:/sdcard $&lt;BR /&gt;----------------------------------------------------------------------&lt;BR /&gt;cat /sys/bus/i2c/devices/0-0044/iio:device0/in_illuminance_input&amp;nbsp;&lt;BR /&gt;113.440000 (it is just an example, it shows different based on ambient light).&lt;BR /&gt;&lt;BR /&gt;----------------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;So as you can see, sensor is working in kernel side.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For HAL side, ı have drive a service to control this ambient light lux values and write to FMQ.&amp;nbsp;&lt;BR /&gt;Actually, it is better the show directly.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This is the output of&amp;nbsp; dumpsys sensorservice&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;smarc_mx8mq:/ $ dumpsys sensorservice&lt;BR /&gt;Captured at: 10:27:38.483&lt;BR /&gt;Sensor Device:&lt;BR /&gt;Total 1 h/w sensors, 1 running 0 disabled clients:&lt;BR /&gt;0x00000001) active-count = 1; sampling_period(ms) = {250.0}, selected = 250.00 ms; batching_period(ms) = {0.0}, selected = 0.00 ms&lt;BR /&gt;Sensor List:&lt;BR /&gt;0x00000001) OPT3001 Ambient Light | Texas Instruments | ver: 1 | type: android.sensor.light(5) | perm: n/a | flags: 0x00000002&lt;BR /&gt;on-change | maxDelay=0us | maxRate=5.00Hz | no batching | non-wakeUp |&lt;BR /&gt;Fusion States:&lt;BR /&gt;9-axis fusion disabled (0 clients), gyro-rate= 200.00Hz, q=&amp;lt; 0, 0, 0, 0 &amp;gt; (0), b=&amp;lt; 0, 0, 0 &amp;gt;&lt;BR /&gt;game fusion(no mag) disabled (0 clients), gyro-rate= 200.00Hz, q=&amp;lt; 0, 0, 0, 0 &amp;gt; (0), b=&amp;lt; 0, 0, 0 &amp;gt;&lt;BR /&gt;geomag fusion (no gyro) disabled (0 clients), gyro-rate= 200.00Hz, q=&amp;lt; 0, 0, 0, 0 &amp;gt; (0), b=&amp;lt; 0, 0, 0 &amp;gt;&lt;BR /&gt;Recent Sensor events:&lt;BR /&gt;Active sensors:&lt;BR /&gt;OPT3001 Ambient Light (handle=0x00000001, connections=1)&lt;BR /&gt;Socket Buffer size = 39 events&lt;BR /&gt;WakeLock Status: not held&lt;BR /&gt;Mode : NORMAL&lt;BR /&gt;Sensor Privacy: disabled&lt;BR /&gt;1 active connections&lt;BR /&gt;Connection Number: 0&lt;BR /&gt;Operating Mode: NORMAL&lt;BR /&gt;com.android.server.display.AutomaticBrightnessController | WakeLockRefCount 0 | uid 1000 | cache size 0 | max cache size 0&lt;BR /&gt;OPT3001 Ambient Light 0x00000001 | status: active | pending flush events 0&lt;BR /&gt;0 direct connections&lt;BR /&gt;Previous Registrations:&lt;BR /&gt;09:42:02 + 0x00000001 pid= 551 uid= 1000 package=com.android.server.display.AutomaticBrightnessController samplingPeriod=250000us batchingPeriod=0us&lt;BR /&gt;09:37:56 - 0x00000001 pid= 551 uid= 1000 package=com.android.server.display.AutomaticBrightnessController&lt;BR /&gt;09:35:28 + 0x00000001 pid= 551 uid= 1000 package=com.android.server.display.AutomaticBrightnessController samplingPeriod=250000us batchingPeriod=0us&lt;BR /&gt;smarc_mx8mq:/ $&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;As you can see, automoticbrgihtnesscontroller is actually know the sensor.&amp;nbsp;&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------&lt;BR /&gt;This is the dumpsys display output for automatic brightness controller&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;dumpsys display&lt;BR /&gt;&lt;BR /&gt;Automatic Brightness Controller Configuration:&lt;BR /&gt;mScreenBrightnessRangeMinimum=0.035433073&lt;BR /&gt;mScreenBrightnessRangeMaximum=1.0&lt;BR /&gt;mDozeScaleFactor=1.0&lt;BR /&gt;mInitialLightSensorRate=250&lt;BR /&gt;mNormalLightSensorRate=250&lt;BR /&gt;mLightSensorWarmUpTimeConfig=0&lt;BR /&gt;mBrighteningLightDebounceConfig=4000&lt;BR /&gt;mDarkeningLightDebounceConfig=8000&lt;BR /&gt;mResetAmbientLuxAfterWarmUpConfig=true&lt;BR /&gt;mAmbientLightHorizon=10000&lt;BR /&gt;mWeightingIntercept=10000&lt;/P&gt;&lt;P&gt;Automatic Brightness Controller State:&lt;BR /&gt;mLightSensor={Sensor name="OPT3001 Ambient Light", vendor="Texas Instruments", version=1, type=5, maxRange=100000.0, resolution=0.01, power=0.001, minDelay=200000}&lt;BR /&gt;mLightSensorEnabled=true&lt;BR /&gt;mLightSensorEnableTime=470926 (2805217 ms ago)&lt;BR /&gt;mCurrentLightSensorRate=250&lt;BR /&gt;mAmbientLux=0.0&lt;BR /&gt;mAmbientLuxValid=false&lt;BR /&gt;mAmbientBrighteningThreshold=0.0&lt;BR /&gt;mAmbientDarkeningThreshold=0.0&lt;BR /&gt;mScreenBrighteningThreshold=0.0&lt;BR /&gt;mScreenDarkeningThreshold=0.0&lt;BR /&gt;mLastObservedLux=0.0&lt;BR /&gt;mLastObservedLuxTime=0 (3276143 ms ago)&lt;BR /&gt;mRecentLightSamples=0&lt;BR /&gt;mAmbientLightRingBuffer=[]&lt;BR /&gt;mScreenAutoBrightness=NaN&lt;BR /&gt;mDisplayPolicy=BRIGHT&lt;BR /&gt;mShortTermModelTimeout=300000&lt;BR /&gt;mShortTermModelAnchor=-1.0&lt;BR /&gt;mShortTermModelValid=true&lt;BR /&gt;mBrightnessAdjustmentSamplePending=false&lt;BR /&gt;mBrightnessAdjustmentSampleOldLux=0.0&lt;BR /&gt;mBrightnessAdjustmentSampleOldBrightness=0.0&lt;BR /&gt;mForegroundAppPackageName=com.android.settings&lt;BR /&gt;mPendingForegroundAppPackageName=null&lt;BR /&gt;mForegroundAppCategory=-1&lt;BR /&gt;mPendingForegroundAppCategory=-1&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------------&lt;BR /&gt;smarc_mx8mq:/ $ getprop | grep sensor&lt;BR /&gt;[init.svc.sensor_fusion]: [stopped]&lt;BR /&gt;[init.svc.vendor.sensors]: [running]&lt;BR /&gt;[init.svc_debug_pid.sensor_fusion]: []&lt;BR /&gt;[init.svc_debug_pid.vendor.sensors]: [351]&lt;BR /&gt;[ro.boottime.sensor_fusion]: [24640145010]&lt;BR /&gt;[ro.boottime.vendor.sensors]: [20921317621]&lt;BR /&gt;[ro.hardware.lightsensor]: [/sys/class/i2c-dev/i2c-0/device/0-0044/]&lt;BR /&gt;[vendor.ro.lightsensor.threshold]: [20]&lt;BR /&gt;smarc_mx8mq:/ $&lt;BR /&gt;&lt;BR /&gt;I do not know what are&amp;nbsp;ro.hardware.lightsensor and&amp;nbsp;vendor.ro.lightsensor.threshold. I did not include them these were already included. I have used opt3001 and it is also use 0x44 i2c addres by chance.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This is my service&amp;nbsp;&lt;BR /&gt;[init.svc.vendor.sensors]: [running]&lt;BR /&gt;&lt;BR /&gt;Actually everthing looks good, but just changing brightness based on ambient light doesnt work.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Normally, my backlight was not changing by setting brightness slider, and ı have generate a service to do this purpose also before. So, now when ı change the brightness by command line by using&amp;nbsp;&lt;BR /&gt;ettings put system screen_brightness , it change the backlight of my lcd. So there is no problem with driving backlight normally.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What can ı do for driving bakclight by using lux value of ALS ? I will attach my outputs such as logcat (which ı have add some log to debug in service), service files, dumpsys display and sensorservice outputs.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please let me know if anyone faced this issue. Not just for answer, you can chare your opinion also. Anything is accepted.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please check files in atachement. zip file includes service files which ı have create. Please check it .&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;KEYWOD: AMBIENT LIGHT SENSOR, IMX8MQ, BACKLGIGHT, BRIGHTNESS, SLIDER, LUX VALUE&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Oct 2025 07:49:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Automatic-Brgihtness-Control-on-IMX8MQ-Android-11/m-p/2179167#M241098</guid>
      <dc:creator>topkarag</dc:creator>
      <dc:date>2025-10-02T07:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Brgihtness Control on IMX8MQ Android 11</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Automatic-Brgihtness-Control-on-IMX8MQ-Android-11/m-p/2179171#M241100</link>
      <description>&lt;P&gt;ALSO, ı can not change the flag type of sensor. You can see on dumpsys sensorservice output, it is&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;Sensor List:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x00000001) OPT3001 Ambient Light | Texas Instruments | ver: 1 | type: android.sensor.light(5) | perm: n/a | flags: 0x00000002&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;on-change | maxDelay=0us | maxRate=5.00Hz | no batching | non-wakeUp |&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;I have set in service file as flag 0x00 which is contnuous but it never change. Do you know how can i change this sensor flag from 0x02 to 0x00.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 02 Oct 2025 07:50:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Automatic-Brgihtness-Control-on-IMX8MQ-Android-11/m-p/2179171#M241100</guid>
      <dc:creator>topkarag</dc:creator>
      <dc:date>2025-10-02T07:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Brgihtness Control on IMX8MQ Android 11</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Automatic-Brgihtness-Control-on-IMX8MQ-Android-11/m-p/2179560#M241123</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;For this you may refer to the generic Android documentation, please refer to the following:&lt;/P&gt;
&lt;DIV&gt;&lt;A href="https://developer.android.com/develop/sensors-and-location/sensors/sensors_environment#sensors-using-temp" target="_blank"&gt;https://developer.android.com/develop/sensors-and-location/sensors/sensors_environment#sensors-using-temp&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Best regards/Saludos,&lt;BR /&gt;Aldo.&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Oct 2025 18:23:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Automatic-Brgihtness-Control-on-IMX8MQ-Android-11/m-p/2179560#M241123</guid>
      <dc:creator>AldoG</dc:creator>
      <dc:date>2025-10-02T18:23:02Z</dc:date>
    </item>
  </channel>
</rss>

