This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ICS on AM3517 - Display rotation and Touchscreen

Other Parts Discussed in Thread: AM3517

Hi,

I have an AM3517 board running ICS and Linux 2.6.37 from Dev-Kit 3.0 (with repo sync - head branch) without sensors.

I have notice a strange behaviour about the touchscreen.

Setting the properties ro.sf.hwrotation = 90 on init.rc, the Display rotate correctly to 90 degree but Android works without rotating the touchscreen coordinate.

Is there a patch for ICS to solve this issue ?

Thank you.

Best regards,

Paolo.

  • Paolo,

    Touchscreen rotation for ro.sf.hwrotation is not supported with the TI Android DevKit ICS.

    The following patch in gingerbread implemented this feature. You may try to port this to ICS and see if it works for you:

    https://gitorious.org/rowboat/frameworks-base/commit/eb175bc9dbe6d997bf248997a12ebd893f99b6ab

  • I was having the same problem. Android ICS is not checking ro.sf.hwrotation to determine touch's rotation.
    In the file file InputReader.cpp, i had to add the following code in the function void TouchInputMapper::configureSurface.

    ......
    bool orientationChanged = mSurfaceOrientation != orientation;
    if (orientationChanged) {
    mSurfaceOrientation = orientation;
    }
    //-------------------------------------------------------------------------------
    mSurfaceOrientation = DISPLAY_ORIENTATION_90;
    //-------------------------------------------------------------------------------

    bool sizeChanged = mSurfaceWidth != width || mSurfaceHeight != height;
    if (sizeChanged || deviceModeChanged) {
       LOGI("Device reconfigured: id=%d, name='%s', surface size is now %dx%d, mode is %d",
    getDeviceId(), getDeviceName().string(), width, height, mDeviceMode);

     mSurfaceWidth = width;
    mSurfaceHeight = height;

    // Configure X and Y factors
    // mXScale = float(width) / (mRawPointerAxes.x.maxValue - mRawPointerAxes.x.minValue + 1);
    // mYScale = float(height) / (mRawPointerAxes.y.maxValue - mRawPointerAxes.y.minValue + 1);
    //----------------------------------------------------------------------------------------------------------
    switch (mSurfaceOrientation)
    {
    case DISPLAY_ORIENTATION_90:
    case DISPLAY_ORIENTATION_270:
         mXScale = float(width) / (mRawPointerAxes.y.maxValue - mRawPointerAxes.y.minValue + 1);
         mYScale = float(height) / (mRawPointerAxes.x.maxValue - mRawPointerAxes.x.minValue + 1);
         break;
    default:
          mXScale = float(width) / (mRawPointerAxes.x.maxValue - mRawPointerAxes.x.minValue + 1);
          mYScale = float(height) / (mRawPointerAxes.y.maxValue - mRawPointerAxes.y.minValue + 1);
          break;
    }
    //--------------------------------------------------------------------------------------------------------------
    mXPrecision = 1.0f / mXScale;
    mYPrecision = 1.0f / mYScale;

    .......
    I hardcoded the orientation to 90 degrees, but you can change it to check ro.sf.hwrotation. I also had to change the way mXScale and mYScale was being calculated because it was not taking into account the rotation. 

    Recompile everything and you can change only libinput.so

    Regards,

    Alberto Garcia

  • Thanks for the update.

    An alternate approach that could also be tried is to modify the touchscreen driver itself to report the rotated values. This is more useful in cases where the default LCD orientation differs from the default touchscreen orientation (e.g. Landscape touchscreen on Portrait LCD).

  • Hi Alberto,

    many thanks for the update.

    I make only a few changes to support the ro.sf.hwrotation property value, probably not optimized.

    The source code changed is attached here.

    Best regards,

    Paolo.

    1106.InputReader.cpp.txt

  • Hi Paolo,

    Thanks for the update too.

  • "

    I was having the same problem. Android ICS is not checking ro.sf.hwrotation to determine touch's rotation.
    In the file file InputReader.cpp, i had to add the following code in the function void TouchInputMapper::configureSurface.

    ......
    bool orientationChanged = mSurfaceOrientation != orientation;
    if (orientationChanged) {
    mSurfaceOrientation = orientation;
    }
    //-------------------------------------------------------------------------------
    mSurfaceOrientation = DISPLAY_ORIENTATION_90;
    //-------------------------------------------------------------------------------

    bool sizeChanged = mSurfaceWidth != width || mSurfaceHeight != height;
    if (sizeChanged || deviceModeChanged) {
       LOGI("Device reconfigured: id=%d, name='%s', surface size is now %dx%d, mode is %d",
    getDeviceId(), getDeviceName().string(), width, height, mDeviceMode);

     mSurfaceWidth = width;
    mSurfaceHeight = height;

    // Configure X and Y factors
    // mXScale = float(width) / (mRawPointerAxes.x.maxValue - mRawPointerAxes.x.minValue + 1);
    // mYScale = float(height) / (mRawPointerAxes.y.maxValue - mRawPointerAxes.y.minValue + 1);
    //----------------------------------------------------------------------------------------------------------
    switch (mSurfaceOrientation)
    {
    case DISPLAY_ORIENTATION_90:
    case DISPLAY_ORIENTATION_270:
         mXScale = float(width) / (mRawPointerAxes.y.maxValue - mRawPointerAxes.y.minValue + 1);
         mYScale = float(height) / (mRawPointerAxes.x.maxValue - mRawPointerAxes.x.minValue + 1);
         break;
    default:
          mXScale = float(width) / (mRawPointerAxes.x.maxValue - mRawPointerAxes.x.minValue + 1);
          mYScale = float(height) / (mRawPointerAxes.y.maxValue - mRawPointerAxes.y.minValue + 1);
          break;
    }
    //--------------------------------------------------------------------------------------------------------------
    mXPrecision = 1.0f / mXScale;
    mYPrecision = 1.0f / mYScale;

    .......
    I hardcoded the orientation to 90 degrees, but you can change it to check ro.sf.hwrotation. I also had to change the way mXScale and mYScale was being calculated because it was not taking into account the rotation. 

    Recompile everything and you can change only libinput.so

    Regards,

    Alberto Garcia"

    what was the code change you made for the scaling issue?  i am having the same issue now and your fix for adding the rotation property worked great, but i am also having the scaling touch issue. thanks allot!

  • Hi Paolo,

    we want to evaluate Android ICS on the am3517evm board from logicpd. Can you tell us where we can get a Android ICS for this board or point out the best way how we should do it?

    Thank You!

    Best regards,

    Ludwig

  • Hi Ludwing,

    I use a different board within am3517 but you can try to start using an android kernel 2.6.37 version for your logicpd board  and  following these basic steps found in this link:

    http://processors.wiki.ti.com/index.php/TI-Android-ICS-4.0.3-DevKit-3.0.1_DevelopersGuide

    (see the section Getting Source & Toolchain using the rowboat gitorius method)

    After downloading the sources, duplicate the folder <rowboat_ics_sources>/device/ti/omap3evm as <rowboat_ics_sources>/device/ti/ am3517evm

    In this folder jast created, replace in all files all "omap3evm" strings found in "am3517evm".

    Next, download the sgx 1.8 from http://gitorious.org/rowboat/hardware-ti-sgx/archive-tarball/ti_sgx_sdk-ddk_1.8, and extract all files into <rowboat_ics_sources>/hardware/ti/sgx

    Now change to android source dir and build the filesystem with the command

    make TARGET_PRODUCT=am3517evm OMAPES=3.x -j2

    cd  ./hardware/ti/sgx

    make TARGET_PRODUCT=am3517evm OMAPES=3.x ANDROID_ROOT_DIR=<rowboat_ics_sources>

    make TARGET_PRODUCT=am3517evm OMAPES=3.x ANDROID_ROOT_DIR=<rowboat_ics_sources> install

    To generate the tarball archive follow the section"Create root filesystem tarball manually" as described on the same TI's DevKit 3.0.1 document.

    But the performances are not so brilliant (low free memory ram ?).

    Best regards,

    Paolo.

  • Hi Paolo,

    thank you very much for this great answer.

    Best regards

    Ludwig

  • Hi Paolo,

    Does the rename from "omap3evm" to "am3517evm" (folder name / file names / inside files) is enough in order to get the build for "am3517evm" up and running ?
    Do I need other files, like a .config for the kernel, or any other changes in the build system ?

    Thank you,
    Vali
     

  • Hello again Paulo,

    Also can you please attach the  <rowboat_ics_sources>/device/ti/am3517evm folder to this thread ?
    When I run the exact instructions as you specified in this thread I get this error:  

     build/core/main.mk:532: PRODUCT_COPY_FILES has been modified:  development/data/etc/apns-conf_sdk.xml:system/etc/apns-conf.xml frameworks/base/data/sounds/F1_MissedCall.ogg:.......... <and this goes on almost for ever>.

    Thank you,
    Vali