Skip to contentSkip to conversation

force feedback envelope incomplete

DISCUSSION [email protected] 3 participants 4 messages Oct 15, 2005 – Oct 17, 2005

lore
Share & tools
lore
#0 lore raw

HI

Force feedback envelope struct in input.h
for periodic events is incomplete.

struct ff_envelope {

        __u16 attack_length;    /* Duration of attack (ms) */
        __u16 attack_level;     /* Level at beginning of attack */
        __u16 fade_length;      /* Duration of fade (ms) */
        __u16 fade_level;       /* Level at end of fade */

};

The envelope consists of:
1. Attack level (Level at beginning of attack)
2. Attack time
3. Sustain level (Level at end of attack and beginning of fade)
4. Sustain time
5. Fade level (Level at the end of fade)
6. Fade time

If I want to implement proper envelope I propose something like this:

struct ff_envelope {

        __u16 attack_length;    /* Duration of attack (ms) */
        __u16 attack_level;     /* Level at beginning of attack */
        __u16 sustain_length;   /* Duration of sustain (ms) */
        __u16 sustain_level;    /* Sustain Level at end of attack and beginning of fade */
        __u16 fade_length;      /* Duration of fade (ms) */
        __u16 fade_level;       /* Level at end of fade */

};

#1 lore raw
Quoted 22 lines · On Saturday 15 October 2005 16:39, [email protected] wrote:

HI

Force feedback envelope struct in input.h
for periodic events is incomplete.

struct ff_envelope {

        __u16 attack_length;    /* Duration of attack (ms) */
        __u16 attack_level;     /* Level at beginning of attack */
        __u16 fade_length;      /* Duration of fade (ms) */
        __u16 fade_level;       /* Level at end of fade */

};

The envelope consists of:
1. Attack level (Level at beginning of attack)
2. Attack time
3. Sustain level (Level at end of attack and beginning of fade)
4. Sustain time
5. Fade level (Level at the end of fade)
6. Fade time

If I want to implement proper envelope I propose something like this:

Quoted 8 lines

struct ff_envelope {

        __u16 attack_length;    /* Duration of attack (ms) */
        __u16 attack_level;     /* Level at beginning of attack */
        __u16 sustain_length;   /* Duration of sustain (ms) */
        __u16 sustain_level;    /* Sustain Level at end of attack and beginning of fade */
        __u16 fade_length;      /* Duration of fade (ms) */
        __u16 fade_level;       /* Level at end of fade */

};

You might want to talk to Vojtech about this (CC-ed).

Signature · 1 line
Dmitry
#2 lore raw
Quoted 32 lines · Dmitry Torokhov
Quoted 22 lines · On Saturday 15 October 2005 16:39, [email protected] wrote:

HI

Force feedback envelope struct in input.h
for periodic events is incomplete.

struct ff_envelope {

        __u16 attack_length;    /* Duration of attack (ms) */
        __u16 attack_level;     /* Level at beginning of attack */
        __u16 fade_length;      /* Duration of fade (ms) */
        __u16 fade_level;       /* Level at end of fade */

};

The envelope consists of:
1. Attack level (Level at beginning of attack)
2. Attack time
3. Sustain level (Level at end of attack and beginning of fade)
4. Sustain time
5. Fade level (Level at the end of fade)
6. Fade time

If I want to implement proper envelope I propose something like this:

Quoted 8 lines

struct ff_envelope {

        __u16 attack_length;    /* Duration of attack (ms) */
        __u16 attack_level;     /* Level at beginning of attack */
        __u16 sustain_length;   /* Duration of sustain (ms) */
        __u16 sustain_level;    /* Sustain Level at end of attack and beginning of fade */
        __u16 fade_length;      /* Duration of fade (ms) */
        __u16 fade_level;       /* Level at end of fade */

};

Quoted 1 line

You might want to talk to Vojtech about this (CC-ed).

Your proposal seems reasonable. Please send me a patch that adds the sustain members to the envelope, and uses it in some driver, while making sure existing binary-only apps (if there are any) don't break.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#3 lore raw
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines

struct ff_envelope {

        __u16 attack_length;    /* Duration of attack (ms) */
        __u16 attack_level;     /* Level at beginning of attack */
        __u16 sustain_length;   /* Duration of sustain (ms) */
        __u16 sustain_level;    /* Sustain Level at end of attack and beginning of fade */
        __u16 fade_length;      /* Duration of fade (ms) */
        __u16 fade_level;       /* Level at end of fade */

};

Quoted 5 lines
Quoted 1 line

You might want to talk to Vojtech about this (CC-ed).

Your proposal seems reasonable. Please send me a patch that adds the sustain members to the envelope, and uses it in some driver, while making sure existing binary-only apps (if there are any) don't break.

I have thought about this.

I can not imagine ANY existing driver supporting such envelope other than using this 64 bit field as a binary container for it's private interpretation of the mechanical vibration envelope.

We may not go too far on with supporting such software (I even don't know of any).

So we actually need this

struct ff_envelope {

__u16  attack_length;
__u16  attack_level;    /* level at the beginning of attack */
__u16  decay_length;
__u16  decay_level;     /* level at the beginning of decay */
__u16  sustain_length;
__u16  sustain_level;   /* level at the end of decay and beginning of fade */
__u16  fade_length;
__u16  fade_level;      /* level at the end of fade */

};

WHY:

*** About the vibration envelope ***

As I understand the envelope, it's there to simulate physical behaviour of transient vibrations of a string when triggered.

Such envelope has ATTACK, DECAY, SUSTAIN and FADE. (ADSF)

Microsoft simplified this by implementing only
ATTACK, SUSTAIN and FADE (ASF).

But what linux has? Attack and fade without sustain. That is slighty out of sense, because in this case we can not calculate the SLOPES of the attack and fade, making them out of sense too.

I would use attack, decay sustain and fade. That's
the way synthesizers handle triggered wire vibrations like in guitars or pianos.
ASF may be sufficient only for short length of low frequency vibrations <50Hz. Some joysticks are capable only of that. But for frequencies >100 Hz, like tactile mice, ADSF envelope can produce additional exciting vibrant feel and sophisticated vibrations over high dynamic range making it very realistic. That makes much difference compared to those crippled ASF only envelopes.