Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: failed to upload device info: Invalid argument. #30

Open
twaik opened this issue Sep 10, 2023 · 5 comments
Open

error: failed to upload device info: Invalid argument. #30

twaik opened this issue Sep 10, 2023 · 5 comments

Comments

@twaik
Copy link

twaik commented Sep 10, 2023

Hi. I've configured netevent for Android with this build script

cmake_minimum_required(VERSION 3.24)
project(netevent)

set(CMAKE_CXX_STANDARD 20)

add_executable(netevent src/main.cpp src/reader.cpp src/writer.cpp src/socket.cpp src/bitfield.cpp src/daemon.cpp)
target_compile_options(netevent PRIVATE "-DNETEVENT_VERSION=\"2.2.1\"" "-static")
target_link_options(netevent PRIVATE "-static")

And compiled it with this script

#!/bin/sh
ABI=arm64-v8a
NDK=/home/twaik/Android/Sdk/ndk/25.1.8937393
mkdir -p $ABI
touch ./src/config.h
cmake -H$ABI -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=26 -DANDROID_PLATFORM=android-26 -DANDROID_ABI=$ABI \
      -DCMAKE_ANDROID_ARCH_ABI=$ABI -DANDROID_NDK=$NDK -DCMAKE_ANDROID_NDK=$NDK -DCMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake \
      -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$ABI -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$ABI -DCMAKE_BUILD_TYPE=Debug -B$ABI -GNinja -S.

I know, this code is pretty rude and straightforward but it works.

I used this command to instantiate device's touchscreen as a touchpad.

/data/local/tmp/netevent cat /dev/input/event4 | /data/local/tmp/netevent create

It works fine on Samsung SM_A042F, but fails to run on Samsung SM_G780F with the following error:

error: failed to upload device info: Invalid argument

I do not know if there is a debug mode so I extracted everything I could.

twaik@twaikpc:~$ adb -s RZ8R129GXAA shell /data/local/tmp/netevent show /dev/input/event2
KEY:143:1
SYN:0:0
KEY:143:0
SYN:0:0
ABS:57:30397
ABS:48:3
ABS:50:3
ABS:53:697
ABS:54:1291
KEY:330:1

twaik@twaikpc:~$ adb -s RZ8R129GXAA shell /data/local/tmp/netevent cat /dev/input/event2 | hexdump
0000000 0400 0200 454e 4832 6c65 6f6c 0000 0000
0000010 0000 0000 0000 0000 0000 0000 0100 0000
0000020 5c04 5000 0000 0000 0000 0000 0000 0000
0000030 0000 0000 0000 0000 6573 5f63 6f74 6375
0000040 7368 7263 6565 006e 0000 0000 0000 0000
0000050 0000 0000 0000 0000 0000 0000 0000 0000
*
0000080 0000 0000 0000 0000 1800 0000 0000 0000
0000090 1f00 000b 0002 0003 0000 0000 0000 0000
00000a0 0000 0000 0000 0000 8000 0000 0000 0000
00000b0 0000 0000 0000 0000 0000 0000 0000 0000
00000c0 0400 0000 0000 0000 0000 0000 0000 0000
00000d0 0080 0000 0000 0000 0000 0000 0000 0000
00000e0 0000 0000 0000 0000 0000 0000 0000 4000
00000f0 0000 0000 0000 0000 4000 0003 0000 8000
0000100 4267 4000 0100 0000 0000 0000 0000 0000
0000110 0000 0000 0000 3704 0000 0000 0000 0000
0000120 0000 0000 0000 0000 0000 0000 0000 5f09
0000130 0000 0000 0000 0000 0000 0000 0000 0000
0000140 0000 0000 0000 0900 0000 0000 0000 0000
0000150 0000 0000 0000 0000 0000 0000 0000 ff00
0000160 0000 0000 0000 0000 0000 0000 0000 0000
0000170 0000 0000 0000 ff00 0000 0000 0000 0000
0000180 0000 0000 0000 0000 0000 0000 0000 ff00
0000190 0000 0000 0000 0000 0000 0000 0000 0000
00001a0 0000 0000 0000 3704 0000 0000 0000 0000
00001b0 0000 0000 0000 0000 0000 0000 0000 5f09
00001c0 0000 0000 0000 0000 0000 0000 0000 0000
00001d0 0000 0000 0000 ffff 0000 0000 0000 0000
00001e0 0000 0000 0000 0000 0000 0000 ffff ffff
00001f0 0000 0000 0000 0000 0000 0000 0000 0000
@twaik
Copy link
Author

twaik commented Sep 10, 2023

In the case if I am building netevent with HAS_UI_DEV_SETUP flag I am getting the following error:

error: failed to setup device axis information: Invalid argument

@twaik
Copy link
Author

twaik commented Sep 10, 2023

Interesting thing. When I am trying to pass touchscreen of other devices to this device it actually works.

@Blub
Copy link
Owner

Blub commented Sep 21, 2023

I don't really have the time or energy to dig into android related things, android tends to just suck the fun out of everything with its anti-consumer culture of malpractice app development with anti-consumer "safety nets" and what not...

The error might perhaps indicate that the touch screen you cannot clone may have some capability that's not fully supported either by uinput, or netevent lacks some more/newer bits/capabilities to make it work, the setup doesn't have 100% coverage with respect to device capabilities.

@twaik
Copy link
Author

twaik commented Sep 21, 2023

Are there some tests that I can perform? Touchscreen can be passed to my kubuntu 23.04 desktop, but fails to be passed to other Android devices.

@twaik
Copy link
Author

twaik commented Sep 21, 2023

Can you please make some debug output for this to check what parameter is failed to be passed to kernel?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants