← Documents Documentation/input/ff.rst GitHub 원문 ↗

Linux 6.18.37 · Input

Force Feedback for Linux

Linux event API로 force-feedback capability를 조회하고 effect를 업로드·재생·갱신·제거하는 방법입니다.

Source pathDocumentation/input/ff.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

ff.rst:1-265

Force-feedback API는 evdev device에서 capability와 slot 수를 조회하고 `ff_effect`를 upload해 ID를 받은 뒤 `EV_FF` event로 재생합니다. 전역 gain·autocenter, 동적 갱신, 제거와 status event까지 같은 file descriptor 기반 생명주기로 관리합니다.

문서 개요
단계API
Capability`EVIOCGBIT(EV_FF, ...)`
Memory slots`EVIOCGEFFECTS`
Upload/update`EVIOCSFF`
Remove`EVIOCRMFF`
Play/stop`write()` with `EV_FF`
Global control`FF_GAIN`, `FF_AUTOCENTER`
Status`EV_FF_STATUS`

주요 ioctl과 event command입니다.

Force effect 생명주기
Effect capability와 memory slot 조회`id=-1`인 `ff_effect` upload반환된 ID로 replay count 전송필요하면 같은 ID로 dynamic updateStatus event로 playing·stopped 관찰`EVIOCRMFF`로 effect 제거

