Xorg Joystick Driver Mouse Emulation Bug
| Proxecto: | Trisquel | 
| Versión: | 6.0 | 
| Componente: | Kernel/drivers | 
| Categoría: | informe de erro | 
| Prioridade: | normal | 
| Asignado: | Sen asignar | 
| Estado: | active | 
Description: Xorg joystick driver (package xserver-xorg-input-joystick) mouse emulation snaps the cursor leftward/upward when tilting the joystick axis right/down.
Steps to reproduce: 1: Install the joystick driver xserver-xorg-input-joystick. 2: Start a desktop environment session. 3: Using a connected joystick, tilt the main stick right or down.
Expected behavior: Cursor should move right or down in the same way that the stick can move the cursor left or up.
Unexpected behavior: When tilting the joystick right or down, the cursor snaps to the left or upper edge of the screen.
Additional information:
Logfile: With debug support compiled in and DebugLevel set to 10, the logfile shows that the driver receives correct axis information from the joystick. For instance, tilting the stick down sends a value of 6605 on the axis 1. However, the driver interprets the value to be -58932. In contrast, tilting the stick up sends a value of -19176, and the driver interprets it correctly as -19176.
Code:
[  4558.953] Event (evdev): type: 0x0003, code: 0x0001, value: 0xFFFFB518, (intvalue: -19176)
[  4558.953] Axis 1 moved to -19176. Type: 1, Mapping: 2
[  4558.961] Event (evdev): type: 0x0003, code: 0x0001, value: 0xFFFFCDE6, (intvalue: -12826)
[  4558.961] Axis 1 moved to -12826. Type: 1, Mapping: 2
[  4558.970] Event (evdev): type: 0x0003, code: 0x0001, value: 0x0000, (intvalue: 0)
[  4558.970] Axis 1 moved to 0. Type: 1, Mapping: 2
[  4558.973] Stopping Axis Timer
[  4559.385] Event (evdev): type: 0x0003, code: 0x0001, value: 0x19CD, (intvalue: 6605)
[  4559.385] Axis 1 moved to -58932. Type: 1, Mapping: 2
[  4559.385] Starting Axis Timer (triggered by axis 1)
[  4559.425] Event (evdev): type: 0x0003, code: 0x0001, value: 0x1BC9, (intvalue: 7113)
[  4559.425] Axis 1 moved to -58424. Type: 1, Mapping: 2
[  4559.433] Event (evdev): type: 0x0003, code: 0x0001, value: 0x1DC5, (intvalue: 7621)
[  4559.433] Axis 1 moved to -57916. Type: 1, Mapping: 2
Affected code: I think I've tracked down the bug to the following equation on lines 281 and 282 in the source file backend_evdev.c
Code:
                value = (iev.value - axis->min) * 65535
                        / (axis->max - axis->min) - 32768;
iev.value is the value recieved by the driver. axis->min should be -32768. axis->max should be 32768. I've crunched a positive number through this on a calculator, and it came through correctly, so I'm not sure why the code comes up with a different result. Unexpected axis->min or axis->max, perhaps? Or a wrong order of operands?
- Inicie sesión ou rexístrese para enviar comentarios
 

