raspberry-vanilla / android_local_manifest

105 stars 48 forks source link

Touch issue in secondary display via HDMI #100

Closed mrarjun closed 2 weeks ago

mrarjun commented 3 weeks ago

Tried to connect 2 HDMI display in port 0 and 1. Touch is always going to port 1 even if touching on port 0. Not sure whether it is a correct issue to post here. But appreciate some leads to move further. @KonstaT, Do i need to add other configurations? Thanks for the support.

NOTE: adb shell input x y - process the click in display 0

adb shell dumpsys SurfaceFlinger --display-id

Display 4626896158592356608 (HWC display 0): port=0 pnpId=MPI displayName="WIMAXIT"
Display 4626896177909138945 (HWC display 1): port=1 pnpId=MPI displayName="MPI7002"

adb shell dmesg | grep -i touch

[    0.247172] usbcore: registered new interface driver usbtouchscreen
[    3.746723] hid-multitouch 0003:0484:5750.0001: input,hiddev96,hidraw0: USB HID v1.01 Device [QDtech MPI7003] on usb-xhci-hcd.0-1/input0
[    3.784347] hid-multitouch 0003:0484:5750.0002: input,hiddev97,hidraw1: USB HID v1.01 Device [QDtech MPI7003] on usb-xhci-hcd.1-1/input0

adb shell getevent -il

could not get driver version for /dev/input/mouse0, Inappropriate ioctl for device
could not get driver version for /dev/input/mice, Inappropriate ioctl for device
add device 1: /dev/input/event0
  bus:      0019
  vendor    0001
  product   0001
  version   0100
  name:     "pwr_button"
  location: "gpio-keys/input0"
  id:       ""
  version:  1.0.1
  events:
    KEY (0001): KEY_POWER            
  input props:
<none>
could not get driver version for /dev/input/mouse1, Inappropriate ioctl for device
add device 2: /dev/input/event1
  bus:      0003
  vendor    0484
  product   5750
  version   0101
  name:     "QDtech MPI7003"
  location: "usb-xhci-hcd.0-1/input0"
  id:       ""
  version:  1.0.1
  events:
    KEY (0001): BTN_TOUCH            
    ABS (0003): ABS_X                 : value 0, min 0, max 1024, fuzz 0, flat 0, resolution 0
                ABS_Y                 : value 0, min 0, max 600, fuzz 0, flat 0, resolution 0
                ABS_MT_SLOT           : value 0, min 0, max 4, fuzz 0, flat 0, resolution 0
                ABS_MT_TOUCH_MAJOR    : value 0, min 0, max 600, fuzz 0, flat 0, resolution 0
                ABS_MT_TOUCH_MINOR    : value 0, min 0, max 600, fuzz 0, flat 0, resolution 0
                ABS_MT_ORIENTATION    : value 0, min 0, max 1, fuzz 0, flat 0, resolution 0
                ABS_MT_POSITION_X     : value 0, min 0, max 1024, fuzz 0, flat 0, resolution 0
                ABS_MT_POSITION_Y     : value 0, min 0, max 600, fuzz 0, flat 0, resolution 0
                ABS_MT_TRACKING_ID    : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
    MSC (0004): MSC_TIMESTAMP        
  input props:
    INPUT_PROP_DIRECT
add device 3: /dev/input/event2
  bus:      0003
  vendor    0484
  product   5750
  version   0101
  name:     "QDtech MPI7003"
  location: "usb-xhci-hcd.1-1/input0"
  id:       ""
  version:  1.0.1
  events:
    KEY (0001): BTN_TOUCH            
    ABS (0003): ABS_X                 : value 476, min 0, max 1024, fuzz 0, flat 0, resolution 0
                ABS_Y                 : value 452, min 0, max 600, fuzz 0, flat 0, resolution 0
                ABS_MT_SLOT           : value 0, min 0, max 4, fuzz 0, flat 0, resolution 0
                ABS_MT_TOUCH_MAJOR    : value 0, min 0, max 600, fuzz 0, flat 0, resolution 0
                ABS_MT_TOUCH_MINOR    : value 0, min 0, max 600, fuzz 0, flat 0, resolution 0
                ABS_MT_ORIENTATION    : value 0, min 0, max 1, fuzz 0, flat 0, resolution 0
                ABS_MT_POSITION_X     : value 0, min 0, max 1024, fuzz 0, flat 0, resolution 0
                ABS_MT_POSITION_Y     : value 0, min 0, max 600, fuzz 0, flat 0, resolution 0
                ABS_MT_TRACKING_ID    : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
    MSC (0004): MSC_TIMESTAMP        
  input props:

https://source.android.com/docs/core/interaction/input/input-device-configuration-files - vendor/usr/idc QDtech MPI7003_usb-xhci-hcd.1-1.idc.txt QDtech MPI7003_usb-xhci-hcd.0-1.idc.txt

https://source.android.com/docs/core/display/multi_display/input-routing display_settings.xml.txt

PRODUCT_COPY_FILES += \
device/accenture/nickel_raspi5/rpi5/data/system/display_settings.xml:$(TARGET_COPY_OUT_VENDOR)/etc/display_settings.xml

Added overlay configs in AndroidRpiOverlay https://cs.android.com/android/platform/superproject/main/+/main:device/generic/car/emulator/multi-display-dynamic/overlay/frameworks/base/core/res/res/values/config.xml;l=41?q=config_perDisplayFocusEnabled&ss=android%2Fplatform%2Fsuperproject%2Fmain

https://source.android.com/docs/core/display/multi_display/recommended-practices - vendor/etc input-port-associations.xml..txt

Activity and Input dumpsys multi_display_input_dumpsys.txt multi_display_display_dumpsys.txt

KonstaT commented 2 weeks ago

I doubt it's anything related Raspberry Pi device specific hardware implementation so please refer to AOSP documentation instead.

At a quick glance I can at least tell that IDC files have wrong name which you can also see from the dumpsys that it's not used. It should be QDtech_MPI7003.idc and I can't find any note that display.port = X would do anything there.

While the device creates to input device, I think only one is used. Use getevent tool see which one generates the events and associate it with the display in input-port-associations.xml.