Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

Rotation for USB touchscreen?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Rotation for USB touchscreen?

    I have a Lilliput 669GL touchscreen. The touchscreen is recognised as eGalax, USB ID 0EEF:0001.

    It is recognised as a mouse (with a pointer) when connected by USB. I can have it recognised as a touch screen by adding a file to /system/usr/idc identifying it as a touchscreen.

    I tested it on my Google Nexus 7 before my MX1 arrived and it works fine (though I couldn't test it with the screen), but in portrait and landscape mode the corners matched the display.

    Come to my MX1 arriving, I have it recognised as a touch screen but it is rotated 90 degrees and hence unusable. I believe this is to do with the fact that the Nexus 7 "default" rotation is portrait. The MX1 this is landscape.

    I tried messing with the build.prop entries:

    ro.sf.fakerotation
    ro.sf.hwrotation

    I actually managed to get the display to be in portrait mode by setting the hwrotation to 0 and the touchscreen matched the display. Te screen is going to be mounted (hopefully lol) in a car in landscape mode. Any rotation app i downloaded had no effect.

    Any ideas what I can do. I have read around and people are modifying the driver in the kernel etc which is a bit out of my league and i understand the kernel can't be recompiled anyway on the mx1 right now?

    Any help would be appreciated. Love the ROM and MX1 so far thanks finless.

    I am on MX1 Finless 1.5

    #2
    The reason is there is no real touch screen support in the kernel. Your touch screen is only acting like a USB input device (like a mouse). Real touch screens are not USB input devices. So when rotation happens it does not recalculate this for the USB input device. All the code that is in a tablet for instance does this for a real touch screen.

    I have figured out how to turn rotation back on in services.jar but not hook rotation to a USB input device. So it's going to take a lot of work in the kernel to make this work again.

    Bob
    "Pzebacz im, bo nie wiedzą, co czynią"
    "Прости им, они не ведают, что творят"
    "Perdona loro perché non sanno quello che fanno"
    "Vergib ihnen, denn sie wissen nicht, was sie tun"
    "Vergeef hen want ze weten niet wat ze doen"
    "Pardonne-leur car ils ne savent pas ce qu'ils font"
    "Perdónalos porque no saben que lo que hacen"
    "Oprosti im, jer ne znaju što čine"
    "Forgive them as they know not what they do"





    Comment


      #3


      does this help any? how can i get this into the MX1 kernel? thanks!

      Comment


        #4
        Re: Rotation for USB touchscreen?

        Originally posted by Finless View Post

        I have figured out how to turn rotation back on in services.jar but not hook rotation to a USB input device. So it's going to take a lot of work in the kernel to make this work again.

        Bob
        Hi Bob, I hope this isn't a hijack. I own a pioneer appradio 2 which uses hdmi for audio and video and bluetooth touch events for the screen mirroring my phone's display through an app called arliberator. I wish to have my ug007 (which has your wonderful 1.5 mx1 rom) to be in portrait mode for this purpose since the xy coordinates are reversed. Is this closer to what you were describing above? Again, my apologies if I'm changing the subject too much.

        Sent from my Android using Tapatalk 2

        Comment


          #5
          To make roatation on my MX1 1.5 ROM.

          Edit build.prop

          ro.sf.hwrotation=270

          change the 270 to 90, 180, or 0 and see if that works for you.

          Bob
          "Pzebacz im, bo nie wiedzą, co czynią"
          "Прости им, они не ведают, что творят"
          "Perdona loro perché non sanno quello che fanno"
          "Vergib ihnen, denn sie wissen nicht, was sie tun"
          "Vergeef hen want ze weten niet wat ze doen"
          "Pardonne-leur car ils ne savent pas ce qu'ils font"
          "Perdónalos porque no saben que lo que hacen"
          "Oprosti im, jer ne znaju što čine"
          "Forgive them as they know not what they do"





          Comment


            #6
            Managed to get this working today!

            I compiled the kernel from AndrewDB using the rk30_hotdog_ti config and patched in that code from the google groups. I will never have another touchscreen connected but I modified the code slightly so it only affects the eGalax (Lilliput 669) touchscreen.

            Downside is I lost my on-board bluetooth and wifi. Ok for now but ordered an MK802III that I should be able to mod the kernel on without losing anything.

            I actually can't hook the screen up yet as I need the special HDMI/USB cable which arrives tomorrow. Using my monitor I can already see that the edge of the touchscreen (even with a screwdriver edge) does not put the pointer at the edge of the android screen, making it hard to use the navigation bar. This is gonna be another problem but can maybe do some scaling/offset in the kernel driver where this little hack went in.

            I hooked up a couple of USB DACs to the MX1 (actually an MX2), an HRT MusicStreamer II which freezes the OS after 15 seconds or so (shame, nice DAC), and an Asus Xonar U3. This worked right out of the box but I'm not entirely happy with the performance. It sounds fine but I get the occasional artefact. Need to investigate if this is because of the DAC, the stick, or the storage (was playing it from memory card) or the app (poweramp, i'll download a couple of others).

            Cheers

            ./drivers/hid/hid-input.c:
            //patch for eGalax touchscreen: swap X and Y, invert X direction
            if ((usage->type == EV_ABS) && (hid->vendor == 0x0eef) && (hid->product == 0x0001))
            {
            if (usage->hid == HID_GD_X) {
            usage->code = 1; // vs 0 (X becomes Y)
            value = 4095 - value;
            } else if (usage->hid == HID_GD_Y) {
            usage->code = 0; // vs 1 (Y becomes X)
            }
            }

            see google groups link above for position in code

            Comment


              #7
              @Finless

              Originally posted by Finless View Post
              To make roatation on my MX1 1.5 ROM.
              Edit build.prop
              ro.sf.hwrotation=270
              change the 270 to 90, 180, or 0 and see if that works for you.
              Bob
              I can confirm this does not help in the MX1. It rotates both the screen UI and the touch axis as a whole. So basically ro.sf.hwrotation=90 makes the screen upside down and the touch axis still inverted.
              (nice try tho, first I saw that suggestion in 2 days of googling)

              Every where I read the fix has to be built into the kernel. Could you possibly incorporate this fix into your next builds of the MX1 and UG802 firmwares?

              I think these links might be of help:

              - Working using Finless 1.6 for the UG802
              http://www.geekbuying.com/item/MK808-Dual-Core-Android-4-1-Jelly-Bean-TV-BOX-Rockchip-RK3066-Cortex-A9-Mini-PC-stick-307415.html What everyone think? Anybody took the leap and bought it yet? I was thinking about getting one so I don't have to...


              - Expanded from above that is supposed to cover all versions of the 0eef:0001 controller


              - Same link from Daveman reposted for easy access



              And as always, thank you for spending your time to make everyone's life easier.

              Comment


                #8
                Ok so I'm very new to android but I'm digging around as much as I can to try to figure this out.

                I finally got my device to load with its .idc file, and I noticed in my dumpsys there is a " SurfaceOrientation " thats set to 0 even though our ro.sf.hwrotation = 270. I could not get any setting in the .idc to change this SurfaceOrientation. Where does it come from? Is there any way to change this?

                Even if we do still need to patch the kernel like above, it should be much easier to change a 0 to a 270? Any way we can accomplish this in a hex editor?

                Below is my dumpsys relative to the touchscreen in question


                Code:
                    3: eGalax Inc. USB TouchController
                      Classes: 0x80000004
                      Path: /dev/input/event3
                      Descriptor: cddc04d4892194263bfe7aec89b063fd65abb0ca
                      Location: usb-usb20_host-1.1/input0
                      UniqueId: 
                      Identifier: bus=0x0003, vendor=0x0eef, product=0x0001, version=0x0210
                      KeyLayoutFile: 
                      KeyCharacterMapFile: 
                      ConfigurationFile: 
                      HaveKeyboardLayoutOverlay: false
                 
                
                  Device 3: eGalax Inc. USB TouchController
                    Generation: 18
                    IsExternal: true
                    Sources: 0x00006002
                    KeyboardType: 0
                    Motion Ranges:
                      X: source=0x00006002, min=0.000, max=1279.681, flat=0.000, fuzz=0.319
                      Y: source=0x00006002, min=0.000, max=719.819, flat=0.000, fuzz=0.181
                      PRESSURE: source=0x00006002, min=0.000, max=1.000, flat=0.000, fuzz=0.000
                    Touch Input Mapper:
                      Parameters:
                        GestureMode: spots
                        DeviceType: pointer
                        AssociatedDisplay: id=0, isExternal=false
                        OrientationAware: false
                      Raw Touch Axes:
                        X: min=30, max=4040, flat=0, fuzz=0, resolution=0
                        Y: min=60, max=4035, flat=0, fuzz=0, resolution=0
                        Pressure: unknown range
                        TouchMajor: unknown range
                        TouchMinor: unknown range
                        ToolMajor: unknown range
                        ToolMinor: unknown range
                        Orientation: unknown range
                        Distance: unknown range
                        TiltX: unknown range
                        TiltY: unknown range
                        TrackingId: unknown range
                        Slot: unknown range
                      Calibration:
                        touch.size.calibration: none
                        touch.pressure.calibration: none
                        touch.orientation.calibration: none
                        touch.distance.calibration: none
                      SurfaceWidth: 1280px
                      SurfaceHeight: 720px
                      SurfaceOrientation: 0       <--------------------|
                      Translation and Scaling Factors:
                        XScale: 0.319
                        YScale: 0.181
                        XPrecision: 3.134
                        YPrecision: 5.522
                        GeometricScale: 0.250
                        PressureScale: 0.000
                        SizeScale: 0.000
                        OrientationCenter: 0.000
                        OrientationScale: 0.000
                        DistanceScale: 0.000
                        HaveTilt: false
                        TiltXCenter: 0.000
                        TiltXScale: 0.000
                        TiltYCenter: 0.000
                        TiltYScale: 0.000
                      Last Button State: 0x00000000
                      Last Raw Touch: pointerCount=0
                      Last Cooked Touch: pointerCount=0
                      Pointer Gesture Detector:
                        XMovementScale: 0.208
                        YMovementScale: 0.208
                        XZoomScale: 0.078
                        YZoomScale: 0.078
                        MaxSwipeWidth: 1411.928955

                Comment


                  #9
                  I fixed rotation for a Company I was making a ROM for. The code is in services.jar and the code is in WindowManagerService.smali

                  Best tip I can give you.

                  Now, I did this the other day. I took my Yuandao N101 4.1.1 ROM and flashed it along with the Imito kernel. It worked and acted like a tablet. The mouse works like on a tablet not a TV stick. e.g. the right mouse button does not function the same.

                  So to see if this is in the kernel (which I doubt), try this test. Download my N101 ROM and flash it with the imito kernel.img. Do the same changes you did for adding your touch screen.

                  We can go from there if it works for your touch screen.

                  Bob
                  "Pzebacz im, bo nie wiedzą, co czynią"
                  "Прости им, они не ведают, что творят"
                  "Perdona loro perché non sanno quello che fanno"
                  "Vergib ihnen, denn sie wissen nicht, was sie tun"
                  "Vergeef hen want ze weten niet wat ze doen"
                  "Pardonne-leur car ils ne savent pas ce qu'ils font"
                  "Perdónalos porque no saben que lo que hacen"
                  "Oprosti im, jer ne znaju što čine"
                  "Forgive them as they know not what they do"





                  Comment


                    #10
                    Cool. But forgive my ignorance...

                    the Yuandao NEW - N101-1 Finless ROM 1.8 Jellybean - CWM, Init.d one? Or should i use the 2 model?

                    I see that one has a recovery.img and a recovery1.img. Do I need both or which one?

                    Should i be using the Yuandao ROM tool with both recovery img or the iMito ROM tool with just 1?

                    I imagine it using
                    iMito - ROM Flash Tool
                    Yuandao - boot.img
                    iMito - kernel720.img
                    Yuandao - misc.img
                    Yuandao - recovery.img
                    Yuandao - system.img

                    Would this be correct?

                    Comment


                      #11
                      Just take my N101 1.8 ROM and put the kernel.img from your TV stick into the FinlessROM folder replacing the kernel.img in there. Flash the N101 ROM as setup in the flash tool. If you have problems with the ClockWork mod (recovery.img) then also flash your TV stick recovery instead of the one I have in the N101 ROm kit.

                      Bob
                      "Pzebacz im, bo nie wiedzą, co czynią"
                      "Прости им, они не ведают, что творят"
                      "Perdona loro perché non sanno quello che fanno"
                      "Vergib ihnen, denn sie wissen nicht, was sie tun"
                      "Vergeef hen want ze weten niet wat ze doen"
                      "Pardonne-leur car ils ne savent pas ce qu'ils font"
                      "Perdónalos porque no saben que lo que hacen"
                      "Oprosti im, jer ne znaju što čine"
                      "Forgive them as they know not what they do"





                      Comment


                        #12
                        Nope, No go. I flashed it with the N101 1.8 ROM like you said and the touch reacted the same way.

                        I believe its because the eGalax Touch is being recognized as a usbhid mouse/trackpad device as opposed to a true touchscreen. You dont reorient your mouse or trackpad if you rotate your screen, forward is still forward independant of screen orientation. As a result the touch stays at 0 regardless of the hwrotation setting.

                        In addition, I managed to crack open services.jar and drilled down to WindowManagerService.smali but I'm not sure that's the right direction because of the type of device its being detected as. Possibly something inside of android/server /USB or /Input?

                        I think the end game is either to try to port some driver (they make an ARM Linux version) or to figure out a way to force rotation of a single input device (else my Etsy mouse/keyboard wont work ever again.

                        Thanks for the help thus far Finless, but I think I may be stuck.

                        Comment


                          #13
                          I think you are correct. A real touch screen is not implemented as a USB input device! So yes I think the problem is, it is being looked at as a mouse.

                          Now I have never dived into this but I think this could be changed. A prime example. On a tablet the right mouse button does not operate the same as on a TV stick. e.g. the back button. I think this is all implemented in input.jar in /framework. I have not looked into this much but I think with some work and re-engineering, it can be made to work. Problem is this could take a lot of effort to figure out by taking things apart to find the code.

                          Bob
                          "Pzebacz im, bo nie wiedzą, co czynią"
                          "Прости им, они не ведают, что творят"
                          "Perdona loro perché non sanno quello che fanno"
                          "Vergib ihnen, denn sie wissen nicht, was sie tun"
                          "Vergeef hen want ze weten niet wat ze doen"
                          "Pardonne-leur car ils ne savent pas ce qu'ils font"
                          "Perdónalos porque no saben que lo que hacen"
                          "Oprosti im, jer ne znaju što čine"
                          "Forgive them as they know not what they do"





                          Comment


                            #14
                            Rotation for USB touchscreen? Patch?

                            Hi Bob,

                            I also get the same problem.. Maybe this patch can be implemented in your firmware?

                            Diese Website steht zum Verkauf! digipedia.org ist die beste Quelle für alle Informationen die Sie suchen. Von allgemeinen Themen bis hin zu speziellen Sachverhalten, finden Sie auf digipedia.org alles. Wir hoffen, dass Sie hier das Gesuchte finden!


                            Did you think possible?

                            Ben

                            Comment

                            Working...
                            X