After reading an interesting post from this blog:
http://blog.robothaus.org/2011/12/09/gamepad-vibration-zero-to-hero/, I managed to make my X-Box 360 controller vibrate from the terminal!
Here's what I did for those who are interested:
1) I installed the "joystick" package on my Ubuntu 12.04
sudo apt-get install joystick
2)Find on which input is the joystick connected to:
dmesg | grep X-Box
[ 9191.142998] input: Microsoft X-Box 360 pad as /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/input/input22
3)Run fftest on the corresponding event (22 in my case).
(Warning you might need to use sudo for this, but I didn't)
fftest /dev/input/event22
Force feedback test program.
HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES
Device /dev/input/event22 opened
Axes query:
Effects: Periodic Rumble
Number of simultaneous effects: 16
Upload effects[1]: Invalid argument
Upload effects[2]: Invalid argument
Upload effects[3]: Invalid argument
Enter effect number, -1 to exit
4) Try some effects (up to 16 apparently)
In my case only effect 4 (strong rumble) and effect 5 (weak rumble) worked.
This is good news, even if I'm still far from having joystick vibration in the game, now I know it's possible! Now I need to see if I can make the joystick vibrate from C++ without doing system calls!
Nick