You are not logged in.

#1 2007-04-06 14:10:06

mienensuchkind
Member
Registered: 2007-01-21
Posts: 61

Xbox Gamepad

Hi,
Today i had the idea to plug my old xbox-gamepad via usb to my musicstation (mpd+ncmpc).
I want to control ncmpc with that pad, but it just doesn't work sad
What i did:
modprobe xpad #The xbox pad module, afaik
modprobe joydev #Module fore Joysticks 'n' Gamepad Stuff

now i have my /dev/input/js0

if i
cat  /dev/input/js0
i only get

xubxubxubxubxubxubxubxubxubxub    xubxubxubxubxubxubxubxub

Which is very crappy.... when im now hacking on my buttons nothing happens sad

i tryed jstest, too... this gives me

Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:on   4:off  5:off  6:off  7:off  8:off  9Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:on   4:off  5:off  6:off  7:off  8:off  9Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:on   4:off  5:off  6:off  7:off  8:off  9Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9Axes:  0:     0  1:     0  2:-32767  3:     0  4:     0  5:     0  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9Axes:  0:     0  1:     0  2:-32767  3:     0  4:     0  5:     0  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9Axes:  0:     0  1:     0  2:-32767  3:     0  4:     0  5:     0  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9Axes:  0:     0  1:     0  2:-32767  3:     0  4:     0  5:-32767  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9Axes:  0:     0  1:     0  2:-32767  3:     0  4:     0  5:-32767  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9Axes:  0:     0  1:     0  2:-32767  3:     0  4:     0  5:-32767  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off

which doesn't help me, either.

What else can i try?

Offline

#2 2007-04-07 00:39:11

mezoko
Member
Registered: 2005-03-26
Posts: 310
Website

Re: Xbox Gamepad

Well it seems like you device works.
IIRC supertux is able to use a joystick, so you might try supertux, and see if your joystick works


"The only thing we have to fear is fear itself." - Franklin D. Roosevelt

Offline

#3 2007-04-07 11:03:38

mienensuchkind
Member
Registered: 2007-01-21
Posts: 61

Re: Xbox Gamepad

supertux doesn't recognize my gamepad, either.. sad

Offline

#4 2007-06-08 19:20:35

ChrisX
Member
Registered: 2004-05-13
Posts: 27

Re: Xbox Gamepad

I was able to get my xbox 360 usb controller to work with supertux as well as zsnes.  Here is how I did it.  First, get the newer xpad driver:

wget http://xbox-linux.cvs.sourceforge.net/* … put/xpad.c
wget http://xbox-linux.cvs.sourceforge.net/* … put/xpad.h

I just created a directory named xpad and put these two files in it.  Then create a new text file called Makefile like so.

vi Makefile

and put the following line of text into it

obj-m := xpad.o

You should also be able to use nano if you don't like vi.  Then at the command line give the following command.

make -C /usr/src/linuxDir/ M=`pwd` modules

where linuxDir is the directory of the linux kernel header files.  For me (as of 6/8/07) it is /usr/src/linux-2.6.21-ARCH/.  This directory will change as new linux kernels are released, so make sure you put the right one in for your system.  You can check by doing

ls /usr/src.

After typing the make command, there will be a collection of files; look for the one called xpad.ko.  You then su to root, go to the directory where the xpad.ko file is and type

modprobe joydev
modprobe usbhid
insmod ./xpad.ko

Now plug your 360 controller into a usb port and open supertux.  You should be able to click on Options and the joystick options and set buttons from the controller for the game.  I also use this setup to work with the zsnes super nintendo game emulator.  It should work for many other games also.  I hope some of you find this helpful.

-Chris

Offline

#5 2007-11-08 01:47:19

MindlessXD
Member
Registered: 2007-11-08
Posts: 18

Re: Xbox Gamepad

I'm having problems with this module (compiled from CVS)... upon plugging in a Xbox 360 Guitar Hero controller, I get the following

input: RedOctane Guitar Hero X-plorer as /devices/pci0000:00/0000:00:13.2/usb3/3-2/3-2:1.0/input/input7
input: RedOctane Guitar Hero X-plorer as /devices/pci0000:00/0000:00:13.2/usb3/3-2/3-2:1.1/input/input8
input: RedOctane Guitar Hero X-plorer as /devices/pci0000:00/0000:00:13.2/usb3/3-2/3-2:1.2/input/input9
BUG: unable to handle kernel NULL pointer dereference at virtual address 00000006
 printing eip:
f99648fc
*pde = 00000000
Oops: 0000 [#1]
PREEMPT SMP
Modules linked in: xpad appletalk ipx p8022 psnap llc p8023 joydev led_class ext2 snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss ppdev snd_mixer_oss lp ohci1394 ieee1394 firewire_ohci firewire_core crc_itu_t pcspkr parport_pc parport rtc_cmos rtc_core rtc_lib tsdev k8temp psmouse serio_raw snd_hda_intel snd_pcm snd_timer snd_page_alloc snd_hwdep snd soundcore i2c_piix4 i2c_core ppp_generic slhc sg evdev thermal processor fan button battery ac fglrx(P) ati_agp agpgart fuse capability commoncap 8139too mii ext3 jbd mbcache usbhid hid ff_memless sd_mod sr_mod cdrom ehci_hcd ohci_hcd usbcore ahci ata_generic pata_jmicron pata_atiixp libata
CPU:    1
EIP:    0060:[<f99648fc>]    Tainted: P        VLI
EFLAGS: 00010286   (2.6.23-ARCH #1)
EIP is at xpad_probe+0x23c/0x4c0 [xpad]
eax: 00000000   ebx: 00800000   ecx: f7c2b080   edx: 00000006
esi: 0000000e   edi: d4921800   ebp: efd1a000   esp: cfc71da8
ds: 007b   es: 007b   fs: 00d8  gs: 0033  ss: 0068
Process insmod (pid: 14417, ti=cfc70000 task=e8c5da90 task.ti=cfc70000)
Stack: f4fce994 00000041 f9964e73 c1994514 efd1a004 eb82681c eb826800 02965ce4
       f4fce980 f9965ce4 eb826800 eb826800 f9965ce4 f9965b80 00000000 f887a166
       efd1a000 efd1a058 eb82681c 00000000 f9965bb8 f888dd20 c02a1a68 cfc71e30
Call Trace:
 [<f887a166>] usb_probe_interface+0xa6/0x100 [usbcore]
 [<c02a1a68>] driver_probe_device+0x88/0x190
 [<c035e5ff>] klist_next+0x5f/0xc0
 [<c02a1cc0>] __driver_attach+0x80/0x90
 [<c02a0e7a>] bus_for_each_dev+0x3a/0x60
 [<c02a18d6>] driver_attach+0x16/0x20
 [<c02a1c40>] __driver_attach+0x0/0x90
 [<c02a120a>] bus_add_driver+0x8a/0x1b0
 [<f8879bb5>] usb_register_driver+0x95/0x110 [usbcore]
 [<f9945018>] usb_xpad_init+0x18/0x39 [xpad]
 [<c01396a7>] blocking_notifier_call_chain+0x17/0x20
 [<c014ea76>] sys_init_module+0x126/0x18b0
 [<c017c4c7>] filp_close+0x47/0x80
 [<c0104482>] sysenter_past_esp+0x6b/0xa1
 =======================
Code: 00 98 f0 0f ab 47 1c 83 c2 01 0f b7 84 12 a0 4d 96 f9 66 85 c0 79 ea 8b 54 24 18 8b 42 04 8b 54 24 20 8b 40 0c 8b 4a 0c 8b 55 00 <0f> b6 70 06 0f b6 40 02 c1 e2 08 c1 e0 0f 09 c2 8b 44 24 20 81
EIP: [<f99648fc>] xpad_probe+0x23c/0x4c0 [xpad] SS:ESP 0068:cfc71da8

Last edited by MindlessXD (2007-11-08 06:04:48)

Offline

#6 2007-11-08 22:40:56

MindlessXD
Member
Registered: 2007-11-08
Posts: 18

Re: Xbox Gamepad

I've more or less solved my issue by making changes to v0.0.6 xpad.c included with the kernel source.
so this will only help if you want to use a X-plorer...

[mindless@shlbz joystick]$ diff -u xpad.c xpad-guitar.c
--- xpad.c      2007-10-09 15:31:38.000000000 -0500
+++ xpad-guitar.c       2007-11-08 16:30:21.000000000 -0600
@@ -134,6 +134,7 @@
        { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", MAP_DPAD_TO_AXES, XTYPE_XBOX },
        { 0x102c, 0xff0c, "Joytech Wireless Advanced Controller", MAP_DPAD_TO_AXES, XTYPE_XBOX },
        { 0x12ab, 0x8809, "Xbox DDR dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
+       { 0x1430, 0x4748, "RedOctane Guitar Hero X-plorer", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360},  /* GUITAR! */
        { 0x1430, 0x8888, "TX6500+ Dance Pad (first generation)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
        { 0x045e, 0x028e, "Microsoft X-Box 360 pad", MAP_DPAD_TO_AXES, XTYPE_XBOX360 },
        { 0xffff, 0xffff, "Chinese-made Xbox Controller", MAP_DPAD_TO_AXES, XTYPE_XBOX },
@@ -178,6 +179,7 @@
 static struct usb_device_id xpad_table [] = {
        { USB_INTERFACE_INFO('X', 'B', 0) },    /* X-Box USB-IF not approved class */
        { USB_DEVICE_INTERFACE_PROTOCOL(0x045e, 0x028e, 1) },   /* X-Box 360 controller */
+       { USB_DEVICE_INTERFACE_PROTOCOL(0x1430, 0x4748, 1) },   /* GUITAR! */
        { }
 };

(compiled with the instructions a few posts above in this thread)

Offline

#7 2007-12-12 16:17:39

Fackamato
Member
Registered: 2006-03-31
Posts: 579

Re: Xbox Gamepad

On 2.6.23-ARCH kernel:

fackamato ~/360-2  $  make -C /usr/src/linux-2.6.23-ARCH/ M=`pwd` modules
make: Entering directory `/usr/src/linux-2.6.23-ARCH'
  CC [M]  /home/fackamato/360-2/xpad.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/fackamato/360-2/xpad.mod.o
  LD [M]  /home/fackamato/360-2/xpad.ko
make: Leaving directory `/usr/src/linux-2.6.23-ARCH'
fackamato ~/360-2  $  ls
Makefile        xpad.c         xpad.h   xpad.mod.c  xpad.o
Module.symvers  xpad-guitar.c  xpad.ko  xpad.mod.o
fackamato ~/360-2  $  sudo insmod ./xpad.ko
Segmenteringsfel
fackamato ~/360-2  $

dmesg:

No module found in object
input: RedOctane Guitar Hero X-plorer as /devices/pci0000:00/0000:00:1d.0/usb1/1-2/1-2:1.0/input/input3
input: RedOctane Guitar Hero X-plorer as /devices/pci0000:00/0000:00:1d.0/usb1/1-2/1-2:1.1/input/input4
input: RedOctane Guitar Hero X-plorer as /devices/pci0000:00/0000:00:1d.0/usb1/1-2/1-2:1.2/input/input5
BUG: unable to handle kernel NULL pointer dereference at virtual address 00000006
 printing eip:
f9227a5c
*pde = 00000000
Oops: 0000 [#1]
PREEMPT SMP 
Modules linked in: xpad fuse nvidia(P) agpgart i2c_core w83627hf hwmon_vid capability commoncap bridge llc usb_storage ide_core usbhid hid ff_memless ehci_hcd uhci_hcd ohci_hcd evdev snd_intel8x0 snd_ac97_codec snd_pcm_oss snd_pcm snd_timer snd_page_alloc snd_mixer_oss snd soundcore ac97_bus natsemi e1000 usbcore sr_mod cdrom sd_mod ext3 jbd mbcache reiserfs ata_piix ata_generic libata
CPU:    0
EIP:    0060:[<f9227a5c>]    Tainted: P        VLI
EFLAGS: 00010286   (2.6.23-ARCH #1)
EIP is at xpad_probe+0x23c/0x4c0 [xpad]
eax: 00000000   ebx: 00800000   ecx: dfed9080   edx: 00000004
esi: 0000000e   edi: f7249800   ebp: dffce400   esp: f4c2bda8
ds: 007b   es: 007b   fs: 00d8  gs: 0033  ss: 0068
Process insmod (pid: 6214, ti=f4c2a000 task=dfe78540 task.ti=f4c2a000)
Stack: f4c34014 00000041 f9227fde c21ab514 dffce404 f7d7be1c f7d7be00 02228f24 
       f4c34000 f9228f24 f7d7be00 f7d7be00 f9228f24 f9228dc0 00000000 f8fb7176 
       dffce400 dffce458 f7d7be1c 00000000 f9228df8 f8fcab80 c02a21a8 f4c2be30 
Call Trace:
 [<f8fb7176>] usb_probe_interface+0xa6/0x100 [usbcore]
 [<c02a21a8>] driver_probe_device+0x88/0x190
 [<c035efcf>] klist_next+0x5f/0xc0
 [<c02a2400>] __driver_attach+0x80/0x90
 [<c02a15ba>] bus_for_each_dev+0x3a/0x60
 [<c02a2016>] driver_attach+0x16/0x20
 [<c02a2380>] __driver_attach+0x0/0x90
 [<c02a194a>] bus_add_driver+0x8a/0x1b0
 [<f8fb6bc5>] usb_register_driver+0x95/0x110 [usbcore]
 [<f91d1018>] usb_xpad_init+0x18/0x39 [xpad]
 [<c01393c7>] blocking_notifier_call_chain+0x17/0x20
 [<c014eff6>] sys_init_module+0x126/0x18b0
 [<c017c9e7>] filp_close+0x47/0x80
 [<c0104472>] sysenter_past_esp+0x6b/0xa1
 =======================
Code: 00 98 f0 0f ab 47 1c 83 c2 01 0f b7 84 12 00 7f 22 f9 66 85 c0 79 ea 8b 54 24 18 8b 42 04 8b 54 24 20 8b 40 0c 8b 4a 0c 8b 55 00 <0f> b6 70 06 0f b6 40 02 c1 e2 08 c1 e0 0f 09 c2 8b 44 24 20 81 
EIP: [<f9227a5c>] xpad_probe+0x23c/0x4c0 [xpad] SS:ESP 0068:f4c2bda8

But the guitar works just fine, it's great with fretsonfire big_smile, even stepmania is quite fun with it. wink

Offline

#8 2008-02-23 21:42:11

spookykid
Member
From: Portugal
Registered: 2006-07-23
Posts: 141

Re: Xbox Gamepad

Hi all, I've tried this with 2.6.24 and I get this:

root /home/spookykid/Desktop/xpad # insmod ./xpad.ko 
insmod: error inserting './xpad.ko': -1 Invalid module format
root /home/spookykid/Desktop/xpad #

on 2.6.23 it worked, but with the new kernel it doesn't any help? I really need to play Frets On Fire sad


There is no knowledge that is not power!

Offline

#9 2008-02-23 23:46:43

Fackamato
Member
Registered: 2006-03-31
Posts: 579

Re: Xbox Gamepad

spookykid wrote:

Hi all, I've tried this with 2.6.24 and I get this:

root /home/spookykid/Desktop/xpad # insmod ./xpad.ko 
insmod: error inserting './xpad.ko': -1 Invalid module format
root /home/spookykid/Desktop/xpad #

on 2.6.23 it worked, but with the new kernel it doesn't any help? I really need to play Frets On Fire sad

recompile it and reinstall it. you changed kernel.......

Offline

#10 2008-02-27 23:29:22

spookykid
Member
From: Portugal
Registered: 2006-07-23
Posts: 141

Re: Xbox Gamepad

Hi Fackamato,
thank you for your answer. I've tried that already but i get this:

root /backup/Programs/xpad # make xpad
cc   xpad.o   -o xpad
/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
xpad.o: In function `xpad_disconnect':
xpad.c:(.text+0x25): undefined reference to `usb_kill_urb'
xpad.c:(.text+0x2c): undefined reference to `input_unregister_device'
xpad.c:(.text+0x34): undefined reference to `usb_free_urb'
xpad.c:(.text+0x50): undefined reference to `usb_buffer_free'
xpad.o: In function `xpad_close':
xpad.c:(.text+0x9f): undefined reference to `printk'
xpad.o: In function `xpad_open':
xpad.c:(.text+0xd2): undefined reference to `usb_submit_urb'
xpad.c:(.text+0xf3): undefined reference to `printk'
xpad.c:(.text+0x10d): undefined reference to `printk'
xpad.o: In function `xpad_process_packet':
xpad.c:(.text+0x154): undefined reference to `input_event'
xpad.c:(.text+0x171): undefined reference to `input_event'
xpad.c:(.text+0x18e): undefined reference to `input_event'
xpad.c:(.text+0x1ab): undefined reference to `input_event'
xpad.c:(.text+0x1c8): undefined reference to `input_event'
xpad.o:xpad.c:(.text+0x1e5): more undefined references to `input_event' follow
xpad.o: In function `xpad_process_packet':
xpad.c:(.text+0x507): undefined reference to `printk'
xpad.c:(.text+0x51a): undefined reference to `printk'
xpad.c:(.text+0x534): undefined reference to `printk'
xpad.c:(.text+0x545): undefined reference to `printk'
xpad.c:(.text+0x571): undefined reference to `input_event'
xpad.c:(.text+0x594): undefined reference to `input_event'
xpad.c:(.text+0x5ac): undefined reference to `input_event'
xpad.c:(.text+0x5c4): undefined reference to `input_event'
xpad.c:(.text+0x5dc): undefined reference to `input_event'
xpad.o:xpad.c:(.text+0x5f4): more undefined references to `input_event' follow
xpad.o: In function `xpad_irq_in':
xpad.c:(.text+0x697): undefined reference to `usb_submit_urb'
xpad.c:(.text+0x6bb): undefined reference to `printk'
xpad.c:(.text+0x72b): undefined reference to `printk'
xpad.c:(.text+0x792): undefined reference to `printk'
xpad.c:(.text+0x7eb): undefined reference to `printk'
xpad.c:(.text+0x804): undefined reference to `printk'
xpad.o:xpad.c:(.text+0x81a): more undefined references to `printk' follow
xpad.o: In function `xpad_probe':
xpad.c:(.text+0x89e): undefined reference to `malloc_sizes'
xpad.c:(.text+0x8a8): undefined reference to `kmem_cache_zalloc'
xpad.c:(.text+0x8b1): undefined reference to `input_allocate_device'
xpad.c:(.text+0x8e2): undefined reference to `usb_buffer_alloc'
xpad.c:(.text+0x8fd): undefined reference to `usb_alloc_urb'
xpad.c:(.text+0x989): undefined reference to `strlcat'
xpad.c:(.text+0xaa5): undefined reference to `input_register_device'
xpad.c:(.text+0xb00): undefined reference to `usb_buffer_free'
xpad.c:(.text+0xb07): undefined reference to `input_free_device'
xpad.c:(.text+0xb10): undefined reference to `kfree'
xpad.c:(.text+0xc40): undefined reference to `usb_bulk_msg'
xpad.o: In function `xpad_disconnect':
xpad.c:(.text+0x62): undefined reference to `kfree'
xpad.o: In function `xpad_close':
xpad.c:(.text+0xab): undefined reference to `usb_kill_urb'
xpad.o: In function `cleanup_module':
xpad.c:(.exit.text+0x6): undefined reference to `usb_deregister'
xpad.o: In function `init_module':
xpad.c:(.init.text+0xa): undefined reference to `__this_module'
xpad.c:(.init.text+0x14): undefined reference to `usb_register_driver'
xpad.c:(.init.text+0x2e): undefined reference to `printk'
xpad.o:(__param+0x8): undefined reference to `param_set_ulong'
xpad.o:(__param+0xc): undefined reference to `param_get_ulong'
collect2: ld returned 1 exit status
make: *** [xpad] Error 1
root /backup/Programs/xpad #

roll

my Makefile:

obj-m := xpad.o

KDIR := /lib/modules/$(shell uname -r)/build
EXTRA_CFLAGS=-I$(shell pwd)

all:
        $(MAKE) modules -C $(KDIR) SUBDIRS=$(shell pwd)

Any help would be appreciated on finding a solution!

Last edited by spookykid (2008-02-27 23:30:20)


There is no knowledge that is not power!

Offline

#11 2008-06-05 18:25:51

Laertes
Member
From: Munich
Registered: 2007-04-08
Posts: 66

Re: Xbox Gamepad

After updating the kernel to the kernel26-2.6.25.4-1 I can't compile anymore the xpad driver following ChrisX's instructions. I get the following error:

make: se ingresa al directorio `/usr/src/linux-2.6.25-ARCH'
  CC [M]  /home/alain/xpad/xpad.o
/home/alain/xpad/xpad.c: En la función 'xpad_probe':
/home/alain/xpad/xpad.c:496: error: 'struct input_dev' no tiene un miembro llamado 'cdev'
make[1]: *** [/home/alain/xpad/xpad.o] Error 1
make: *** [_module_/home/alain/xpad] Error 2
make: se sale del directorio `/usr/src/linux-2.6.25-ARCH'

I'm not coder myself so I don't know what the error means. Now I'm not able to play "Frets on fire" with the Explorer guitar sad

Offline

#12 2008-06-08 10:27:43

Laertes
Member
From: Munich
Registered: 2007-04-08
Posts: 66

Re: Xbox Gamepad

Sorry, I didn't realize that the text was in spanish. Here it is again but this time in english:

make -C /usr/src/linux-2.6.25-ARCH/ M=`pwd` modules
make: Entering directory `/usr/src/linux-2.6.25-ARCH'
  CC [M]  /home/alain/xpad/xpad.o
/home/alain/xpad/xpad.c: In function 'xpad_probe':
/home/alain/xpad/xpad.c:496: error: 'struct input_dev' has no member named 'cdev'
make[1]: *** [/home/alain/xpad/xpad.o] Error 1
make: *** [_module_/home/alain/xpad] Error 2
make: Leaving directory `/usr/src/linux-2.6.25-ARCH

I know the module xpad is included in the kernel26 package, but it is an older version an it does not work with the Explorer guitar, so the only way is to compile this one.

Offline

#13 2008-06-23 16:26:46

shijtin
Member
Registered: 2007-02-12
Posts: 22

Re: Xbox Gamepad

You have to comment or remove the line 496 of xpad.c since cdev seems to have been removed from input_dev.

Offline

#14 2008-06-23 20:57:29

Laertes
Member
From: Munich
Registered: 2007-04-08
Posts: 66

Re: Xbox Gamepad

Thanks. I have tried it and, even if the compilation finished with an error, the xpad.ko file is created and I can load it with insmod. Unfortunately I don´t have now the xbox guitar to try it, but I think it will work.

Offline

#15 2008-06-28 10:01:08

Laertes
Member
From: Munich
Registered: 2007-04-08
Posts: 66

Re: Xbox Gamepad

The guitar works, but there are some drawbacks. The devices created by udev when pluggin the guitar are not removed after disconnecting it and no other usb devices are detected after connecting it.

There are also some error messages in the logs:

usbcore: registered new interface driver xpad
xpad.c: driver for Xbox controllers v0.1.7
usb 2-1: new full speed USB device using uhci_hcd and address 2
usb 2-1: configuration #1 chosen from 1 choice
input: RedOctane Guitar Hero X-plorer as /class/input/input8
input: RedOctane Guitar Hero X-plorer as /class/input/input9
input: RedOctane Guitar Hero X-plorer as /class/input/input10
BUG: unable to handle kernel NULL pointer dereference at 00000006
IP: [<f911128f>] :xpad:xpad_probe+0x20f/0x4b0
*pde = 00000000 
Oops: 0000 [#1] PREEMPT SMP 
Modules linked in: xpad nls_cp437 vfat fat usb_storage radeon drm michael_mic arc4 ecb ieee80211_crypt_tkip xt_tcp
udp nf_conntrack_ipv4 xt_state nf_conntrack iptable_filter ip_tables x_tables snd_seq_oss snd_seq_midi_event joydev snd_seq snd_seq_devic
e snd_pcm_oss snd_mixer_oss pcmcia usbhid hid ff_memless serio_raw psmouse snd_intel8x0 snd_ac97_codec ac97_bus snd_pcm snd_timer snd sou
ndcore snd_page_alloc yenta_socket rsrc_nonstatic pcmcia_core i2c_i801 i2c_core pcspkr container sr_mod cdrom ehci_hcd uhci_hcd usbcore s
g thermal fan ac intel_agp agpgart wbsd mmc_block mmc_core ipw2200 evdev ieee80211 ieee80211_crypt 8139too mii omnibook cpufreq_conservat
ive acpi_cpufreq freq_table processor button battery rtc_cmos rtc_core rtc_lib ext3 jbd mbcache sd_mod ata_piix ata_generic pata_acpi lib
ata scsi_mod dock
Pid: 1626, comm: khubd Not tainted (2.6.25-ARCH #1)
EIP: 0060:[<f911128f>] EFLAGS: 00010206 CPU: 0
EIP is at xpad_probe+0x20f/0x4b0 [xpad]
EAX: 00000000 EBX: f7186400 ECX: f7be5080 EDX: 00000200
ESI: f2b29060 EDI: f2b29000 EBP: f7186a80 ESP: f71a3cf4
DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
Process khubd (pid: 1626, ti=f71a2000 task=f7145200 task.ti=f71a2000)
Stack: f7186a94 00000041 f9111f94 f786f4f0 f67d1c04 f67d1c5c f29c4200 f67d1c00 
f67d1f24 f8e94615 00000000 f29c4200 f9112ec4 f9112de0 f8e94dde 00000000 
f29c421c f29c4294 f67d1c00 00000000 f29c421c f9112e14 f8ea9a60 c025f0f6 
Call Trace:
[<f8e94615>] usb_autopm_do_device+0x65/0xf0 [usbcore]
[<f8e94dde>] usb_probe_interface+0xae/0x130 [usbcore]
[<c025f0f6>] driver_probe_device+0x86/0x1a0
[<c02f8609>] klist_next+0x69/0xd0
[<c025e6c4>] bus_for_each_drv+0x54/0x80
[<c025f376>] device_attach+0x86/0x90
[<c025f2b0>] __device_attach+0x0/0x10
[<c025e4df>] bus_attach_device+0x6f/0x80
[<c025d493>] device_add+0x493/0x570
[<f8e93a48>] usb_set_configuration+0x378/0x600 [usbcore]
[<f8e9bab5>] generic_probe+0x35/0xb0 [usbcore]
[<f8e93ef9>] usb_probe_device+0x39/0x40 [usbcore]
[<c025f0f6>] driver_probe_device+0x86/0x1a0
[<c02f8609>] klist_next+0x69/0xd0
[<c025e6c4>] bus_for_each_drv+0x54/0x80
[<c025f376>] device_attach+0x86/0x90
[<c025f2b0>] __device_attach+0x0/0x10
[<c025e4df>] bus_attach_device+0x6f/0x80
[<c025d493>] device_add+0x493/0x570
[<f8e94615>] usb_autopm_do_device+0x65/0xf0 [usbcore]
[<f8e8ddd6>] usb_new_device+0x56/0xb0 [usbcore]
[<f8e8ecfd>] hub_thread+0x5bd/0x1130 [usbcore]
[<c013db00>] autoremove_wake_function+0x0/0x50
[<f8e8e740>] hub_thread+0x0/0x1130 [usbcore]
[<c013d829>] kthread+0x39/0x70
[<c013d7f0>] kthread+0x0/0x70
[<c0105da3>] kernel_thread_helper+0x7/0x14
=======================
Code: 01 83 c2 01 0f b7 84 12 20 1f 11 f9 66 85 c0 79 eb 8b 54 24 18 8b 5c 24 14 8b 4d 0c 8b 42 04 8b 53 a4 8b 5d 08 8b 40 0c c1 e2 08 <0f> b6 70 06 0f b6 40 02 c1 e0 0f 09 c2 8b 44 24 1c 81 ca 80 00 
EIP: [<f911128f>] xpad_probe+0x20f/0x4b0 [xpad] SS:ESP 0068:f71a3cf4
---[ end trace 597aab7ea917dd86 ]---

At least the guitar is usable for playing. I guess these errors can only be solved amending the code.

Offline

#16 2008-08-15 16:57:52

Laertes
Member
From: Munich
Registered: 2007-04-08
Posts: 66

Re: Xbox Gamepad

It seems that with the latest update of the kernel (2.6.26.2-1) it is not needed anymore to compile the xpad driver for the xbox guitar. The vanilla module works nicely.

The log output is the following:

usbcore: registered new interface driver xpad
xpad: X-Box pad driver
usb 2-1: new full speed USB device using uhci_hcd and address 2
usb 2-1: configuration #1 chosen from 1 choice
Registered led device: xpad0
input: RedOctane Guitar Hero X-plorer as /class/input/input8
cannot find module usb:v1430p4748d3122dcFFdscFFdpFFicFFiscFDip13
cannot find module usb:v1430p4748d3122dcFFdscFFdpFFicFFisc5Dip02
cannot find module usb:v1430p4748d3122dcFFdscFFdpFFicFFisc5Dip03

I don't know why the "cannot find... " messages, but anyway everything seems in order.  Also, the problems with other usb connections after using the guitar that I mentioned in my previous post are solved.

Offline

#17 2008-09-03 12:03:52

zephyrus17
Member
Registered: 2008-06-15
Posts: 323

Re: Xbox Gamepad

Laertes wrote:

It seems that with the latest update of the kernel (2.6.26.2-1) it is not needed anymore to compile the xpad driver for the xbox guitar. The vanilla module works nicely.

The log output is the following:

usbcore: registered new interface driver xpad
xpad: X-Box pad driver
usb 2-1: new full speed USB device using uhci_hcd and address 2
usb 2-1: configuration #1 chosen from 1 choice
Registered led device: xpad0
input: RedOctane Guitar Hero X-plorer as /class/input/input8
cannot find module usb:v1430p4748d3122dcFFdscFFdpFFicFFiscFDip13
cannot find module usb:v1430p4748d3122dcFFdscFFdpFFicFFisc5Dip02
cannot find module usb:v1430p4748d3122dcFFdscFFdpFFicFFisc5Dip03

I don't know why the "cannot find... " messages, but anyway everything seems in order.  Also, the problems with other usb connections after using the guitar that I mentioned in my previous post are solved.

So all I do is "modprobe xpad"? Do I still have to download from the link show above for xpad.c and xpad.h?


EDIT: Following the howto at the Gentoo wiki, it comes to the place where I have to

# cat xpad-360-support-2.6.22.patch | patch -p1

but all I get is

can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -ruN linux-2.6.21.orig/drivers/input/joystick/xpad.c linux-2.6.21/drivers/input/joystick/xpad.c
|--- linux-2.6.21.orig/drivers/input/joystick/xpad.c    2007-05-03 23:07:28.000000000 +0200
|+++ linux-2.6.21/drivers/input/joystick/xpad.c    2007-05-03 23:07:35.000000000 +0200
--------------------------
File to patch:

Last edited by zephyrus17 (2008-09-03 14:16:42)

Offline

#18 2008-09-04 08:46:15

Laertes
Member
From: Munich
Registered: 2007-04-08
Posts: 66

Re: Xbox Gamepad

I f you have installed the latest Arch kernel26 package you don´t need to do anything. The xpad module included in it works perfectly with the Xbox guitar. You don´t even need to write "modprobe xpad", the module is automatically loaded when the guitar is plugged-in.

Just check that a new device node is created, for example /dev/input/js0. If not, check the system logs to see what failed and also check if the module has been loaded.

Offline

#19 2008-09-04 08:50:49

zephyrus17
Member
Registered: 2008-06-15
Posts: 323

Re: Xbox Gamepad

Guitar? what about the normal wired controller?

Offline

#20 2008-09-04 08:53:26

Laertes
Member
From: Munich
Registered: 2007-04-08
Posts: 66

Re: Xbox Gamepad

I only have the guitar, but I suppose the normal controller works the same way.

Offline

#21 2008-09-04 08:54:43

zephyrus17
Member
Registered: 2008-06-15
Posts: 323

Re: Xbox Gamepad

When I plug it in, the player one slot just flashes. Is that normal? How am I to map the buttons and such?

Offline

#22 2008-09-04 08:57:34

Laertes
Member
From: Munich
Registered: 2007-04-08
Posts: 66

Re: Xbox Gamepad

Yes, that´s normal. The buttons are mapped in the menus of whatever game you want to play. Do you have a /dev/input/js0 file?

Offline

#23 2008-09-04 08:59:06

zephyrus17
Member
Registered: 2008-06-15
Posts: 323

Re: Xbox Gamepad

Nope.

Offline

#24 2008-09-04 09:00:55

Laertes
Member
From: Munich
Registered: 2007-04-08
Posts: 66

Re: Xbox Gamepad

Another number? js1, js2... ?

Offline

#25 2008-09-04 09:05:01

zephyrus17
Member
Registered: 2008-06-15
Posts: 323

Re: Xbox Gamepad

ls /dev/input

gives

by-id    event1   event12  event4  event7  mice    mouse2
by-path  event10  event2   event5  event8  mouse0  mouse3
event0   event11  event3   event6  event9  mouse1

where the by-path and by-id are directories

Last edited by zephyrus17 (2008-09-04 09:05:35)

Offline

Board footer

Powered by FluxBB