public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* force feedback envelope incomplete
@ 2005-10-15 21:39 emard
  2005-10-16 18:35 ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: emard @ 2005-10-15 21:39 UTC (permalink / raw)
  To: linux-kernel

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 */
};

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: force feedback envelope incomplete
  2005-10-15 21:39 force feedback envelope incomplete emard
@ 2005-10-16 18:35 ` Dmitry Torokhov
  2005-10-17 11:42   ` Vojtech Pavlik
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2005-10-16 18:35 UTC (permalink / raw)
  To: linux-kernel; +Cc: emard, Vojtech Pavlik

On Saturday 15 October 2005 16:39, emard@softhome.net 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:
> 
> 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).

-- 
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: force feedback envelope incomplete
  2005-10-16 18:35 ` Dmitry Torokhov
@ 2005-10-17 11:42   ` Vojtech Pavlik
  2005-10-17 22:21     ` emard
  0 siblings, 1 reply; 4+ messages in thread
From: Vojtech Pavlik @ 2005-10-17 11:42 UTC (permalink / raw)
  To: emard; +Cc: linux-kernel, dtor_core

On Sun, Oct 16, 2005 at 01:35:47PM -0500, Dmitry Torokhov wrote:
> On Saturday 15 October 2005 16:39, emard@softhome.net 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:
> > 
> > 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).
 
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.

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: force feedback envelope incomplete
  2005-10-17 11:42   ` Vojtech Pavlik
@ 2005-10-17 22:21     ` emard
  0 siblings, 0 replies; 4+ messages in thread
From: emard @ 2005-10-17 22:21 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: linux-kernel

> > > 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).
>  
> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-10-17 22:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-15 21:39 force feedback envelope incomplete emard
2005-10-16 18:35 ` Dmitry Torokhov
2005-10-17 11:42   ` Vojtech Pavlik
2005-10-17 22:21     ` emard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox