You are not logged in.
Hello,
I want the system to automatically calibrate my gamepad whenever I plug it in. As adviced in the Wiki (https://wiki.archlinux.org/index.php/Ga … alibration), I've written a udev rule:
florian@flobox:~$ cat /etc/udev/rules.d/85-jscal.rules
SUBSYSTEM=="input", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="028e", ATTRS{serial}=="1E6674E", ACTION=="add", RUN+="jscal -s 8,1,0,-5000,4500,19423,19078,1,0,-5500,128,19781,16513,1,0,127,127,4227201,4227201,1,0,-4000,5500,18745,19781,1,0,-3000,3000,18113,18113,1,0,127,127,4227201,4227201,1,0,0,0,536854528,536854528,1,0,0,0,536854528,536854528 /dev/input/by-id/usb-©Microsoft_Corporation_Controller_1E6674E-joystick"
It seems udev doesn't run the jscal command as my gamepad isn't calibrated when I plug in it.
The attributes seem correct though:
florian@flobox:~$ udevadm info --attribute-walk --name /dev/input/by-id/usb-©Microsoft_Corporation_Controller_1E6674E-joystick
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input15/js0':
KERNEL=="js0"
SUBSYSTEM=="input"
DRIVER==""
looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input15':
KERNELS=="input15"
SUBSYSTEMS=="input"
DRIVERS==""
ATTRS{name}=="Microsoft X-Box 360 pad"
ATTRS{phys}=="usb-0000:00:1a.0-1.1/input0"
ATTRS{uniq}==""
ATTRS{properties}=="0"
looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0':
KERNELS=="1-1.1:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="xpad"
ATTRS{bInterfaceClass}=="ff"
ATTRS{bInterfaceSubClass}=="5d"
ATTRS{bInterfaceProtocol}=="01"
ATTRS{bNumEndpoints}=="02"
ATTRS{supports_autosuspend}=="0"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bInterfaceNumber}=="00"
looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1':
KERNELS=="1-1.1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="ff"
ATTRS{bDeviceProtocol}=="ff"
ATTRS{devpath}=="1.1"
ATTRS{idVendor}=="045e"
ATTRS{speed}=="12"
ATTRS{bNumInterfaces}==" 4"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="8"
ATTRS{busnum}=="1"
ATTRS{devnum}=="3"
ATTRS{configuration}==""
ATTRS{bMaxPower}=="500mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="a0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="0"
ATTRS{bcdDevice}=="0114"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{serial}=="1E6674E"
ATTRS{version}==" 2.00"
ATTRS{urbnum}=="1081"
ATTRS{ltm_capable}=="no"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="028e"
ATTRS{bDeviceClass}=="ff"
ATTRS{product}=="Controller"
looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1':
KERNELS=="1-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="01"
ATTRS{devpath}=="1"
ATTRS{idVendor}=="8087"
ATTRS{speed}=="480"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{busnum}=="1"
ATTRS{devnum}=="2"
ATTRS{configuration}==""
ATTRS{bMaxPower}=="0mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="6"
ATTRS{bcdDevice}=="0000"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{version}==" 2.00"
ATTRS{urbnum}=="50"
ATTRS{ltm_capable}=="no"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="0020"
ATTRS{bDeviceClass}=="09"
looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1':
KERNELS=="usb1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{devpath}=="0"
ATTRS{idVendor}=="1d6b"
ATTRS{speed}=="480"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{authorized_default}=="1"
ATTRS{busnum}=="1"
ATTRS{devnum}=="1"
ATTRS{configuration}==""
ATTRS{bMaxPower}=="0mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="2"
ATTRS{bcdDevice}=="0314"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{serial}=="0000:00:1a.0"
ATTRS{version}==" 2.00"
ATTRS{urbnum}=="24"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="Linux 3.14.43-2-lts ehci_hcd"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="0002"
ATTRS{bDeviceClass}=="09"
ATTRS{product}=="EHCI Host Controller"
looking at parent device '/devices/pci0000:00/0000:00:1a.0':
KERNELS=="0000:00:1a.0"
SUBSYSTEMS=="pci"
DRIVERS=="ehci-pci"
ATTRS{irq}=="16"
ATTRS{subsystem_vendor}=="0x1043"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x0c0320"
ATTRS{companion}==""
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{dma_mask_bits}=="32"
ATTRS{local_cpus}=="00000000,00000000,00000000,0000000f"
ATTRS{device}=="0x3b3c"
ATTRS{uframe_periodic_max}=="100"
ATTRS{enable}=="1"
ATTRS{msi_bus}==""
ATTRS{local_cpulist}=="0-3"
ATTRS{vendor}=="0x8086"
ATTRS{subsystem_device}=="0x8383"
ATTRS{numa_node}=="-1"
ATTRS{d3cold_allowed}=="1"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
I must be missing something basic. I've even tried and removed all the attributes, but it didn't help.
What did I do wrong?
Last edited by monsieur moche (2015-06-09 20:43:32)
Offline
You didn't follow the rules.
RUN{type} Add a program to the list of programs to be executed after processing all the rules for a specific event, depending on "type": "program" Execute an external program specified as the assigned value. If no absolute path is given, the program is expected to live in /usr/lib/udev; otherwise, the absolute path must be specified. This is the default if no type is specified. [...]
Offline
OK! I've prefixed jscal with /usr/bin and now it works perfectly. Thank you very much!
Offline