지원 확인부터 제거까지의 전체 흐름입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 ========================
2 Force feedback for Linux
3 ========================
4
5 :Author: Johann Deneux <[email protected]> on 2001/04/22.
6 :Updated: Anssi Hannula <[email protected]> on 2006/04/09.
7
8 You may redistribute this file. Please remember to include shape.svg and
9 interactive.svg as well.
10
11 Introduction
12 ~~~~~~~~~~~~
13
14 This document describes how to use force feedback devices under Linux. The
15 goal is not to support these devices as if they were simple input-only devices
16 (as it is already the case), but to really enable the rendering of force
17 effects.
18 This document only describes the force feedback part of the Linux input
19 interface. Please read joydev/joystick.rst and input.rst before reading further
20 this document.
21
22 Instructions to the user
23 ~~~~~~~~~~~~~~~~~~~~~~~~
24
25 To enable force feedback, you have to:
26
27 1. have your kernel configured with evdev and a driver that supports your
28 device.
29 2. make sure evdev module is loaded and /dev/input/event* device files are
30 created.
31
32 Before you start, let me WARN you that some devices shake violently during the
33 initialisation phase. This happens for example with my "AVB Top Shot Pegasus".
34 To stop this annoying behaviour, move your joystick to its limits. Anyway, you
35 should keep a hand on your device, in order to avoid it to break down if
36 something goes wrong.
37
38 If you have a serial iforce device, you need to start inputattach. See
39 joydev/joystick.rst for details.
40
41 Does it work ?
42 --------------
43
44 There is an utility called fftest that will allow you to test the driver::
45
46 % fftest /dev/input/eventXX
47
48 Instructions to the developer
49 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50
51 All interactions are done using the event API. That is, you can use ioctl()
52 and write() on /dev/input/eventXX.
53 This information is subject to change.
54
55 Querying device capabilities
56 ----------------------------
57
58 ::
59
60 #include <linux/input.h>
61 #include <sys/ioctl.h>
62
63 #define BITS_TO_LONGS(x) \
64 (((x) + 8 * sizeof (unsigned long) - 1) / (8 * sizeof (unsigned long)))
65 unsigned long features[BITS_TO_LONGS(FF_CNT)];
66 int ioctl(int file_descriptor, int request, unsigned long *features);
67
68 "request" must be EVIOCGBIT(EV_FF, size of features array in bytes )
69
70 Returns the features supported by the device. features is a bitfield with the
71 following bits:
72
73 - FF_CONSTANT can render constant force effects
74 - FF_PERIODIC can render periodic effects with the following waveforms:
75
76 - FF_SQUARE square waveform
77 - FF_TRIANGLE triangle waveform
78 - FF_SINE sine waveform
79 - FF_SAW_UP sawtooth up waveform
80 - FF_SAW_DOWN sawtooth down waveform
81 - FF_CUSTOM custom waveform
82
83 - FF_RAMP can render ramp effects
84 - FF_SPRING can simulate the presence of a spring
85 - FF_FRICTION can simulate friction
86 - FF_DAMPER can simulate damper effects
87 - FF_RUMBLE rumble effects
88 - FF_INERTIA can simulate inertia
89 - FF_GAIN gain is adjustable
90 - FF_AUTOCENTER autocenter is adjustable
91
92 .. note::
93
94 - In most cases you should use FF_PERIODIC instead of FF_RUMBLE. All
95 devices that support FF_RUMBLE support FF_PERIODIC (square, triangle,
96 sine) and the other way around.
97
98 - The exact syntax FF_CUSTOM is undefined for the time being as no driver
99 supports it yet.
100
101 ::
102
103 int ioctl(int fd, EVIOCGEFFECTS, int *n);
104
105 Returns the number of effects the device can keep in its memory.
106
107 Uploading effects to the device
108 -------------------------------
109
110 ::
111
112 #include <linux/input.h>
113 #include <sys/ioctl.h>
114
115 int ioctl(int file_descriptor, int request, struct ff_effect *effect);
116
117 "request" must be EVIOCSFF.
118
119 "effect" points to a structure describing the effect to upload. The effect is
120 uploaded, but not played.
121 The content of effect may be modified. In particular, its field "id" is set
122 to the unique id assigned by the driver. This data is required for performing
123 some operations (removing an effect, controlling the playback).
124 The "id" field must be set to -1 by the user in order to tell the driver to
125 allocate a new effect.
126
127 Effects are file descriptor specific.
128
129 See <uapi/linux/input.h> for a description of the ff_effect struct. You
130 should also find help in a few sketches, contained in files shape.svg
131 and interactive.svg:
132
133 .. kernel-figure:: shape.svg
134
135 Shape
136
137 .. kernel-figure:: interactive.svg
138
139 Interactive
140
141
142 Removing an effect from the device
143 ----------------------------------
144
145 ::
146
147 int ioctl(int fd, EVIOCRMFF, effect.id);
148
149 This makes room for new effects in the device's memory. Note that this also
150 stops the effect if it was playing.
151
152 Controlling the playback of effects
153 -----------------------------------
154
155 Control of playing is done with write(). Below is an example:
156
157 ::
158
159 #include <linux/input.h>
160 #include <unistd.h>
161
162 struct input_event play;
163 struct input_event stop;
164 struct ff_effect effect;
165 int fd;
166 ...
167 fd = open("/dev/input/eventXX", O_RDWR);
168 ...
169 /* Play three times */
170 play.type = EV_FF;
171 play.code = effect.id;
172 play.value = 3;
173
174 write(fd, (const void*) &play, sizeof(play));
175 ...
176 /* Stop an effect */
177 stop.type = EV_FF;
178 stop.code = effect.id;
179 stop.value = 0;
180
181 write(fd, (const void*) &stop, sizeof(stop));
182
183 Setting the gain
184 ----------------
185
186 Not all devices have the same strength. Therefore, users should set a gain
187 factor depending on how strong they want effects to be. This setting is
188 persistent across access to the driver.
189
190 ::
191
192 /* Set the gain of the device
193 int gain; /* between 0 and 100 */
194 struct input_event ie; /* structure used to communicate with the driver */
195
196 ie.type = EV_FF;
197 ie.code = FF_GAIN;
198 ie.value = 0xFFFFUL * gain / 100;
199
200 if (write(fd, &ie, sizeof(ie)) == -1)
201 perror("set gain");
202
203 Enabling/Disabling autocenter
204 -----------------------------
205
206 The autocenter feature quite disturbs the rendering of effects in my opinion,
207 and I think it should be an effect, which computation depends on the game
208 type. But you can enable it if you want.
209
210 ::
211
212 int autocenter; /* between 0 and 100 */
213 struct input_event ie;
214
215 ie.type = EV_FF;
216 ie.code = FF_AUTOCENTER;
217 ie.value = 0xFFFFUL * autocenter / 100;
218
219 if (write(fd, &ie, sizeof(ie)) == -1)
220 perror("set auto-center");
221
222 A value of 0 means "no auto-center".
223
224 Dynamic update of an effect
225 ---------------------------
226
227 Proceed as if you wanted to upload a new effect, except that instead of
228 setting the id field to -1, you set it to the wanted effect id.
229 Normally, the effect is not stopped and restarted. However, depending on the
230 type of device, not all parameters can be dynamically updated. For example,
231 the direction of an effect cannot be updated with iforce devices. In this
232 case, the driver stops the effect, up-load it, and restart it.
233
234 Therefore it is recommended to dynamically change direction while the effect
235 is playing only when it is ok to restart the effect with a replay count of 1.
236
237 Information about the status of effects
238 ---------------------------------------
239
240 Every time the status of an effect is changed, an event is sent. The values
241 and meanings of the fields of the event are as follows::
242
243 struct input_event {
244 /* When the status of the effect changed */
245 struct timeval time;
246
247 /* Set to EV_FF_STATUS */
248 unsigned short type;
249
250 /* Contains the id of the effect */
251 unsigned short code;
252
253 /* Indicates the status */
254 unsigned int value;
255 };
256
257 FF_STATUS_STOPPED The effect stopped playing
258 FF_STATUS_PLAYING The effect started to play
259
260 .. note::
261
262 - Status feedback is only supported by iforce driver. If you have
263 a really good reason to use this, please contact
265 so that support for it can be added to the rest of the drivers.
266

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Force-feedback 사용 준비와 안전

1-54

이 문서는 Linux input interface의 force-feedback 부분을 사용해 장치가 실제 force effect를 렌더링하게 하는 방법을 설명합니다. 단순 input-only 지원은 범위가 아니며 먼저 `joydev/joystick.rst`와 `input.rst`를 읽는 것이 권장됩니다.

문서를 재배포할 때는 관련 그림 `shape.svg`와 `interactive.svg`도 포함해야 합니다. Force feedback을 사용하려면 kernel에 `evdev`와 해당 장치 driver를 구성하고, `evdev` module이 로드돼 `/dev/input/event*` node가 생성돼야 합니다.

Force-feedback 준비
항목요구사항
Kernel`evdev`와 장치별 force-feedback driver
Module`evdev` loaded
Device node`/dev/input/event*` created
Serial iforce`inputattach` 시작
시험`fftest /dev/input/eventXX`

사용자 공간 시험 전 필요한 구성입니다.

일부 장치는 초기화 중 매우 거칠게 흔들릴 수 있습니다. 원문 예는 AVB Top Shot Pegasus이며, joystick을 양 끝으로 움직이면 멈출 수 있다고 설명합니다. 오작동으로 장치가 파손되지 않도록 손으로 장치를 잡고 시험해야 합니다.

Developer의 모든 상호작용은 event API를 통해 `/dev/input/eventXX`에 `ioctl()`과 `write()`를 사용합니다. 이 API 정보는 변경될 수 있습니다.

초기 기능 시험
Force-feedback 지원 driver와 evdev 활성화`/dev/input/eventXX` node 확인Serial iforce이면 `inputattach` 실행장치를 안전하게 고정하거나 손으로 제어`fftest /dev/input/eventXX` 실행지원 effect와 물리 반응 확인

커널 구성부터 실제 effect 확인까지의 흐름입니다.

========================
Force feedback for Linux
========================

:Author: Johann Deneux <[email protected]> on 2001/04/22.
:Updated: Anssi Hannula <[email protected]> on 2006/04/09.

You may redistribute this file. Please remember to include shape.svg and
interactive.svg as well.

Introduction
~~~~~~~~~~~~

This document describes how to use force feedback devices under Linux. The
goal is not to support these devices as if they were simple input-only devices
(as it is already the case), but to really enable the rendering of force
effects.
This document only describes the force feedback part of the Linux input
interface. Please read joydev/joystick.rst and input.rst before reading further
this document.

Instructions to the user
~~~~~~~~~~~~~~~~~~~~~~~~

To enable force feedback, you have to:

1. have your kernel configured with evdev and a driver that supports your
   device.
2. make sure evdev module is loaded and /dev/input/event* device files are
   created.

Before you start, let me WARN you that some devices shake violently during the
initialisation phase. This happens for example with my "AVB Top Shot Pegasus".
To stop this annoying behaviour, move your joystick to its limits. Anyway, you
should keep a hand on your device, in order to avoid it to break down if
something goes wrong.

If you have a serial iforce device, you need to start inputattach. See
joydev/joystick.rst for details.

Does it work ?
--------------

There is an utility called fftest that will allow you to test the driver::

    % fftest /dev/input/eventXX

Instructions to the developer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

All interactions are done using the event API. That is, you can use ioctl()
and write() on /dev/input/eventXX.
This information is subject to change.

지원 effect와 장치 메모리 조회

55-106

지원 기능은 `EVIOCGBIT(EV_FF, sizeof(features))` ioctl로 읽습니다. `features`는 `BITS_TO_LONGS(FF_CNT)` 길이의 bitfield이며 장치가 렌더링할 수 있는 effect와 전역 제어를 나타냅니다.

Force-feedback capability bit
Bit기능
`FF_CONSTANT`Constant force
`FF_PERIODIC`Periodic waveform
`FF_RAMP`Ramp effect
`FF_SPRING`Spring simulation
`FF_FRICTION`Friction simulation
`FF_DAMPER`Damper effect
`FF_RUMBLE`Rumble
`FF_INERTIA`Inertia simulation
`FF_GAIN`Adjustable gain
`FF_AUTOCENTER`Adjustable autocenter

장치가 지원할 수 있는 effect와 control입니다.

`FF_PERIODIC` waveform
Waveform형태
`FF_SQUARE`Square
`FF_TRIANGLE`Triangle
`FF_SINE`Sine
`FF_SAW_UP`Sawtooth up
`FF_SAW_DOWN`Sawtooth down
`FF_CUSTOM`Custom; 문서 시점 syntax 미정·driver 미지원

Periodic capability 아래 지원 가능한 파형입니다.

대부분의 경우 `FF_RUMBLE`보다 `FF_PERIODIC`을 사용해야 합니다. Rumble 지원 장치는 square·triangle·sine periodic도 지원하고 반대도 성립한다고 문서는 설명합니다.

`EVIOCGEFFECTS` ioctl은 장치 memory에 동시에 보관할 수 있는 effect 수를 반환합니다.

Capability ioctl
Ioctl출력
`EVIOCGBIT(EV_FF, bytes)`지원 effect·control bitfield
`EVIOCGEFFECTS`장치가 memory에 유지할 effect 수

기능 bitfield와 effect slot 수 조회를 구분합니다.

장치 기능 협상
`EVIOCGBIT`로 capability bitfield 조회원하는 effect type과 waveform bit 확인`FF_GAIN`·`FF_AUTOCENTER` 지원 확인`EVIOCGEFFECTS`로 slot 수 조회지원 범위와 memory 안에서 effect 계획

Effect를 만들기 전에 지원 범위를 확인하는 순서입니다.

Querying device capabilities
----------------------------

::

    #include <linux/input.h>
    #include <sys/ioctl.h>

    #define BITS_TO_LONGS(x) \
            (((x) + 8 * sizeof (unsigned long) - 1) / (8 * sizeof (unsigned long)))
    unsigned long features[BITS_TO_LONGS(FF_CNT)];
    int ioctl(int file_descriptor, int request, unsigned long *features);

"request" must be EVIOCGBIT(EV_FF, size of features array in bytes )

Returns the features supported by the device. features is a bitfield with the
following bits:

- FF_CONSTANT        can render constant force effects
- FF_PERIODIC        can render periodic effects with the following waveforms:

  - FF_SQUARE          square waveform
  - FF_TRIANGLE          triangle waveform
  - FF_SINE          sine waveform
  - FF_SAW_UP          sawtooth up waveform
  - FF_SAW_DOWN          sawtooth down waveform
  - FF_CUSTOM          custom waveform

- FF_RAMP       can render ramp effects
- FF_SPRING        can simulate the presence of a spring
- FF_FRICTION        can simulate friction
- FF_DAMPER        can simulate damper effects
- FF_RUMBLE        rumble effects
- FF_INERTIA    can simulate inertia
- FF_GAIN        gain is adjustable
- FF_AUTOCENTER        autocenter is adjustable

.. note::

    - In most cases you should use FF_PERIODIC instead of FF_RUMBLE. All
      devices that support FF_RUMBLE support FF_PERIODIC (square, triangle,
      sine) and the other way around.

    - The exact syntax FF_CUSTOM is undefined for the time being as no driver
      supports it yet.

::

    int ioctl(int fd, EVIOCGEFFECTS, int *n);

Returns the number of effects the device can keep in its memory.

Effect upload, ID 할당과 제거

107-151

Effect는 `struct ff_effect`를 채워 `EVIOCSFF` ioctl로 upload합니다. Upload는 effect를 장치에 저장할 뿐 재생하지 않습니다. 새 effect를 만들 때 사용자는 `id=-1`로 설정하고, driver가 고유 ID를 구조체에 써 돌려줍니다.

`EVIOCSFF` upload 계약
항목의미
Request`EVIOCSFF`
Argument`struct ff_effect *effect`
새 effect 입력`effect.id = -1`
성공 후Driver가 unique `effect.id` 할당
재생 상태Uploaded but not played
소유 범위Effect는 file descriptor specific

호출 전후 `ff_effect`의 중요한 상태입니다.

할당된 ID는 effect 제거와 playback 제어에 필요합니다. `ff_effect`의 정확한 구조는 `<uapi/linux/input.h>`를 참조하며 effect shape와 interactive 관계는 `shape.svg`, `interactive.svg`에 설명돼 있습니다.

`EVIOCRMFF` ioctl에 `effect.id`를 전달하면 장치 memory에서 effect를 제거해 새 slot을 확보합니다. 재생 중인 effect를 제거하면 동시에 정지합니다.

Effect 제거
호출결과
`ioctl(fd, EVIOCRMFF, effect.id)`해당 effect 삭제
Memory새 effect를 위한 slot 확보
Playing effect제거와 동시에 중지

ID 기반 제거가 memory와 playback에 미치는 영향입니다.

Effect 생명주기 시작
`ff_effect` type과 parameters 구성`id=-1` 설정`EVIOCSFF` ioctl 호출Driver가 반환한 unique ID 보관아직 재생하지 않고 후속 `write()` 준비

새 effect를 정의해 장치 memory에 넣는 순서입니다.

Uploading effects to the device
-------------------------------

::

    #include <linux/input.h>
    #include <sys/ioctl.h>

    int ioctl(int file_descriptor, int request, struct ff_effect *effect);

"request" must be EVIOCSFF.

