openstf / minitouch

Minimal multitouch event producer for Android.
Other
639 stars 236 forks source link

SO-03L has two same resolution event device #45

Closed huanglizhuo closed 5 years ago

huanglizhuo commented 5 years ago

Hi there, first thank you so much make this great tool.

when use SO-03L, this device has a side detect function, if we run adb shell getevent , we will see the event4(sec_touchscreen_side) and event3(sec_touchscreen)

add device 1: /dev/input/event8
  name:     "sm8150-tavil-snd-card Button Jack"
add device 2: /dev/input/event7
  name:     "sm8150-tavil-snd-card Headset Jack"
add device 3: /dev/input/event6
  name:     "AMS TCS3490 Sensor"
add device 4: /dev/input/event5
  name:     "bu520x1nvx"
add device 5: /dev/input/event4
  name:     "sec_touchscreen_side"
add device 6: /dev/input/event3
  name:     "sec_touchscreen"
add device 7: /dev/input/event2
  name:     "gpio-keys"
add device 8: /dev/input/event1
  name:     "SOMC Charger Removal"
add device 9: /dev/input/event0
  name:     "qpnp_pon"

and those two event has the same resolution, the autodetection method will get same score for those two screen, it will chose the event4 which is the wrong one.

Currently I add config for openstf when starting minitouch on SO-03L add extra cmd '-d /dev/input/event3', and it works.

any suggestion that we can do to about the autodetection method ? have anyone ever meet a device that has more than one event device that has same score?

issue-label-bot[bot] commented 5 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.64. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

sorccu commented 5 years ago

Run getevent -ilp (or -elp?) and paste the output here. It should show the attributes for all devices. Perhaps there is something usable in there.

huanglizhuo commented 5 years ago

here is the result

event3 and event4 has different on 003e, one is value 126 one is value 0

SO-03L:/ $ getevent -ilp
add device 1: /dev/input/event8
  bus:      0000
  vendor    0000
  product   0000
  version   0000
  name:     "sm8150-tavil-snd-card Button Jack"
  location: "ALSA"
  id:       ""
  version:  1.0.1
  events:
    KEY (0001): KEY_VOLUMEDOWN        KEY_VOLUMEUP          KEY_MEDIA             BTN_4
                BTN_5                 KEY_VOICECOMMAND
  input props:
    <none>
add device 2: /dev/input/event7
  bus:      0000
  vendor    0000
  product   0000
  version   0000
  name:     "sm8150-tavil-snd-card Headset Jack"
  location: "ALSA"
  id:       ""
  version:  1.0.1
  events:
    SW  (0005): SW_HEADPHONE_INSERT   SW_MICROPHONE_INSERT  SW_LINEOUT_INSERT     SW_JACK_PHYSICAL_INS
                0010                  0011                  0012                  0013
  input props:
    <none>
add device 3: /dev/input/event6
  bus:      0000
  vendor    0000
  product   0000
  version   0000
  name:     "AMS TCS3490 Sensor"
  location: ""
  id:       ""
  version:  1.0.1
  events:
    ABS (0003): ABS_MISC              : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
  input props:
    <none>
add device 4: /dev/input/event5
  bus:      0000
  vendor    0000
  product   0000
  version   0000
  name:     "bu520x1nvx"
  location: ""
  id:       ""
  version:  1.0.1
  events:
    SW  (0005): SW_LID
  input props:
    <none>
add device 5: /dev/input/event4
  bus:      0018
  vendor    0000
  product   0000
  version   0000
  name:     "sec_touchscreen_side"
  location: "sec_touchscreen_side/input1"
  id:       ""
  version:  1.0.1
  events:
    KEY (0001): KEY_POWER             KEY_HOMEPAGE          BTN_TOOL_FINGER       BTN_TOUCH
                01c7
    ABS (0003): ABS_X                 : value 0, min 0, max 1643, fuzz 0, flat 0, resolution 0
                ABS_Y                 : value 0, min 0, max 3839, fuzz 0, flat 0, resolution 0
                ABS_PRESSURE          : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
                ABS_MT_SLOT           : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
                ABS_MT_TOUCH_MAJOR    : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
                ABS_MT_TOUCH_MINOR    : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
                ABS_MT_POSITION_X     : value 0, min 0, max 1643, fuzz 0, flat 0, resolution 0
                ABS_MT_POSITION_Y     : value 0, min 0, max 3839, fuzz 0, flat 0, resolution 0
                ABS_MT_TRACKING_ID    : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
                ABS_MT_PRESSURE       : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
                003e                  : value 0, min 0, max -1, fuzz 0, flat 0, resolution 0
    SW  (0005): SW_PEN_INSERTED
  input props:
    INPUT_PROP_DIRECT
add device 6: /dev/input/event3
  bus:      0018
  vendor    0000
  product   0000
  version   0000
  name:     "sec_touchscreen"
  location: "sec_touchscreen_side/input1"
  id:       ""
  version:  1.0.1
  events:
    KEY (0001): KEY_POWER             KEY_HOMEPAGE          BTN_TOOL_FINGER       BTN_TOUCH
                01c7
    ABS (0003): ABS_X                 : value 0, min 0, max 1643, fuzz 0, flat 0, resolution 0
                ABS_Y                 : value 0, min 0, max 3839, fuzz 0, flat 0, resolution 0
                ABS_PRESSURE          : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
                ABS_MT_SLOT           : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
                ABS_MT_TOUCH_MAJOR    : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
                ABS_MT_TOUCH_MINOR    : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
                ABS_MT_POSITION_X     : value 0, min 0, max 1643, fuzz 0, flat 0, resolution 0
                ABS_MT_POSITION_Y     : value 0, min 0, max 3839, fuzz 0, flat 0, resolution 0
                ABS_MT_TRACKING_ID    : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
                ABS_MT_PRESSURE       : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
                003e                  : value 126, min 0, max -1, fuzz 0, flat 0, resolution 0
    SW  (0005): SW_PEN_INSERTED
  input props:
    INPUT_PROP_DIRECT
add device 7: /dev/input/event2
  bus:      0019
  vendor    0001
  product   0001
  version   0100
  name:     "gpio-keys"
  location: "gpio-keys/input0"
  id:       ""
  version:  1.0.1
  events:
    KEY (0001): KEY_VOLUMEDOWN        KEY_CAMERA_FOCUS      02fe
  input props:
    <none>
add device 8: /dev/input/event1
  bus:      0000
  vendor    0000
  product   0000
  version   0000
  name:     "SOMC Charger Removal"
  location: ""
  id:       ""
  version:  1.0.1
  events:
    KEY (0001): KEY_F24
  input props:
    <none>
add device 9: /dev/input/event0
  bus:      0000
  vendor    0000
  product   0000
  version   0000
  name:     "qpnp_pon"
  location: "qpnp_pon/input0"
  id:       ""
  version:  1.0.1
  events:
    KEY (0001): KEY_VOLUMEUP          KEY_POWER
  input props:
    <none>
sorccu commented 5 years ago

Maybe we could decrease the score by 1 if “side” appears in the device name.

sorccu commented 5 years ago

Maybe add it here? https://github.com/openstf/minitouch/blob/9e742e964465b67a800f371aee27e940726577a0/jni/minitouch/minitouch.c#L156

Possibly “_side” may be a safer thing to match though.

huanglizhuo commented 5 years ago

thanks, sound safe, let me test it and create PR