Joystick (SideWinder FF2) Force Feedback doesn't reset properly

Bug #1035723 reported by bra1nDeaD
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Expired
Medium
Unassigned

Bug Description

I've been trying to get the FF to work on my SideWinder Force Feedback 2 joystick without success so far.

This is what I get when I try to test it:
[code]
~$ sudo fftest /dev/input/event4
Force feedback test program.
HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES

Device /dev/input/event4 opened
Axes query:
Effects: Constant Periodic Spring Friction
Number of simultaneous effects: 0
Upload effects[0]: Function not implemented
Upload effects[1]: Function not implemented
Upload effects[2]: Function not implemented
Upload effects[3]: Function not implemented
Upload effects[4]: Function not implemented
Upload effects[5]: Function not implemented
Enter effect number, -1 to exit
[/code]

When I try any of the effects it does not do anything.

When I plug it in the USB port it shows this in the 'dmesg' output:
[code]
[ 170.280024] usb 4-2: new full-speed USB device number 2 using uhci_hcd
[ 170.489878] input: Microsoft SideWinder Force Feedback 2 Joystick as /devices/pci0000:00/0000:00:1a.1/usb4/4-2/4-2:1.0/input/input4
[ 170.521795] generic-usb 0003:045E:001B.0003: device reports 0 simultaneous effects
[ 170.582764] generic-usb 0003:045E:001B.0003: pid_block_load failed 60 times
[ 170.582768] generic-usb 0003:045E:001B.0003: upload request failed
[ 170.582774] generic-usb 0003:045E:001B.0003: input,hidraw2: USB HID v1.00 Joystick [Microsoft SideWinder Force Feedback 2 Joystick] on usb-0000:00:1a.1-2/input0
[/code]

This tells me that the kernel modules are present and being executed. It's using the 'hid-pidff' driver and I found that the message about '0 simultaneous effects' is generated here:
file: drivers/hid/usbhid/hid-pidff.c
line: 1178, function pidff_reset

From the code I can see it should at least find 2 simultaneous effects, but it finds none and after 20 retries it fails and continues.

After this, I leave my comfort zone, but I am happy to debug (with some assistance) and try anything out. Maybe you'll be able to convert me from being a Windows developer to a Linux developer :)

Cheers

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: linux-image-3.2.0-29-generic 3.2.0-29.46
ProcVersionSignature: Ubuntu 3.2.0-29.46-generic 3.2.24
Uname: Linux 3.2.0-29-generic i686
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
ApportVersion: 2.0.1-0ubuntu12
Architecture: i386
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: AD198x Analog [AD198x Analog]
   Subdevices: 2/2
   Subdevice #0: subdevice #0
   Subdevice #1: subdevice #1
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: marijn 1970 F.... pulseaudio
 /dev/snd/pcmC0D0p: marijn 1970 F...m pulseaudio
CRDA: Error: command ['iw', 'reg', 'get'] failed with exit code 1: nl80211 not found.
Card0.Amixer.info:
 Card hw:0 'Intel'/'HDA Intel at 0xfe9dc000 irq 44'
   Mixer name : 'Analog Devices AD1984'
   Components : 'HDA:11d41984,10280211,00100400'
   Controls : 30
   Simple ctrls : 18
Date: Sat Aug 11 20:33:24 2012
HibernationDevice: RESUME=UUID=d05e0608-7ccc-4d87-ac0c-994266652f47
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110427.1)
IwConfig:
 lo no wireless extensions.

 virbr0 no wireless extensions.

 eth0 no wireless extensions.
MachineType: Dell Inc. OptiPlex 755
ProcEnviron:
 LANGUAGE=en_GB:en
 TERM=xterm
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.2.0-29-generic root=UUID=99e917a5-032c-416b-ab03-af8b02651198 ro crashkernel=384M-2G:64M,2G-:128M quiet splash vt.handoff=7
RelatedPackageVersions:
 linux-restricted-modules-3.2.0-29-generic N/A
 linux-backports-modules-3.2.0-29-generic N/A
 linux-firmware 1.79
RfKill:

SourcePackage: linux
UpgradeStatus: Upgraded to precise on 2012-04-25 (108 days ago)
dmi.bios.date: 05/31/2011
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A19
dmi.board.name: 0PU052
dmi.board.vendor: Dell Inc.
dmi.chassis.type: 15
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.:bvrA19:bd05/31/2011:svnDellInc.:pnOptiPlex755:pvr:rvnDellInc.:rn0PU052:rvr:cvnDellInc.:ct15:cvr:
dmi.product.name: OptiPlex 755
dmi.sys.vendor: Dell Inc.

Revision history for this message
bra1nDeaD (g-m-wijbenga) wrote :
Brad Figg (brad-figg)
Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
bra1nDeaD (g-m-wijbenga) wrote :

As the reset code states: "pool report is sometimes messed up, refetch it" (hence the 20 times retry count) I thought I would make the retry count 200 to make sure this was not the issue. Recompiled the kernel, reboot and retested. But.... no luck, still buggered after 200 'pool' requests.

Anyone else any ideas what I could try?

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please test the latest v3.5kernel[0] (Not a kernel in the daily directory) and install both the linux-image and linux-image-extra .deb packages.

Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag. Please only remove that one tag and leave the other tags. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text.

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

If you are unable to test the mainline kernel, for example it will not boot, please add the tag: 'kernel-unable-to-test-upstream'.
Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.

[0] http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.6-rc1-quantal/

tags: added: needs-upstream-testing
Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Incomplete
Revision history for this message
bra1nDeaD (g-m-wijbenga) wrote :

Thanks.

I've downloaded and installed these packages from "http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.5.1-quantal/"
    linux-image-extra-3.5.1-030501-generic_3.5.1-030501.201208091310_i386.deb
    linux-image-3.5.1-030501-generic_3.5.1-030501.201208091310_i386.deb

And from "from: http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/current/"
    linux-image-3.6.0-999-generic_3.6.0-999.201208130420_i386.deb
    linux-image-extra-3.6.0-999-generic_3.6.0-999.201208130420_i386.deb

Then rebooted twice; first time in 3.6 and the second time in 2.5.1. Both times it it gave the same results: 0 simultaneous effects, though 'dmesg' gave slightly more output on both instances:
[code]
[   96.428015] usb 4-1: new full-speed USB device number 2 using uhci_hcd
[   96.605804] usb 4-1: New USB device found, idVendor=045e, idProduct=001b
[   96.605808] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   96.605810] usb 4-1: Product: SideWinder Force Feedback 2 Joystick
[   96.605813] usb 4-1: Manufacturer: Microsoft
[   96.635858] input: Microsoft SideWinder Force Feedback 2 Joystick as /devices/pci0000:00/0000:00:1a.1/usb4/4-1/4-1:1.0/input/input4
[   96.670772] hid-generic 0003:045E:001B.0003: device reports 0 simultaneous effects
[   96.735739] hid-generic 0003:045E:001B.0003: pid_block_load failed 60 times
[   96.735742] hid-generic 0003:045E:001B.0003: upload request failed
[   96.735748] hid-generic 0003:045E:001B.0003: input,hidraw2: USB HID v1.00 Joystick [Microsoft SideWinder Force Feedback 2 Joystick] on usb-0000:00:1a.1-1/input0
[/code]

So it hasn't been fixed yet. What's the next step?

Much appreciated.

tags: added: kernel-bug-exists-upstream
removed: needs-upstream-testing
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
bra1nDeaD (g-m-wijbenga) wrote :
Download full text (7.7 KiB)

Ok, I've turned on any logging I could find and here is a more detailed output:

[code]
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.408017] usb 4-1: new full-speed USB device number 3 using uhci_hcd
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.588880] drivers/hid/usbhid/hid-core.c: HID probe called for ifnum 0
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.613231] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0101 wIndex=0x0000 wLength=1
3
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.613807] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0102 wIndex=0x0000 wLength=3
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.614806] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0301 wIndex=0x0000 wLength=4
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.615805] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0302 wIndex=0x0000 wLength=5
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.616805] drivers/hid/usbhid/hid-core.c: submitting ctrl urb: Get_Report wValue=0x0303 wIndex=0x0000 wLength=5
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.617878] input: Microsoft SideWinder Force Feedback 2 Joystick as /devices/pci0000:00/0000:00:1a.1/usb4/4-1/4
-1:1.0/input/input5
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.617999] generic-usb 0003:045E:001B.0004: starting pid init
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.618003] generic-usb 0003:045E:001B.0004: found usage 0x21 from field->logical
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.618005] generic-usb 0003:045E:001B.0004: found usage 0x5a from field->logical
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.618008] generic-usb 0003:045E:001B.0004: found usage 0x5f from field->logical
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.618011] generic-usb 0003:045E:001B.0004: found usage 0x6e from field->logical
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.618013] generic-usb 0003:045E:001B.0004: found usage 0x73 from field->logical
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.618016] generic-usb 0003:045E:001B.0004: found usage 0x74 from field->logical
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.618018] generic-usb 0003:045E:001B.0004: found usage 0x77 from field->logical
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.618021] generic-usb 0003:045E:001B.0004: found usage 0x90 from field->logical
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.618024] generic-usb 0003:045E:001B.0004: found usage 0x96 from field->logical
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.618026] generic-usb 0003:045E:001B.0004: found usage 0x7d from field->logical
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.618029] generic-usb 0003:045E:001B.0004: found usage 0xab from collection array
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.618031] generic-usb 0003:045E:001B.0004: found usage 0x89 from field->logical
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.618034] generic-usb 0003:045E:001B.0004: found usage 0x7f from field->logical
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.618038] generic-usb 0003:045E:001B.0004: finding special fields
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.618040] generic-usb 0003:045E:001B.0004: search done
Aug 14 00:00:23 PC-MARIJN kernel: [ 180.618046] drivers/hid/usbhid/hid-core.c: submitting out urb
Aug 14 00:00:23 PC-MARIJN ...

Read more...

Revision history for this message
penalvch (penalvch) wrote :

bra1nDeaD, as per http://www.dell.com/support/troubleshooting/us/en/19/Product/optiplex-755 an update is available for your BIOS (A22). If you update to this, does it change anything?

If not, could you please both specify what happened, and provide the output of the following terminal command:
sudo dmidecode -s bios-version && sudo dmidecode -s bios-release-date

Thank you for your understanding.

tags: added: bios-outdated-a22 needs-upstream-testing regression-potential
removed: feedback ff force hid-pidff joystick kernel
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
Martin Becker (vbmazter)
Changed in linux (Ubuntu):
status: Expired → New
Revision history for this message
Martin Becker (vbmazter) wrote :

In kernel 3.13.0 I still have the same issues. So I also did some debugging. Major findings:

- in hid-core.c the function usbhid_parse() is called after the joystick is attached
- usbhid_parse() calls function hid_set_idle(), and this one fails while sending an URB (details see below). Reason: the joystick returns -EPIPE.
- Same thing can be seen, if Wireshark is used to look at the traffic
- According to the documentation, EPIPE means "Endpoint stalled". It furthermore says: "For non-control endpoints, reset this status with usb_clear_halt()."

Unfortunately the return value is not checked in the kernel module. I added this check, and tried to do a "usb_clear_halt". However, I cannot quiet understand how things work in the code, and all my trials ended in crashing the kernel.

---
hid-core.c:usbhid_parse:1006, ret=2
    hid-core.c:hid_set_idle:669
        message.c:usb_control_msg:132
            message.c:usb_internal_control_msg:81
                usb_start_wait_urb: 44
                    submits URB and waits for response with a timeout

                    not: ret = usb_submit_urb() -> ret is zero
                    *actual_length = 1
                    ctx: struct api_context { .done:struct completion, .status:int }
                        completion: struct { done: uint, wait: wait_queue_head_t }
                    expire = msec_to_jiffies(5000) = 1250
                    not: ret = ctx.status or -ETIMEDOUT, since dev_dbg does not appear

                    ret = ctx.status -> so the -32 is ctx.status. This is "broken pipe", as seen in the Wireshark trace
---

Revision history for this message
Martin Becker (vbmazter) wrote :

Wireshark capture of EPIPE

Revision history for this message
Brad Figg (brad-figg) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Martin Becker (vbmazter) wrote :

Just found out, that it is an upstream bug. The force feedback works in 2.6.38-12.

Revision history for this message
penalvch (penalvch) wrote :

Martin Becker, thank you for your comment. So your hardware and problem may be tracked, could you please file a new report with Ubuntu by executing the following in a terminal while booted into the default Ubuntu kernel (not a mainline one) via:
ubuntu-bug linux

For more on this, please read the official Ubuntu documentation:
Ubuntu Bug Control and Ubuntu Bug Squad: https://wiki.ubuntu.com/Bugs/BestPractices#X.2BAC8-Reporting.Focus_on_One_Issue
Ubuntu Kernel Team: https://wiki.ubuntu.com/KernelTeam/KernelTeamBugPolicies#Filing_Kernel_Bug_reports
Ubuntu Community: https://help.ubuntu.com/community/ReportingBugs#Bug_reporting_etiquette

When opening up the new report, please feel free to subscribe me to it.

As well, please do not announce in this report you created a new bug report.

Thank you for your understanding.

Helpful bug reporting tips:
https://wiki.ubuntu.com/ReportingBugs

Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Jim Keir (jimkeir) wrote :

Proposed patch to get the Microsoft Sidewinder Force Feedback 2 working.

Three bugs are addressed:

1) The FF2 driver (usbhid/hid-pidff.c) sends commands to the stick during ff_init. However, this is called inside a block where driver_input_lock is locked, so the results of these initial commands are discarded. This one is the "killer", without this nothing else works.

2) The usbhid driver ignores an endpoint stall when sending control commands, causing the first few commands of the hid-pidff.c initialisation to get lost.

3) The FF2 driver does not set the effect ID when uploading an effect. The result is that the initial upload works but subsequent uploads to modify effect parameters are all directed at the last-created effect.

Patch created against kernel 3.13.0 .

Revision history for this message
penalvch (penalvch) wrote :

Jim Keir, as per http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/MAINTAINERS you would want to redirect your patch upstream to the linux-input mailing list, CC Jiri Kosina.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.