Hi CVS;
Thanks for you help.I had knew what the problem,the problem is i
use the Sensor HAL file if for the Android2.2,so after compiled the
HAL lib file ,the system can't call the HAL lib.So i have to rewrite
my Sensor HAL file if i want use the sensor in the Android2.3.
Thanks again.
Regards
Tommy Lu
On 11月2日, 下午3时49分, Tommy Lu <[email protected]> wrote:
> Hi CVS,
> Thanks again for you reply, in the logcat info ,i find the
> following error:
> D/SensorService( 1412): nuSensorService starting...
> E/SensorService( 1412): couldn't open device for module sensors
> (Invalid argument)
>
> And I followed the error info ,and find the in the
> SensorDevice.cpp file,the error info print.
> SensorDevice::SensorDevice()
> : mSensorDevice(0),
> mSensorModule(0)
> {
> status_t err = hw_get_module(SENSORS_HARDWARE_MODULE_ID,
> (hw_module_t const**)&mSensorModule);
> LOGE_IF(err, "couldn't load %s module
> (%s)",SENSORS_HARDWARE_MODULE_ID, strerror(-err)); //there is no
> error
>
> if (mSensorModule) {
> err = sensors_open(&mSensorModule->common, &mSensorDevice);
> LOGE_IF(err, "couldn't open device for module %s
> (%s)",SENSORS_HARDWARE_MODULE_ID, strerror(-err)); //error hapen
>
> So ,i add some print info for print the &mSensorModule->common and
> &mSensorDevice,and get the follow info:
> D/SensorService( 1412): nuSensorService starting...
> E/SensorService( 1412): &mSensorModule->common=TMWH
> E/SensorService( 1412): &mSensorDevice=
> E/SensorService( 1412): IIIII couldn't open device for module sensors
> (Invalid argument)
>
> I don't know where is the problem,so hope you give me some
> lights.Thanks.
> Regards
> Tommy
>
> On 11月1日, 下午9时28分, Chinmay V S <[email protected]> wrote:
>
>
>
>
>
>
>
> > The logs with log-tags "SensorTestOutput" show that the sensor-HAL does NOT
> > report any sensors to be implemented.
>
> > Looking at the contents of the /system/lib/hw directory, we can see
> > multiple copies of sensor-HAL
> > sensors.goldfish.so
> > sensors.omap4.so
> > sensors.omap4430.so
> > sensors.pandaboard.so
>
> > The sensors.goldfish.so is for the emulator.
> > Similarly, other the .so files are for different builds.
> > The android-runtime will always link to *sensors.<TARGET_BOARD_PLATFORM>.so*
>
> > The file that gets built can be changed by modifying the Android.mk in
> > libsensors as follows:
> > LOCAL_MODULE := sensors.$(*TARGET_BOARD_PLATFORM*)
>
> > Also check that the following line is present in Android.mk
> > LOCAL_CFLAGS := -DLOG_TAG=\"Sensors\"
> > (Helpful for debugging as we can then filter logcat output based on
> > log-tag=SENSORS)
>
> > This should generate the proper .so file (sensor-HAL).
>
> > Also, before copying the newly build .so file onto the target, clean the
> > directory as follows
> > rm -rf system/lib/hw/sensors.*
> > (This will remove the unrelated/unnecessary .so files)
>
> > Finally during boot-up check for the logs from the very start of the device
> > (not just test-application).
> > During early-bootup, a couple logs with log-tag "SENSORS" will be emitted.
> > These will contain the name of .so file being loaded.
> > Check for the log to make sure that the proper .so file is loaded.
>
> > GoodLUCK!
> > - CVS
--
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting