모종의 음모/force feedback
evtest 를 이용하여 진동패드 진동시키기
구차니
2024. 10. 12. 21:54
force feedback과는 별개로 진동이 되는 녀석은 진동만 시킬수 있나 본데?
$ fftest /dev/input/event16 Force feedback test program. HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES Device /dev/input/event16 opened Features: * Absolute axes: X, Y, Z, RX, RY, RZ, Hat 0 X, Hat 0 Y, [3F 00 03 00 00 00 00 00 ] * Relative axes: [00 00 ] * Force feedback effects types: Periodic, Rumble, Gain, Force feedback periodic effects: Square, Triangle, Sine, [00 00 00 00 00 00 00 00 00 00 03 07 01 00 00 00 ] * Number of simultaneous effects: 16 Setting master gain to 75% ... OK Uploading effect #0 (Periodic sinusoidal) ... OK (id 0) Uploading effect #1 (Constant) ... Error: Invalid argument Uploading effect #2 (Spring) ... Error: Invalid argument Uploading effect #3 (Damper) ... Error: Invalid argument Uploading effect #4 (Strong rumble, with heavy motor) ... OK (id 1) Uploading effect #5 (Weak rumble, with light motor) ... OK (id 2) Enter effect number, -1 to exit Use effects 4 and 5 to test rumble effects: Enter effect number, -1 to exit 4 Now Playing: Strong Rumble Enter effect number, -1 to exit 5 Now Playing: Weak Rumble Enter effect number, -1 to exit |
[링크 : https://askubuntu.com/questions/1139960/how-to-enable-a-vibration-in-a-pc-gamepad-in-xubuntu-18-10]
evtest와는 별개라 설치를 해주어야 한다.
$ fftest 명령어 'fftest' 을(를) 찾을 수 없습니다. 그러나 다음을 통해 설치할 수 있습니다: sudo apt install joystick |
설치하고 해보니 권한이 부족하댄다 -_-
$ fftest Force feedback test program. HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES Open device file: Permission denied |
그래서 sudo로 해주니 뜬금없이(?) event0를 붙여 버리네?
$ sudo fftest Force feedback test program. HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES Device /dev/input/event0 opened Features: * Absolute axes: [00 00 00 00 00 00 00 00 ] * Relative axes: [00 00 ] * Force feedback effects types: Force feedback periodic effects: [00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ] * Number of simultaneous effects: 0 Uploading effect #0 (Periodic sinusoidal) ... Error:: Function not implemented Uploading effect #1 (Constant) ... Error: Function not implemented Uploading effect #2 (Spring) ... Error: Function not implemented Uploading effect #3 (Damper) ... Error: Function not implemented Uploading effect #4 (Strong rumble, with heavy motor) ... Error: Function not implemented Uploading effect #5 (Weak rumble, with light motor) ... Error: Function not implemented Enter effect number, -1 to exit |
그래서 0이 먼가 봤는데 어라.. sleep button.. 야이 -_-
$ sudo evtest No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: Sleep Button /dev/input/event1: Lid Switch /dev/input/event10: HDA Intel PCH Line /dev/input/event11: HDA Intel PCH Dock Line Out /dev/input/event12: HDA Intel PCH Headphone /dev/input/event13: HDA Intel PCH HDMI/DP,pcm=3 /dev/input/event14: Wacom Serial Penabled 2FG Touchscreen Pen /dev/input/event15: Wacom Serial Penabled 2FG Touchscreen Finger /dev/input/event16: GreenAsia Inc. USB Joystick /dev/input/event2: Power Button /dev/input/event3: AT Translated Set 2 keyboard /dev/input/event4: PS/2 Generic Mouse /dev/input/event5: SynPS/2 Synaptics TouchPad /dev/input/event6: HP WMI hotkeys /dev/input/event7: ST LIS3LV02DL Accelerometer /dev/input/event8: Video Bus /dev/input/event9: HDA Intel PCH Mic Select the device event number [0-16]: ^C |
일반 사용자로 하니 지금 새로 추가된 조이스틱만 뜬다.
아무튼 이렇게 event 번호를 획득하고
$ evtest No device specified, trying to scan all of /dev/input/event* Not running as root, no devices may be available. Available devices: /dev/input/event16: GreenAsia Inc. USB Joystick Select the device event number [0-16]: |
fftest 뒤에 장치명을 붙여주면 된다니까
$ fftest --help Force feedback test program. HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES Usage: fftest /dev/input/eventXX Tests the force feedback driver |
일반 사용자 권한으로 조이스틱을 연결하면 똭!
ok 뜨는게 0,4,5 뿐인데
먼가 진동이 오긴한다!
$ fftest /dev/input/event16 Force feedback test program. HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES Device /dev/input/event16 opened Features: * Absolute axes: X, Y, Z, RZ, Hat 0 X, Hat 0 Y, Misc , [27 00 03 00 00 01 00 00 ] * Relative axes: [00 00 ] * Force feedback effects types: Periodic, Rumble, Gain, Force feedback periodic effects: Square, Triangle, Sine, [00 00 00 00 00 00 00 00 00 00 03 07 01 00 00 00 ] * Number of simultaneous effects: 16 Setting master gain to 75% ... OK Uploading effect #0 (Periodic sinusoidal) ... OK (id 0) Uploading effect #1 (Constant) ... Error: Invalid argument Uploading effect #2 (Spring) ... Error: Invalid argument Uploading effect #3 (Damper) ... Error: Invalid argument Uploading effect #4 (Strong rumble, with heavy motor) ... OK (id 1) Uploading effect #5 (Weak rumble, with light motor) ... OK (id 2) Enter effect number, -1 to exit |