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

"input ... calibration_matrix" stops working after 3 call #4409

Closed
Schnilz opened this issue Aug 2, 2019 · 6 comments
Closed

"input ... calibration_matrix" stops working after 3 call #4409

Schnilz opened this issue Aug 2, 2019 · 6 comments

Comments

@Schnilz
Copy link
Contributor

Schnilz commented Aug 2, 2019

Hey,
im trying to write a small skript which flips my touchscreen for tablet mode.
im using the input command "calibration_matrix" for that which works the first 3 times and then stops working.

I have made a debug log and found out that this line is missing when the command stops working:

[sway/input/libinput.c:181] calibration_set_matrix(1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000) 

here is the rest of the relevant part:

2019-08-02 08:06:57 - [sway/ipc-server.c:154] Event on IPC listening socket
2019-08-02 08:06:57 - [sway/ipc-server.c:200] New client: fd 80
2019-08-02 08:06:57 - [sway/ipc-server.c:220] Client 80 readable
2019-08-02 08:06:57 - [sway/commands.c:250] Handling command 'input type:touch calibration_matrix "-1" 0 1 0 "-1" 1'
2019-08-02 08:06:57 - [sway/commands/input.c:69] entering input block: type:touch
2019-08-02 08:06:57 - [sway/config/input.c:15] new_input_config(type:touch)
2019-08-02 08:06:57 - [sway/commands.c:403] Subcommand: calibration_matrix -1 0 1 0 -1 1
2019-08-02 08:06:57 - [sway/config/input.c:15] new_input_config(temp)
2019-08-02 08:06:57 - [sway/config/input.c:299] Config stored for input type:touch
2019-08-02 08:06:57 - [sway/input/libinput.c:261] config_libinput_touch('type:touch' on  '1267:10009:ELAN0732:00_04F3:2719')
2019-08-02 08:06:57 - [sway/input/libinput.c:181] calibration_set_matrix(-1.000000, 0.000000, 1.000000, 0.000000, -1.000000, 1.000000)
2019-08-02 08:06:57 - [sway/input/seat.c:541] Applying input config to 1267:10009:ELAN0732:00_04F3:2719
2019-08-02 08:06:57 - [sway/ipc-server.c:937] Added IPC reply of type 0x0 to client 80 queue: [ { "success": true } ]
2019-08-02 08:06:57 - [sway/ipc-server.c:524] Client 80 writable
2019-08-02 08:06:57 - [sway/ipc-server.c:215] Client 80 hung up
2019-08-02 08:06:57 - [sway/ipc-server.c:554] IPC Client 80 disconnected
2019-08-02 08:07:04 - [sway/ipc-server.c:154] Event on IPC listening socket
2019-08-02 08:07:04 - [sway/ipc-server.c:200] New client: fd 80
2019-08-02 08:07:04 - [sway/ipc-server.c:220] Client 80 readable
2019-08-02 08:07:04 - [sway/commands.c:250] Handling command 'input type:touch calibration_matrix 1 0 0 0 1 0'
2019-08-02 08:07:04 - [sway/commands/input.c:69] entering input block: type:touch
2019-08-02 08:07:04 - [sway/config/input.c:15] new_input_config(type:touch)
2019-08-02 08:07:04 - [sway/commands.c:403] Subcommand: calibration_matrix 1 0 0 0 1 0
2019-08-02 08:07:04 - [sway/config/input.c:15] new_input_config(temp)
2019-08-02 08:07:04 - [sway/config/input.c:299] Config stored for input type:touch
2019-08-02 08:07:04 - [sway/input/libinput.c:261] config_libinput_touch('type:touch' on  '1267:10009:ELAN0732:00_04F3:2719')
2019-08-02 08:07:04 - [sway/input/libinput.c:181] calibration_set_matrix(1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
2019-08-02 08:07:04 - [sway/input/seat.c:541] Applying input config to 1267:10009:ELAN0732:00_04F3:2719
2019-08-02 08:07:04 - [sway/ipc-server.c:937] Added IPC reply of type 0x0 to client 80 queue: [ { "success": true } ]
2019-08-02 08:07:04 - [sway/ipc-server.c:524] Client 80 writable
2019-08-02 08:07:04 - [sway/ipc-server.c:215] Client 80 hung up
2019-08-02 08:07:04 - [sway/ipc-server.c:554] IPC Client 80 disconnected
2019-08-02 08:07:05 - [sway/ipc-server.c:154] Event on IPC listening socket
2019-08-02 08:07:05 - [sway/ipc-server.c:200] New client: fd 80
2019-08-02 08:07:05 - [sway/ipc-server.c:220] Client 80 readable
2019-08-02 08:07:05 - [sway/commands.c:250] Handling command 'input type:touch calibration_matrix "-1" 0 1 0 "-1" 1'
2019-08-02 08:07:05 - [sway/commands/input.c:69] entering input block: type:touch
2019-08-02 08:07:05 - [sway/config/input.c:15] new_input_config(type:touch)
2019-08-02 08:07:05 - [sway/commands.c:403] Subcommand: calibration_matrix -1 0 1 0 -1 1
2019-08-02 08:07:05 - [sway/config/input.c:15] new_input_config(temp)
2019-08-02 08:07:05 - [sway/config/input.c:299] Config stored for input type:touch
2019-08-02 08:07:05 - [sway/input/libinput.c:261] config_libinput_touch('type:touch' on  '1267:10009:ELAN0732:00_04F3:2719')
2019-08-02 08:07:05 - [sway/input/seat.c:541] Applying input config to 1267:10009:ELAN0732:00_04F3:2719
2019-08-02 08:07:05 - [sway/ipc-server.c:937] Added IPC reply of type 0x0 to client 80 queue: [ { "success": true } ]
2019-08-02 08:07:05 - [sway/ipc-server.c:524] Client 80 writable
2019-08-02 08:07:05 - [sway/ipc-server.c:215] Client 80 hung up
2019-08-02 08:07:05 - [sway/ipc-server.c:554] IPC Client 80 disconnected
@RedSoxFan
Copy link
Member

Can you post the log while running RedSoxFan@3eb60c6

@Schnilz
Copy link
Contributor Author

Schnilz commented Aug 3, 2019

2019-08-03 10:22:16 - [sway/ipc-server.c:154] Event on IPC listening socket
2019-08-03 10:22:16 - [sway/ipc-server.c:200] New client: fd 62
2019-08-03 10:22:16 - [sway/ipc-server.c:220] Client 62 readable
2019-08-03 10:22:16 - [sway/commands.c:250] Handling command 'input type:touch calibration_matrix "-1" 0 1 0 "-1" 1'
2019-08-03 10:22:16 - [sway/commands/input.c:69] entering input block: type:touch
2019-08-03 10:22:16 - [sway/config/input.c:15] new_input_config(type:touch)
2019-08-03 10:22:16 - [sway/commands.c:403] Subcommand: calibration_matrix -1 0 1 0 -1 1
2019-08-03 10:22:16 - [sway/config/input.c:15] new_input_config(temp)
2019-08-03 10:22:16 - [sway/config/input.c:299] Config stored for input type:touch
2019-08-03 10:22:16 - [sway/input/libinput.c:265] config_libinput_touch('type:touch' on  '1267:10009:ELAN0732:00_04F3:2719')
2019-08-03 10:22:16 - [sway/input/libinput.c:176] set_calibration_matrix: current[0]=1.000000 mat[0]=-1.000000
2019-08-03 10:22:16 - [sway/input/libinput.c:185] calibration_set_matrix(-1.000000, 0.000000, 1.000000, 0.000000, -1.000000, 1.000000)
2019-08-03 10:22:16 - [sway/input/seat.c:541] Applying input config to 1267:10009:ELAN0732:00_04F3:2719
2019-08-03 10:22:16 - [sway/ipc-server.c:937] Added IPC reply of type 0x0 to client 62 queue: [ { "success": true } ]
2019-08-03 10:22:16 - [sway/ipc-server.c:524] Client 62 writable
2019-08-03 10:22:16 - [sway/ipc-server.c:215] Client 62 hung up
2019-08-03 10:22:16 - [sway/ipc-server.c:554] IPC Client 62 disconnected
2019-08-03 10:22:26 - [sway/ipc-server.c:154] Event on IPC listening socket
2019-08-03 10:22:26 - [sway/ipc-server.c:200] New client: fd 62
2019-08-03 10:22:26 - [sway/ipc-server.c:220] Client 62 readable
2019-08-03 10:22:26 - [sway/commands.c:250] Handling command 'input type:touch calibration_matrix 1 0 0 0 1 0'
2019-08-03 10:22:26 - [sway/commands/input.c:69] entering input block: type:touch
2019-08-03 10:22:26 - [sway/config/input.c:15] new_input_config(type:touch)
2019-08-03 10:22:26 - [sway/commands.c:403] Subcommand: calibration_matrix 1 0 0 0 1 0
2019-08-03 10:22:26 - [sway/config/input.c:15] new_input_config(temp)
2019-08-03 10:22:26 - [sway/config/input.c:299] Config stored for input type:touch
2019-08-03 10:22:26 - [sway/input/libinput.c:265] config_libinput_touch('type:touch' on  '1267:10009:ELAN0732:00_04F3:2719')
2019-08-03 10:22:26 - [sway/input/libinput.c:176] set_calibration_matrix: current[0]=-1.000000 mat[0]=1.000000
2019-08-03 10:22:26 - [sway/input/libinput.c:185] calibration_set_matrix(1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
2019-08-03 10:22:26 - [sway/input/seat.c:541] Applying input config to 1267:10009:ELAN0732:00_04F3:2719
2019-08-03 10:22:26 - [sway/ipc-server.c:937] Added IPC reply of type 0x0 to client 62 queue: [ { "success": true } ]
2019-08-03 10:22:26 - [sway/ipc-server.c:524] Client 62 writable
2019-08-03 10:22:26 - [sway/ipc-server.c:215] Client 62 hung up
2019-08-03 10:22:26 - [sway/ipc-server.c:554] IPC Client 62 disconnected
2019-08-03 10:22:29 - [sway/ipc-server.c:154] Event on IPC listening socket
2019-08-03 10:22:29 - [sway/ipc-server.c:200] New client: fd 62
2019-08-03 10:22:29 - [sway/ipc-server.c:220] Client 62 readable
2019-08-03 10:22:29 - [sway/commands.c:250] Handling command 'input type:touch calibration_matrix "-1" 0 1 0 "-1" 1'
2019-08-03 10:22:29 - [sway/commands/input.c:69] entering input block: type:touch
2019-08-03 10:22:29 - [sway/config/input.c:15] new_input_config(type:touch)
2019-08-03 10:22:29 - [sway/commands.c:403] Subcommand: calibration_matrix -1 0 1 0 -1 1
2019-08-03 10:22:29 - [sway/config/input.c:15] new_input_config(temp)
2019-08-03 10:22:29 - [sway/config/input.c:299] Config stored for input type:touch
2019-08-03 10:22:29 - [sway/input/libinput.c:265] config_libinput_touch('type:touch' on  '1267:10009:ELAN0732:00_04F3:2719')
2019-08-03 10:22:29 - [sway/input/libinput.c:176] set_calibration_matrix: current[0]=-1.000000 mat[0]=-1.000000
2019-08-03 10:22:29 - [sway/input/libinput.c:176] set_calibration_matrix: current[1]=0.000000 mat[1]=0.000000
2019-08-03 10:22:29 - [sway/input/libinput.c:176] set_calibration_matrix: current[2]=1.000000 mat[2]=1.000000
2019-08-03 10:22:29 - [sway/input/libinput.c:176] set_calibration_matrix: current[3]=0.000000 mat[3]=0.000000
2019-08-03 10:22:29 - [sway/input/libinput.c:176] set_calibration_matrix: current[4]=-1.000000 mat[4]=-1.000000
2019-08-03 10:22:29 - [sway/input/libinput.c:176] set_calibration_matrix: current[5]=1.000000 mat[5]=1.000000
2019-08-03 10:22:29 - [sway/input/seat.c:541] Applying input config to 1267:10009:ELAN0732:00_04F3:2719
2019-08-03 10:22:29 - [sway/ipc-server.c:937] Added IPC reply of type 0x0 to client 62 queue: [ { "success": true } ]
2019-08-03 10:22:29 - [sway/ipc-server.c:524] Client 62 writable
2019-08-03 10:22:29 - [sway/ipc-server.c:215] Client 62 hung up
2019-08-03 10:22:29 - [sway/ipc-server.c:554] IPC Client 62 disconnected
2019-08-03 10:22:35 - [sway/ipc-server.c:154] Event on IPC listening socket
2019-08-03 10:22:35 - [sway/ipc-server.c:200] New client: fd 62
2019-08-03 10:22:35 - [sway/ipc-server.c:220] Client 62 readable
2019-08-03 10:22:35 - [sway/commands.c:250] Handling command 'input type:touch calibration_matrix "-1" 0 1 0 "-1" 1'
2019-08-03 10:22:35 - [sway/commands/input.c:69] entering input block: type:touch
2019-08-03 10:22:35 - [sway/config/input.c:15] new_input_config(type:touch)
2019-08-03 10:22:35 - [sway/commands.c:403] Subcommand: calibration_matrix -1 0 1 0 -1 1
2019-08-03 10:22:35 - [sway/config/input.c:15] new_input_config(temp)
2019-08-03 10:22:35 - [sway/config/input.c:299] Config stored for input type:touch
2019-08-03 10:22:35 - [sway/input/libinput.c:265] config_libinput_touch('type:touch' on  '1267:10009:ELAN0732:00_04F3:2719')
2019-08-03 10:22:35 - [sway/input/libinput.c:176] set_calibration_matrix: current[0]=-1.000000 mat[0]=-1.000000
2019-08-03 10:22:35 - [sway/input/libinput.c:176] set_calibration_matrix: current[1]=0.000000 mat[1]=0.000000
2019-08-03 10:22:35 - [sway/input/libinput.c:176] set_calibration_matrix: current[2]=1.000000 mat[2]=1.000000
2019-08-03 10:22:35 - [sway/input/libinput.c:176] set_calibration_matrix: current[3]=0.000000 mat[3]=0.000000
2019-08-03 10:22:35 - [sway/input/libinput.c:176] set_calibration_matrix: current[4]=-1.000000 mat[4]=-1.000000
2019-08-03 10:22:35 - [sway/input/libinput.c:176] set_calibration_matrix: current[5]=1.000000 mat[5]=1.000000
2019-08-03 10:22:35 - [sway/input/seat.c:541] Applying input config to 1267:10009:ELAN0732:00_04F3:2719
2019-08-03 10:22:35 - [sway/ipc-server.c:937] Added IPC reply of type 0x0 to client 62 queue: [ { "success": true } ]
2019-08-03 10:22:35 - [sway/ipc-server.c:524] Client 62 writable
2019-08-03 10:22:35 - [sway/ipc-server.c:215] Client 62 hung up
2019-08-03 10:22:35 - [sway/ipc-server.c:554] IPC Client 62 disconnected

@RedSoxFan
Copy link
Member

I think this is a libinput bug. It appears that the matrix is not stored when the identity matrix is given. When we retrieve the matrix to determine if it has changed, the last non-identity matrix set is being returned.

Can you please post the output of RedSoxFan@6600a8f ... I just added one more line to the log that looks at the return code of libinput_device_config_calibration_get_matrix and outputs whether libinput is reporting the matrix as the identity matrix or not. My theory is it's not going to report it as the identity matrix. If my theory is correct, I'll submit a libinput MR to fix it and a bandaid sway PR

@Schnilz
Copy link
Contributor Author

Schnilz commented Aug 4, 2019

not sure why but the last commit just gives me a black screen. If i only use the changes Logging changes ( not the change to libinput_device_config_tap_get_default_button_map etc.) i get an image and following log:

2019-08-04 08:50:46 - [sway/ipc-server.c:154] Event on IPC listening socket
2019-08-04 08:50:46 - [sway/ipc-server.c:200] New client: fd 62
2019-08-04 08:50:46 - [sway/ipc-server.c:220] Client 62 readable
2019-08-04 08:50:46 - [sway/commands.c:250] Handling command 'input type:touch calibration_matrix "-1" 0 1 0 "-1" 1'
2019-08-04 08:50:46 - [sway/commands/input.c:69] entering input block: type:touch
2019-08-04 08:50:46 - [sway/config/input.c:15] new_input_config(type:touch)
2019-08-04 08:50:46 - [sway/commands.c:403] Subcommand: calibration_matrix -1 0 1 0 -1 1
2019-08-04 08:50:46 - [sway/config/input.c:15] new_input_config(temp)
2019-08-04 08:50:46 - [sway/config/input.c:299] Config stored for input type:touch
2019-08-04 08:50:46 - [sway/input/libinput.c:270] config_libinput_touch('type:touch' on  '1267:10009:ELAN0732:00_04F3:2719')
2019-08-04 08:50:46 - [sway/input/libinput.c:177] set_calibration_matrix: identity matrix
2019-08-04 08:50:46 - [sway/input/libinput.c:181] set_calibration_matrix: current[0]=1.000000 mat[0]=-1.000000
2019-08-04 08:50:46 - [sway/input/libinput.c:190] calibration_set_matrix(-1.000000, 0.000000, 1.000000, 0.000000, -1.000000, 1.000000)
2019-08-04 08:50:46 - [sway/input/seat.c:541] Applying input config to 1267:10009:ELAN0732:00_04F3:2719
2019-08-04 08:50:46 - [sway/ipc-server.c:937] Added IPC reply of type 0x0 to client 62 queue: [ { "success": true } ]
2019-08-04 08:50:46 - [sway/ipc-server.c:524] Client 62 writable
2019-08-04 08:50:46 - [sway/ipc-server.c:215] Client 62 hung up
2019-08-04 08:50:46 - [sway/ipc-server.c:554] IPC Client 62 disconnected
2019-08-04 08:51:01 - [sway/ipc-server.c:154] Event on IPC listening socket
2019-08-04 08:51:01 - [sway/ipc-server.c:200] New client: fd 62
2019-08-04 08:51:01 - [sway/ipc-server.c:220] Client 62 readable
2019-08-04 08:51:01 - [sway/commands.c:250] Handling command 'input type:touch calibration_matrix 1 0 0 0 1 0'
2019-08-04 08:51:01 - [sway/commands/input.c:69] entering input block: type:touch
2019-08-04 08:51:01 - [sway/config/input.c:15] new_input_config(type:touch)
2019-08-04 08:51:01 - [sway/commands.c:403] Subcommand: calibration_matrix 1 0 0 0 1 0
2019-08-04 08:51:01 - [sway/config/input.c:15] new_input_config(temp)
2019-08-04 08:51:01 - [sway/config/input.c:299] Config stored for input type:touch
2019-08-04 08:51:01 - [sway/input/libinput.c:270] config_libinput_touch('type:touch' on  '1267:10009:ELAN0732:00_04F3:2719')
2019-08-04 08:51:01 - [sway/input/libinput.c:175] set_calibration_matrix: retrieved matrix
2019-08-04 08:51:01 - [sway/input/libinput.c:181] set_calibration_matrix: current[0]=-1.000000 mat[0]=1.000000
2019-08-04 08:51:01 - [sway/input/libinput.c:190] calibration_set_matrix(1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
2019-08-04 08:51:01 - [sway/input/seat.c:541] Applying input config to 1267:10009:ELAN0732:00_04F3:2719
2019-08-04 08:51:01 - [sway/ipc-server.c:937] Added IPC reply of type 0x0 to client 62 queue: [ { "success": true } ]
2019-08-04 08:51:01 - [sway/ipc-server.c:524] Client 62 writable
2019-08-04 08:51:01 - [sway/ipc-server.c:215] Client 62 hung up
2019-08-04 08:51:01 - [sway/ipc-server.c:554] IPC Client 62 disconnected
2019-08-04 08:51:04 - [sway/ipc-server.c:154] Event on IPC listening socket
2019-08-04 08:51:04 - [sway/ipc-server.c:200] New client: fd 62
2019-08-04 08:51:04 - [sway/ipc-server.c:220] Client 62 readable
2019-08-04 08:51:04 - [sway/commands.c:250] Handling command 'input type:touch calibration_matrix "-1" 0 1 0 "-1" 1'
2019-08-04 08:51:04 - [sway/commands/input.c:69] entering input block: type:touch
2019-08-04 08:51:04 - [sway/config/input.c:15] new_input_config(type:touch)
2019-08-04 08:51:04 - [sway/commands.c:403] Subcommand: calibration_matrix -1 0 1 0 -1 1
2019-08-04 08:51:04 - [sway/config/input.c:15] new_input_config(temp)
2019-08-04 08:51:04 - [sway/config/input.c:299] Config stored for input type:touch
2019-08-04 08:51:04 - [sway/input/libinput.c:270] config_libinput_touch('type:touch' on  '1267:10009:ELAN0732:00_04F3:2719')
2019-08-04 08:51:04 - [sway/input/libinput.c:175] set_calibration_matrix: retrieved matrix
2019-08-04 08:51:04 - [sway/input/libinput.c:181] set_calibration_matrix: current[0]=-1.000000 mat[0]=-1.000000
2019-08-04 08:51:04 - [sway/input/libinput.c:181] set_calibration_matrix: current[1]=0.000000 mat[1]=0.000000
2019-08-04 08:51:04 - [sway/input/libinput.c:181] set_calibration_matrix: current[2]=1.000000 mat[2]=1.000000
2019-08-04 08:51:04 - [sway/input/libinput.c:181] set_calibration_matrix: current[3]=0.000000 mat[3]=0.000000
2019-08-04 08:51:04 - [sway/input/libinput.c:181] set_calibration_matrix: current[4]=-1.000000 mat[4]=-1.000000
2019-08-04 08:51:04 - [sway/input/libinput.c:181] set_calibration_matrix: current[5]=1.000000 mat[5]=1.000000
2019-08-04 08:51:04 - [sway/input/seat.c:541] Applying input config to 1267:10009:ELAN0732:00_04F3:2719
2019-08-04 08:51:04 - [sway/ipc-server.c:937] Added IPC reply of type 0x0 to client 62 queue: [ { "success": true } ]
2019-08-04 08:51:04 - [sway/ipc-server.c:524] Client 62 writable
2019-08-04 08:51:04 - [sway/ipc-server.c:215] Client 62 hung up
2019-08-04 08:51:04 - [sway/ipc-server.c:554] IPC Client 62 disconnected

@RedSoxFan
Copy link
Member

not sure why but the last commit just gives me a black screen.

You just need to update wlroots. There was a change to the way outputs are configured

Anyway, thanks for the log. The libinput MR has been submitted: https://gitlab.freedesktop.org/libinput/libinput/merge_requests/272

@Schnilz
Copy link
Contributor Author

Schnilz commented Aug 4, 2019

thanks!

@Schnilz Schnilz closed this as completed Aug 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants