Re: Adding force feedback for a gamepad (146b:0902 BigBen Interactive Kid-friendly Wired Controller PS3OFMINIPAD SONY)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, April 4, 2018 7:50 am, Hanno Zulla wrote:

> Adding its USB id to hid-sony.c and the relevant section of hid-core.c
> was not successful.

Hi Hanno,
I was going to comment/ask whether you had changed _BOTH_ hid-core and
hid-sony (as that's something I screwed up before). Seems that you did,
are you 100% sure the driver is loading?

Try 'rmmod hid-sony' and monitor syslog on plugging device in.


> When using hid-sony.c as a driver, the device isn't fully working
> anymore (the d-pad stops responding, while the buttons and analog axis
> still do).

Do you still get the data stream the device when using 'hid-sony'. You can
view the raw data with something like:

$ hexdump -v -e '10/1 "%02x " "\n"' < /dev/hidraw0


> Using hid-sony.c, the force feedback interface of the driver is offered
> to fftest, but does nothing on the controller, no rumble.

It may be that the device needs to define some quirk(s) or bring-up in
order to have the controller function correctly. You could try tweaking
the driver...

Or you can unbind the driver and experiment directly on it. Easier than
trying to debug 'in kernel'. I've done this sort of thing before in
python, small script attached which might get you going.

Good luck,
Simon.
#!/usr/bin/python
#
# Small script to test autocenter behaviour on Logitech wheels
#

import usb
import time
import binascii

wheel = 0
endpoint = 0x01

busses = usb.busses()
for bus in busses:      
  devices = bus.devices   
  for dev in devices:
    if dev.idVendor == 0x046d and dev.idProduct == 0xc261:
      print "Found Wheel = G920 Driving Force Racing Wheel for Xbox One"
      wheel = dev

if wheel == 0:
  print "wheel not found"
  exit(0)

# Get a device handler for the usb device and detach it from the kernel
dh = wheel.open()
try:
	dh.detachKernelDriver(0)
except:
	print "Already detached?"
dh.claimInterface(0)

command='\x0f\x00\x01\x01\x42'
print "Switching to HID mode (", binascii.hexlify(command), ")"
dh.bulkWrite(endpoint, command, 1000000)

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux