# USB HID Joystick Problems

## jgehrig

Hello, 

I am struggling to configure my PS3 controller (Which should be recognized as a generic HID device over usb) for my laptop...

I've found this page http://en.gentoo-wiki.com/wiki/Joystick and followed the instructions. I've installed the joystick ebuild and all of the required kernel modules.

The result is my controller seems to be mounting at /dev/usb/hiddev0. 

lsusb returns:

Bus 003 Device 004: ID 054c:0268 Sony Corp. Batoh Device

When I disconnect and reconnect the device the /dev/usb/hiddev0 input appears and disappears...

cat /dev/usb/hiddev0 returns long list of random scrolling character, but it doesn't seem to respond to button presses... It just constantly scrolls.

jstest /dev/usb/hiddev0 returns:

Driver version is 0.8.0.

Joystick (Unknown) has 2 axes ( axismap never defined )

and 2 buttons ( buttonmap never defined ).

Testing ... (interrupt to exit)

jstest: error reading: Invalid argument

I can't figure out what to do... I've used the controller before on my OpenSUSE box but it just worked once the joystick package was installed.

Am I missing something? How can I go about fixing this?

(As a side note has anyone got the controller working in Bluetooth mode in Gentoo? It seems that it requires the hidd daemon not hcid, but I have no idea where this would be found on the portage overlays. Has anyone posted anything specifically for gentoo?)

Thanks in advance

----------

## poly_poly-man

I've done it in usb mode consistently, and bluetooth once or twice (don't bother - it requires a million patches to everything).

Make sure you have the joystick driver to support usb hid joysticks - then, the device node you need will be along the lines of /dev/js0.

----------

## jgehrig

That is why I am so confused, I believe that I have all of the required parts enabled in my kernel.

These are installed:

Device Drivers -->

    HID Devices  --->

        <*>   USB Human Interface Device (full HID) support

    Input Device Support -->

        <*> Joystick Interface

        <*> Event Interface

I believe I have all of the required USB features, but I've never had a problem with usb.

As I said earlier the ebuild "joystick" is installed.

I also found that /dev/hidraw0 has the two analog directoinal controllers but it only has two buttons which show no change no matter what key is pressed.

/dev/usb/hiddev0 shows no changes it appears and dissapears but has no effect on jstest...

"dmesg|grep Joystick" reports:

[2.436839] sony 0003:054C:0268.0001: input,hiddev96,hidraw0: USB HID v1.11 Joystick [Sony PLAYSTATION(R)3 Controller] on usb-0000:00:1d.1-1/input0

[36745.327448] sony 0003:054C:0268.0002: input,hiddev96,hidraw0: USB HID v1.11 Joystick [Sony PLAYSTATION(R)3 Controller] on usb-0000:00:1d.1-1/input0

seems like /dev/usb/hiddev0 is raw output as I have that feature in my kernel.

I'm at a loss... I can't figure out what is going wrong.

----------

## poly_poly-man

Alright, so does /dev/input/js0 show up? that is what you want.

Also, just keep in mind that the buttons you may actually want to map (like the x/square/circle/triangle) are very high numbers - I had to modify the code of, for example, ppracer to support all the buttons I wanted.

----------

## jgehrig

/dev/input/js0 does not appear

/dev/js0 does not appear

/dev/hiddraw0 appears

/dev/usb/hiddev0 appears

joypad does not respond ot /dev/hidraw0 or /dev/usb/hiddev0 (joypad crashes due to a lack of config file at the end I'm currently working on fixing this and I'll update you if the problem goes away)

jstest /dev/hidraw0 results in a X and Y axis and two buttons (can't get buttons to respond analog sticks work fine)

I ran chmod 666 on /dev/hiddraw0 before testing joydev as everything in /dev is root owned on my machine... Is there anyway I can set it to mount with 666 permisions automaticaly? (My webcam has this problem too)

Does this help? Is this what you are looking for?

----------

## jgehrig

whoops!

when I said /dev/hiddraw0 I mean /dev/hidraw0 I kept using autocomplete and didn't realize it was raw

Sorry and thanks for the help

----------

## poly_poly-man

the problem is, while you're being exposed to the direct HID interfaces, you need the joydev interfaces to be able to do anything.

go to /dev and run 'find | grep js'

----------

## jgehrig

That returns nothing...

there is no /dev/js* or /dev/input/js* interface

----------

## jgehrig

I don't get it... I got it working temporarily when I tried to compile joydev as a module. The joystick worked between compiling and installing the joydev module and the reboot after the new kernel was updated. Once I rebooted the controller stoped working...

Any Ideas what's going on? With joydev running /dev/input/js0 appears but I get no response on button presses. /dev/hidraw0 shows the same thing. cat /dev/input/js0 shows some text but not neary as much as it should and it ceases almost instantly. cat /dev/hidraw0 shows nothing.

(As a side note I can get my controller to connect without patches to bluez-utils and all of the interfaces appear same problems as wired though no response from /dev/input/js0 or /dev/hidraw0)

I'm really confused....what is going on?

----------

## poly_poly-man

 *jgehrig wrote:*   

> I don't get it... I got it working temporarily when I tried to compile joydev as a module. The joystick worked between compiling and installing the joydev module and the reboot after the new kernel was updated. Once I rebooted the controller stoped working...
> 
> Any Ideas what's going on? With joydev running /dev/input/js0 appears but I get no response on button presses. /dev/hidraw0 shows the same thing. cat /dev/input/js0 shows some text but not neary as much as it should and it ceases almost instantly. cat /dev/hidraw0 shows nothing.
> 
> (As a side note I can get my controller to connect without patches to bluez-utils and all of the interfaces appear same problems as wired though no response from /dev/input/js0 or /dev/hidraw0)
> ...

 and the text within /dev/input/js0 - does it change when you attempt to push a button or something like that?

----------

## jgehrig

(In Wired Mode)

No nothing changes, it just freezes.

When the controller was working (when the joydev module was installed and the feature in the kernel installed) there was lots of scrolling text.

----------

## jgehrig

just to clarify here's what happens

cat /dev/input/js0

```

û9+û9+û9+û9+û9+û9+û9+û9+û9û9+   û9+

û9+

   û9+

û9+û9+û9+û9+û9+û9+û9+û9+û9+û9+û9+û9+û9+û9û9+    û9+

û9+

   û9+

û9+û9+û9+û9+û9+û9+û9+û9+û9+û9+û9+▒û9+û9+▒û9+

```

(It halts here until I press CTRL + C to end it)

cat /dev/input/js0

```

ìA,ìA,ìA,ìA,ìA,ìA,ìA,ìA,ìAìA,   ìA,

ìA,

   ìA,

ìA,ìA,ìA,ìA,ìA,ìA,ìA,ìA,ìA,ìA,ìA,ìA,ìA,ìAìA,    ìA,

ìA,

   ìA,

ìA,ìA,ìA,ìA,ìA,ìA,ìA,ìA,ìA,ìA,ìA,▒ìA,ìA,▒ìA,

```

(Same as above)

Each time i run "cat /dev/input/js0" there are different characters but it will always stop.

cat /dev/hidraw0 shows nothing.

I just upgraded to kernel 2.6.31-r6 (from 2.6.30-r8 ) I haven't found any changes yet...

I've tried this with 2 different controllers neither works, same problems.

Any suggestions or things to try would be appreciated, thanks.

----------

## Xamindar

You are pressing the PS button to turn the controller "on" right?

----------