"effect" points to a structure describing the effect to upload. The effect is
uploaded, but not played.
The content of effect may be modified. In particular, its field "id" is set
to the unique id assigned by the driver. This data is required for performing
some operations (removing an effect, controlling the playback).
The "id" field must be set to -1 by the user in order to tell the driver to
allocate a new effect.

Effects are file descriptor specific.

See <uapi/linux/input.h> for a description of the ff_effect struct.  You
should also find help in a few sketches, contained in files shape.svg
and interactive.svg:

.. kernel-figure:: shape.svg

    Shape

.. kernel-figure:: interactive.svg

    Interactive


Removing an effect from the device
----------------------------------

::

    int ioctl(int fd, EVIOCRMFF, effect.id);

This makes room for new effects in the device's memory. Note that this also
stops the effect if it was playing.

재생 횟수, 정지, gain과 autocenter

152-223

Effect playback은 `struct input_event`를 `/dev/input/eventXX`에 `write()`해 제어합니다. `type=EV_FF`, `code=effect.id`, `value`는 재생 횟수입니다. 예제의 value 3은 세 번 재생하고 value 0은 즉시 정지합니다.

Effect playback event
필드재생정지
`type``EV_FF``EV_FF`
`code``effect.id``effect.id`
`value`Replay count, 예: 30
호출`write(fd, &play, sizeof(play))``write(fd, &stop, sizeof(stop))`

재생과 정지에 쓰는 `input_event` 필드입니다.

장치마다 물리적 힘이 다르므로 사용자는 원하는 강도에 맞춰 gain factor를 설정해야 합니다. 이 설정은 driver access 사이에도 지속됩니다. Percent 0~100을 `0xFFFFUL * gain / 100`으로 변환해 `EV_FF`, `FF_GAIN` event로 보냅니다.

전역 force control
ControlEvent codeValue
Gain`FF_GAIN``0xFFFFUL * gain / 100`
Autocenter`FF_AUTOCENTER``0xFFFFUL * autocenter / 100`
Autocenter off`FF_AUTOCENTER`0

Gain과 autocenter는 같은 16비트 비율 변환을 사용합니다.

Autocenter는 effect 렌더링을 방해할 수 있으며 게임 유형에 따라 계산되는 effect로 다루는 편이 낫다는 저자의 의견이 기록돼 있습니다. 필요하면 0~100 비율로 활성화하고 0은 no auto-center입니다.

Effect 재생 제어
필요하면 `FF_GAIN` percent 설정필요하면 `FF_AUTOCENTER` 설정 또는 0으로 끄기`EV_FF`, effect ID, replay count event 작성`write()`로 재생 시작중지할 때 같은 ID와 value 0 전송

Upload된 ID를 실제 힘과 전역 강도로 연결합니다.

Controlling the playback of effects
-----------------------------------

Control of playing is done with write(). Below is an example:

::

    #include <linux/input.h>
    #include <unistd.h>

        struct input_event play;
        struct input_event stop;
        struct ff_effect effect;
        int fd;
   ...
        fd = open("/dev/input/eventXX", O_RDWR);
   ...
        /* Play three times */
        play.type = EV_FF;
        play.code = effect.id;
        play.value = 3;

        write(fd, (const void*) &play, sizeof(play));
   ...
        /* Stop an effect */
        stop.type = EV_FF;
        stop.code = effect.id;
        stop.value = 0;

        write(fd, (const void*) &stop, sizeof(stop));

Setting the gain
----------------

Not all devices have the same strength. Therefore, users should set a gain
factor depending on how strong they want effects to be. This setting is
persistent across access to the driver.

::

    /* Set the gain of the device
    int gain;                /* between 0 and 100 */
    struct input_event ie;        /* structure used to communicate with the driver */

    ie.type = EV_FF;
    ie.code = FF_GAIN;
    ie.value = 0xFFFFUL * gain / 100;

    if (write(fd, &ie, sizeof(ie)) == -1)
        perror("set gain");

Enabling/Disabling autocenter
-----------------------------

The autocenter feature quite disturbs the rendering of effects in my opinion,
and I think it should be an effect, which computation depends on the game
type. But you can enable it if you want.

::

    int autocenter;                /* between 0 and 100 */
    struct input_event ie;

    ie.type = EV_FF;
    ie.code = FF_AUTOCENTER;
    ie.value = 0xFFFFUL * autocenter / 100;

    if (write(fd, &ie, sizeof(ie)) == -1)
        perror("set auto-center");

A value of 0 means "no auto-center".

동적 effect 갱신과 EV_FF_STATUS

224-265

기존 effect를 동적으로 갱신할 때는 새 upload와 같은 `EVIOCSFF` 절차를 사용하되 `id=-1` 대신 대상 effect ID를 넣습니다. 일반적으로 effect를 정지·재시작하지 않지만 장치가 일부 parameter의 live update를 지원하지 않을 수 있습니다.

예를 들어 iforce 장치는 effect direction을 동적으로 바꿀 수 없어 driver가 effect를 정지하고 다시 upload한 뒤 재시작합니다. 재생 중 direction을 바꿀 때는 replay count 1로 재시작돼도 괜찮은 상황에서만 수행하는 것이 권장됩니다.

동적 갱신
작업`effect.id`Driver 동작
새 effect-1새 unique ID와 slot 할당
기존 effect update대상 ID가능하면 재생 중 parameter 갱신
지원하지 않는 parameter대상 IDStop, upload, restart 가능

새 effect와 기존 effect update의 ID 차이입니다.

Effect status가 바뀔 때 `EV_FF_STATUS` event가 전송됩니다. `time`은 변경 시각, `type`은 `EV_FF_STATUS`, `code`는 effect ID, `value`는 stopped 또는 playing 상태입니다.

Force-feedback status event
필드/값의미
`time`Effect status 변경 시각
`type = EV_FF_STATUS`Status event type
`code`Effect ID
`value = FF_STATUS_STOPPED`Effect stopped
`value = FF_STATUS_PLAYING`Effect started

`struct input_event` 필드와 상태 value입니다.

문서 작성 시점에는 status feedback을 iforce driver만 지원합니다. 다른 driver에 추가하려면 원문에 적힌 joystick mailing list 또는 담당자에게 사용 이유를 알려 달라고 안내합니다.

기존 effect 갱신과 상태 관찰
대상 effect ID를 구조체에 설정새 parameters로 `EVIOCSFF` 호출장치가 live update하면 재생 유지미지원 parameter이면 driver가 stop·upload·restart`EV_FF_STATUS`에서 ID와 playing/stopped 상태 수신

Live update가 불가능한 장치까지 포함한 흐름입니다.

Dynamic update of an effect
---------------------------

Proceed as if you wanted to upload a new effect, except that instead of
setting the id field to -1, you set it to the wanted effect id.
Normally, the effect is not stopped and restarted. However, depending on the
type of device, not all parameters can be dynamically updated. For example,
the direction of an effect cannot be updated with iforce devices. In this
case, the driver stops the effect, up-load it, and restart it.

Therefore it is recommended to dynamically change direction while the effect
is playing only when it is ok to restart the effect with a replay count of 1.

Information about the status of effects
---------------------------------------

Every time the status of an effect is changed, an event is sent. The values
and meanings of the fields of the event are as follows::

    struct input_event {
    /* When the status of the effect changed */
            struct timeval time;

    /* Set to EV_FF_STATUS */
            unsigned short type;

    /* Contains the id of the effect */
            unsigned short code;

    /* Indicates the status */
            unsigned int value;
    };

    FF_STATUS_STOPPED        The effect stopped playing
    FF_STATUS_PLAYING        The effect started to play

.. note::

    - Status feedback is only supported by iforce driver. If you have
      a really good reason to use this, please contact
      [email protected] or [email protected]
      so that support for it can be added to the rest of the drivers.