STRUCT FF_PERIODIC_EFFECT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct ff_periodic_effect(9) πŸ’–

okay bestie, so this one's from the Kernel API Manual and it's literally the blueprint for a periodic force-feedback effect β€” like, the rumble that goes brrrr in a wave pattern instead of just one sad little buzz πŸŒ€βœ¨


🌸 SYNOPSIS 🌸

here's the struct, exactly as it lives, no cap:

struct ff_periodic_effect {
    __u16 waveform;
    __u16 period;
    __s16 magnitude;
    __s16 offset;
    __u16 phase;
    struct ff_envelope envelope;
    __u32 custom_len;
    __s16 __user *custom_data;
 };

πŸŽ€ Members πŸŽ€

  • waveform β€” what kind of effect this is (the wave). the vibe selector, basically πŸ‘‘
  • period β€” how long one cycle of the wave takes, in ms
  • magnitude β€” the peak value, i.e. how hard it goes πŸ”₯
  • offset β€” the mean value of the wave (roughly). yes, roughly, they said it not me πŸ™ˆ
  • phase β€” (that's it, that's the whole description in the original, she's mysterious, main character energy fr)
  • envelope β€” envelope data πŸŽ€
  • custom_len β€” number of samples (FF_CUSTOM only)
  • custom_data β€” buffer of samples (FF_CUSTOM only)

πŸ’… Description πŸ’…

the known waveforms are: FF_SQUARE, FF_TRIANGLE, FF_SINE, FF_SAW_UP, FF_SAW_DOWN, FF_CUSTOM. iconic lineup, honestly 🌈

heads up though β€” the exact syntax of FF_CUSTOM is undefined for the time being, because no driver supports it yet. so don't go building your whole personality around it, bestie, it's giving "coming soon" πŸ’€

✨ Note ✨

the data pointed to by custom_data gets copied by the driver. which means β€” and this is the slay part β€” you can totally dispose of that memory after the upload/update 🫢 no lingering attachments, we love a clean breakup.


πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./include/uapi/linux/input.h
  • struct input_absinfo(9)
  • struct input_keymap_entry(9)
  • EVIOCGMTSLOTS(9)
  • EVIOCGMASK(9)
  • EVIOCSMASK(9)
  • struct ff_replay(9)
  • struct ff_trigger(9)
  • struct ff_envelope(9)
  • struct ff_constant_effect(9)
  • struct ff_ramp_effect(9)
  • struct ff_condition_effect(9)
  • struct ff_rumble_effect(9)
  • struct ff_haptic_effect(9)
  • struct ff_effect(9)

and that's the whole page, bestie πŸ’– it lives in ./include/uapi/linux, the version is October 2026, and the title is struct ff_periodic_effect(9) β€” go forth and make things vibrate on purpose πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from