Closed hossain-khan closed 4 years ago
Can you run adb -s emulator-5556 shell getevent -p
and paste that output? It contains the input device mapping on the second emulator. Right now touch is being mapped to input10 but that doesn't appear to be the right device.
EDIT: Sorry, I did close the emulators, and just reopened them to get this data. Do I need to run the ./adb-event-mirror.main.kts
command again with --debug
?
➜ adb-event-mirror git:(trunk) adb -s emulator-5556 shell getevent -p
add device 1: /dev/input/event10
name: "virtio_input_multi_touch_9"
events:
ABS (0003): 0000 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0001 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0002 : value 0, min 0, max 1, fuzz 0, flat 0, resolution 0
002f : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
0030 : value 0, min 0, max 2147483647, fuzz 0, flat 0, resolution 0
0035 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0036 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0039 : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
003a : value 0, min 0, max 256, fuzz 0, flat 0, resolution 0
SW (0005): 0000
input props:
<none>
add device 2: /dev/input/event0
name: "Power Button"
events:
KEY (0001): 0074
input props:
<none>
add device 3: /dev/input/event8
name: "virtio_input_multi_touch_7"
events:
ABS (0003): 0000 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0001 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0002 : value 0, min 0, max 1, fuzz 0, flat 0, resolution 0
002f : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
0030 : value 0, min 0, max 2147483647, fuzz 0, flat 0, resolution 0
0035 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0036 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0039 : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
003a : value 0, min 0, max 256, fuzz 0, flat 0, resolution 0
SW (0005): 0000
input props:
<none>
add device 4: /dev/input/event11
name: "virtio_input_multi_touch_10"
events:
ABS (0003): 0000 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0001 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0002 : value 0, min 0, max 1, fuzz 0, flat 0, resolution 0
002f : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
0030 : value 0, min 0, max 2147483647, fuzz 0, flat 0, resolution 0
0035 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0036 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0039 : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
003a : value 0, min 0, max 256, fuzz 0, flat 0, resolution 0
SW (0005): 0000
input props:
<none>
add device 5: /dev/input/event5
name: "virtio_input_multi_touch_4"
events:
ABS (0003): 0000 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0001 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0002 : value 0, min 0, max 1, fuzz 0, flat 0, resolution 0
002f : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
0030 : value 0, min 0, max 2147483647, fuzz 0, flat 0, resolution 0
0035 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0036 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0039 : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
003a : value 0, min 0, max 256, fuzz 0, flat 0, resolution 0
SW (0005): 0000
input props:
<none>
add device 6: /dev/input/event2
name: "virtio_input_multi_touch_1"
events:
ABS (0003): 0000 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0001 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0002 : value 0, min 0, max 1, fuzz 0, flat 0, resolution 0
002f : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
0030 : value 0, min 0, max 2147483647, fuzz 0, flat 0, resolution 0
0035 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0036 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0039 : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
003a : value 0, min 0, max 256, fuzz 0, flat 0, resolution 0
SW (0005): 0000
input props:
<none>
add device 7: /dev/input/event12
name: "virtio_input_multi_touch_11"
events:
ABS (0003): 0000 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0001 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0002 : value 0, min 0, max 1, fuzz 0, flat 0, resolution 0
002f : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
0030 : value 0, min 0, max 2147483647, fuzz 0, flat 0, resolution 0
0035 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0036 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0039 : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
003a : value 0, min 0, max 256, fuzz 0, flat 0, resolution 0
SW (0005): 0000
input props:
<none>
add device 8: /dev/input/event13
name: "qwerty2"
events:
KEY (0001): 0001 0002 0003 0004 0005 0006 0007 0008
0009 000a 000b 000c 000d 000e 000f 0010
0011 0012 0013 0014 0015 0016 0017 0018
0019 001a 001b 001c 001d 001e 001f 0020
0021 0022 0023 0024 0025 0026 0027 0028
0029 002a 002b 002c 002d 002e 002f 0030
0031 0032 0033 0034 0035 0036 0037 0038
0039 003a 003b 003c 003d 003e 003f 0040
0041 0042 0043 0044 0045 0046 0047 0048
0049 004a 004b 004c 004d 004e 004f 0050
0051 0052 0053 0056 0057 0058 0059 005b
005c 0060 0061 0062 0063 0064 0065 0066
0067 0068 0069 006a 006b 006c 006d 006e
006f 0071 0072 0073 0074 0075 0077 0079
007c 007d 007e 007f 0080 0081 0082 0083
0084 0085 0086 0087 0088 0089 008a 008b
008c 008e 008f 009b 009c 009d 009e 009f
00a3 00a4 00a5 00a6 00ac 00ad 00d9 00e2
00e5 00e6 00e7 018f 0244 0245 0246 0247
0248
LED (0011): 0000 0001 0002
input props:
<none>
add device 9: /dev/input/event6
name: "virtio_input_multi_touch_5"
events:
ABS (0003): 0000 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0001 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0002 : value 0, min 0, max 1, fuzz 0, flat 0, resolution 0
002f : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
0030 : value 0, min 0, max 2147483647, fuzz 0, flat 0, resolution 0
0035 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0036 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0039 : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
003a : value 0, min 0, max 256, fuzz 0, flat 0, resolution 0
SW (0005): 0000
input props:
<none>
add device 10: /dev/input/event3
name: "virtio_input_multi_touch_2"
events:
ABS (0003): 0000 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0001 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0002 : value 0, min 0, max 1, fuzz 0, flat 0, resolution 0
002f : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
0030 : value 0, min 0, max 2147483647, fuzz 0, flat 0, resolution 0
0035 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0036 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0039 : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
003a : value 0, min 0, max 256, fuzz 0, flat 0, resolution 0
SW (0005): 0000
input props:
<none>
add device 11: /dev/input/event1
name: "AT Translated Set 2 keyboard"
events:
KEY (0001): 0001 0002 0003 0004 0005 0006 0007 0008
0009 000a 000b 000c 000d 000e 000f 0010
0011 0012 0013 0014 0015 0016 0017 0018
0019 001a 001b 001c 001d 001e 001f 0020
0021 0022 0023 0024 0025 0026 0027 0028
0029 002a 002b 002c 002d 002e 002f 0030
0031 0032 0033 0034 0035 0036 0037 0038
0039 003a 003b 003c 003d 003e 003f 0040
0041 0042 0043 0044 0045 0046 0047 0048
0049 004a 004b 004c 004d 004e 004f 0050
0051 0052 0053 0055 0056 0057 0058 0059
005a 005b 005c 005d 005e 005f 0060 0061
0062 0063 0064 0066 0067 0068 0069 006a
006b 006c 006d 006e 006f 0070 0071 0072
0073 0074 0075 0076 0077 0079 007a 007b
007c 007d 007e 007f 0080 008c 008e 008f
009b 009c 009d 009e 009f 00a3 00a4 00a5
00a6 00ac 00ad 00b7 00b8 00b9 00d9 00e2
MSC (0004): 0004
LED (0011): 0000 0001 0002
input props:
<none>
add device 12: /dev/input/event7
name: "virtio_input_multi_touch_6"
events:
ABS (0003): 0000 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0001 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0002 : value 0, min 0, max 1, fuzz 0, flat 0, resolution 0
002f : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
0030 : value 0, min 0, max 2147483647, fuzz 0, flat 0, resolution 0
0035 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0036 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0039 : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
003a : value 0, min 0, max 256, fuzz 0, flat 0, resolution 0
SW (0005): 0000
input props:
<none>
add device 13: /dev/input/event4
name: "virtio_input_multi_touch_3"
events:
ABS (0003): 0000 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0001 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0002 : value 0, min 0, max 1, fuzz 0, flat 0, resolution 0
002f : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
0030 : value 0, min 0, max 2147483647, fuzz 0, flat 0, resolution 0
0035 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0036 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0039 : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
003a : value 0, min 0, max 256, fuzz 0, flat 0, resolution 0
SW (0005): 0000
input props:
<none>
add device 14: /dev/input/event9
name: "virtio_input_multi_touch_8"
events:
ABS (0003): 0000 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0001 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0002 : value 0, min 0, max 1, fuzz 0, flat 0, resolution 0
002f : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
0030 : value 0, min 0, max 2147483647, fuzz 0, flat 0, resolution 0
0035 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0036 : value 0, min 0, max 32767, fuzz 0, flat 0, resolution 0
0039 : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
003a : value 0, min 0, max 256, fuzz 0, flat 0, resolution 0
SW (0005): 0000
input props:
<none>
Ah okay it's a logic problem. Thanks. Will fix tomorrow.
Sounds great! Thanks 👍
And in case I'm dumb and don't spot the problem again tomorrow:
The problem is we're comparing "event10" and "event8" lexicographically which means "event10" incorrectly sorts lower than "event8" but we want the lowest numeric value, not which sorts lowest in string form.
Ok I have the fix, but I'm going to try to land testing first so I can script up a bunch of test cases to prevent regression.
I retried the script with latest update, however I still have same result as before. Sorry, if you are in the process of releasing new version with additional instruction that I may have missed.
Here is my AVD list
➜ adb-event-mirror git:(trunk) emulator -list-avds
Android_TV_1080p_API_28
Android_TV_1080p_API_Q
Nexus_4_API_25_Slow
Nexus_5X_API_25
Nexus_5_API_23
Nexus_5_API_25_Slow_Network
Nexus_5_API_29
Nexus_9_API_25
Pixel_2_API_29
Pixel_2_XL_API_29
Pixel_3_API_30 <<------------ emulator-5554
Pixel_3_API_30_Mirror <<----- emulator-5556
Pixel_3_XL_API_R
Pixel_API_25
Here are relevant logs taken with latest update
Let me know if there are some changes in command that should be used to execute. Thanks 🙏
Out of curiosity I created another set of emulators. I already had Nexus_5_API_23
so I created Nexus_5_API_23_Mirror
and it worked. ✅
I am not sure what is wrong with Pixel_3_API_30*
emulators. ~Is it the position?~
Here is my updated AVD list.
➜ adb-event-mirror git:(trunk) emulator -list-avds
Android_TV_1080p_API_28
Android_TV_1080p_API_Q
Nexus_4_API_25_Slow
Nexus_5X_API_25
Nexus_5_API_23
Nexus_5_API_23_Mirror
Nexus_5_API_25_Slow_Network
Nexus_5_API_29
Nexus_9_API_25
Pixel_2_API_29
Pixel_2_XL_API_29
Pixel_3_API_30
Pixel_3_API_30_Mirror
Pixel_3_XL_API_R
Pixel_API_25
UPDATE: I have created another set of emulators Pixel_2_XL_API_30*
, but this time without google play store. And it worked (even though bit slow on drags).
So, I am guessing, something is happening with "Google Play" emulators.
Env Info
Issue
Used command in the readme to run on emulators, however it did not forward the touch events.
Command Used
Debug Log
adb-event-mirror-log.txt
Screen capture