LINUX Joystick

I am attempting to get my Microsoft Sidewinder Freestyle Pro joystick working
with SDL under LINUX. My system is Mandrake 9.0 on an Athlon-1300, with the
joystick on a sbLive! gameport. I am using the following code for testing:

int main(int argc, char *argv[])
{
if(SDL_Init(SDL_INIT_JOYSTICK)<0)
{
fprintf(stderr,“Can’t init SDL!\n”);
return(-1);
}

printf(“Joysticks: %d\n”,SDL_NumJoysticks());
SDL_Quit();
return(0);
}

No matter what I do, it prints ‘Joysticks: 0’. What combination of
modprobes, insmods, and rmmods do I need to get this silly thing working?

Hi Tyler,

“insmod sidewinder” should work, if this module is not already loaded?
(lsmod)

“sidewinder” supports your joystick, but I have not tested myself. you
could try “gameport” module too.

The program “SDL12/test/testjoystick.c” might be a better test when you
get it reporting being connected etc.

Cheers

JG

on the 25/03/03 19:40, Tyler Montbriand wrote:> I am attempting to get my Microsoft Sidewinder Freestyle Pro joystick working

with SDL under LINUX. My system is Mandrake 9.0 on an Athlon-1300, with the
joystick on a sbLive! gameport. I am using the following code for testing:

int main(int argc, char *argv[])
{
if(SDL_Init(SDL_INIT_JOYSTICK)<0)
{
fprintf(stderr,“Can’t init SDL!\n”);
return(-1);
}

printf(“Joysticks: %d\n”,SDL_NumJoysticks());
SDL_Quit();
return(0);
}

No matter what I do, it prints ‘Joysticks: 0’. What combination of
modprobes, insmods, and rmmods do I need to get this silly thing working?

SDL requires the joystick to appear in /dev/jsX where X is a number 0-16
(possibly more too)
mandrake is not known for doing this for you, especially if you have a USB
joystick.

the best way to find a joystick under mandrake is to run the following

locate js0

or this

find /dev -name “js0”

then once you have found the joystick then link it to /dev/js0

example

ln -s /dev/input/js0 /dev/js0

If you are not sure which joystick you are using, then do this (in an Xterm or
other X based console if possible)

cat /dev/js0

then wiggle the joystick around, if your joystick is js0 then you should see
garbage appear on the screen.

hit
CTRL+C to end the program

if you get NO garbage then you’ve either got the wrong joystick drivers loaded
or you’ve tried to cat the wrong stick

with usb joysticks you must have
USB HID Module loaded (don’t know what it is called off the top of my head, as
I have it compiled into the kernel)
joystick.o
and
sidewinder.o (just like J.Grant said)

Also I’m attempting a robust joystick testing program in SDL, if you’d be so
kind as to give it a whack. it may be found here:

SDLJoytest

anyhow, hope that helped.

good luck
SamuelOn Tuesday 25 March 2003 11:40 am, Tyler Montbriand wrote:

I am attempting to get my Microsoft Sidewinder Freestyle Pro joystick
working with SDL under LINUX. My system is Mandrake 9.0 on an Athlon-1300,
with the joystick on a sbLive! gameport. I am using the following code for
testing:

int main(int argc, char *argv[])
{
if(SDL_Init(SDL_INIT_JOYSTICK)<0)
{
fprintf(stderr,“Can’t init SDL!\n”);
return(-1);
}

printf(“Joysticks: %d\n”,SDL_NumJoysticks());
SDL_Quit();
return(0);
}

No matter what I do, it prints ‘Joysticks: 0’. What combination of
modprobes, insmods, and rmmods do I need to get this silly thing working?


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


"They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety. "
–Benjamin Franklin

SDL requires the joystick to appear in /dev/jsX where X is a number 0-16
(possibly more too)
mandrake is not known for doing this for you, especially if you have a USB
joystick.

Joystick’s not USB.

then once you have found the joystick then link it to /dev/js0

Already linked.

If you are not sure which joystick you are using, then do this (in an Xterm
or other X based console if possible)

cat /dev/js0

cat: /dev/js0: No such device

Same for all other js* in /dev, 0-4

with usb joysticks you must have
USB HID Module loaded (don’t know what it is called off the top of my head,
as I have it compiled into the kernel)
joystick.o
and
sidewinder.o (just like J.Grant said)

SDLJoytest
I’ll try that when I get it working.

good luck
Samuel

Thanks… here’s the output from lsmod, can anyone tell me why these modules
and my joystick aren’t working?

Module Size Used by Not tainted
sidewinder 8696 0 (unused)
joydev 5632 0
emu10k1-gp 1384 0 (unused)
gameport 1660 0 [sidewinder emu10k1-gp]
sr_mod 15096 0 (autoclean)
parport_pc 21704 1 (autoclean)
lp 6720 0 (autoclean)
parport 23968 1 (autoclean) [parport_pc lp]
snd-opl3-synth 9860 0 (autoclean) (unused)
snd-seq-instr 4816 0 (autoclean) [snd-opl3-synth]
snd-ainstr-fm 1780 0 (autoclean) [snd-opl3-synth]
snd-seq-midi 3680 0 (autoclean) (unused)
snd-emu10k1-synth 4220 0 (autoclean) (unused)
snd-emux-synth 25532 0 (autoclean) [snd-emu10k1-synth]
snd-seq-midi-emul 4896 0 (autoclean) [snd-opl3-synth snd-emux-synth]
snd-seq-virmidi 2888 0 (autoclean) [snd-emux-synth]
snd-seq-oss 26176 0 (unused)
snd-seq-midi-event 3208 0 [snd-seq-midi snd-seq-virmidi snd-seq-oss]
snd-seq 33264 2 [snd-opl3-synth snd-seq-instr snd-seq-midi
snd-emux-synth snd-seq-midi-emul snd-seq-virmidi snd-seq-oss
snd-seq-midi-event]
snd-cmipci 15660 0
snd-mpu401-uart 2752 0 [snd-cmipci]
snd-opl3-lib 5764 0 [snd-opl3-synth snd-cmipci]
snd-pcm-oss 36932 0
snd-mixer-oss 9016 1 [snd-pcm-oss]
snd-emu10k1 56592 1 [snd-emu10k1-synth]
snd-pcm 55808 0 [snd-cmipci snd-pcm-oss snd-emu10k1]
snd-timer 9964 0 [snd-seq snd-opl3-lib snd-pcm]
snd-rawmidi 12864 0 [snd-seq-midi snd-seq-virmidi
snd-mpu401-uart snd-emu10k1]
snd-util-mem 1280 0 [snd-emux-synth snd-emu10k1]
snd-hwdep 3840 0 [snd-opl3-lib snd-emu10k1]
snd-ac97-codec 25508 0 [snd-emu10k1]
snd-seq-device 3836 0 [snd-opl3-synth snd-seq-midi
snd-emu10k1-synth snd-emux-synth snd-seq-oss snd-seq snd-opl3-lib snd-emu10k1
snd-rawmidi]
snd 24836 0 [snd-opl3-synth snd-seq-instr snd-seq-midi
snd-emux-synth snd-seq-virmidi snd-seq-oss snd-seq-midi-event snd-seq
snd-cmipci snd-mpu401-uart snd-opl3-lib snd-pcm-oss snd-mixer-oss snd-emu10k1
snd-pcm snd-timer snd-rawmidi snd-util-mem snd-hwdep snd-ac97-codec
snd-seq-device]
soundcore 3780 0 [snd]
ip_vs 74328 0 (autoclean)
af_packet 13000 1 (autoclean)
ne2k-pci 5504 1 (autoclean)
8390 6192 0 (autoclean) [ne2k-pci]
keybdev 1920 0 (unused)
mousedev 4148 1
hid 18340 0 (unused)
usbmouse 2004 0 (unused)
input 3456 0 [sidewinder joydev keybdev mousedev hid
usbmouse]
ext3 73736 4 (autoclean)
jbd 38624 4 (autoclean) [ext3]
ide-cd 28712 0
cdrom 26912 0 [sr_mod ide-cd]
usb-storage 51952 0 (unused)
ide-scsi 8212 0
scsi_mod 90404 2 [sr_mod usb-storage ide-scsi]
printer 6944 0
usb-ohci 18248 0 (unused)
usbcore 58304 1 [hid usbmouse usb-storage printer usb-ohci]
rtc 6560 0 (autoclean)On Wednesday 26 March 2003 12:11 am, Samuel wrote:

Hi,

Thanks… here’s the output from lsmod, can anyone tell me why these modules
and my joystick aren’t working?

I have the same sound/gameport card as you. I do not have a joystick to
test. emu10k1-gp is not loaded by default on my system, presumably
because nothing is connected.

Module Size Used by Not tainted
sidewinder 8696 0 (unused)
joydev 5632 0
emu10k1-gp 1384 0 (unused)
gameport 1660 0 [sidewinder emu10k1-gp]

Can you do “tail -f /var/log/messages” as you rmmod and insmod these
modules? Also unplug/replug the pad in.

Can’t really sugest more without more logs, is there any thing relevent
in /var/log/messages from bootup?

Cheers

JG

There may be a conflict between the soundblasters gamport module and the
default kernel gameport.o module
try removing gameport.o

rmmod gameport

and see if that works.

good luck

SamuelOn Wednesday 26 March 2003 10:57 pm, Tyler Montbriand wrote:

On Wednesday 26 March 2003 12:11 am, Samuel wrote:

SDL requires the joystick to appear in /dev/jsX where X is a number 0-16
(possibly more too)
mandrake is not known for doing this for you, especially if you have a
USB joystick.

Joystick’s not USB.

then once you have found the joystick then link it to /dev/js0

Already linked.

If you are not sure which joystick you are using, then do this (in an
Xterm or other X based console if possible)

cat /dev/js0

cat: /dev/js0: No such device

Same for all other js* in /dev, 0-4

with usb joysticks you must have
USB HID Module loaded (don’t know what it is called off the top of my
head, as I have it compiled into the kernel)
joystick.o
and
sidewinder.o (just like J.Grant said)

SDLJoytest

I’ll try that when I get it working.

good luck
Samuel

Thanks… here’s the output from lsmod, can anyone tell me why these
modules and my joystick aren’t working?

Module Size Used by Not tainted
sidewinder 8696 0 (unused)
joydev 5632 0
emu10k1-gp 1384 0 (unused)
gameport 1660 0 [sidewinder emu10k1-gp]
sr_mod 15096 0 (autoclean)
parport_pc 21704 1 (autoclean)
lp 6720 0 (autoclean)
parport 23968 1 (autoclean) [parport_pc lp]
snd-opl3-synth 9860 0 (autoclean) (unused)
snd-seq-instr 4816 0 (autoclean) [snd-opl3-synth]
snd-ainstr-fm 1780 0 (autoclean) [snd-opl3-synth]
snd-seq-midi 3680 0 (autoclean) (unused)
snd-emu10k1-synth 4220 0 (autoclean) (unused)
snd-emux-synth 25532 0 (autoclean) [snd-emu10k1-synth]
snd-seq-midi-emul 4896 0 (autoclean) [snd-opl3-synth
snd-emux-synth] snd-seq-virmidi 2888 0 (autoclean)
[snd-emux-synth]
snd-seq-oss 26176 0 (unused)
snd-seq-midi-event 3208 0 [snd-seq-midi snd-seq-virmidi
snd-seq-oss] snd-seq 33264 2 [snd-opl3-synth
snd-seq-instr snd-seq-midi snd-emux-synth snd-seq-midi-emul snd-seq-virmidi
snd-seq-oss
snd-seq-midi-event]
snd-cmipci 15660 0
snd-mpu401-uart 2752 0 [snd-cmipci]
snd-opl3-lib 5764 0 [snd-opl3-synth snd-cmipci]
snd-pcm-oss 36932 0
snd-mixer-oss 9016 1 [snd-pcm-oss]
snd-emu10k1 56592 1 [snd-emu10k1-synth]
snd-pcm 55808 0 [snd-cmipci snd-pcm-oss snd-emu10k1]
snd-timer 9964 0 [snd-seq snd-opl3-lib snd-pcm]
snd-rawmidi 12864 0 [snd-seq-midi snd-seq-virmidi
snd-mpu401-uart snd-emu10k1]
snd-util-mem 1280 0 [snd-emux-synth snd-emu10k1]
snd-hwdep 3840 0 [snd-opl3-lib snd-emu10k1]
snd-ac97-codec 25508 0 [snd-emu10k1]
snd-seq-device 3836 0 [snd-opl3-synth snd-seq-midi
snd-emu10k1-synth snd-emux-synth snd-seq-oss snd-seq snd-opl3-lib
snd-emu10k1 snd-rawmidi]
snd 24836 0 [snd-opl3-synth snd-seq-instr
snd-seq-midi snd-emux-synth snd-seq-virmidi snd-seq-oss snd-seq-midi-event
snd-seq snd-cmipci snd-mpu401-uart snd-opl3-lib snd-pcm-oss snd-mixer-oss
snd-emu10k1 snd-pcm snd-timer snd-rawmidi snd-util-mem snd-hwdep
snd-ac97-codec snd-seq-device]
soundcore 3780 0 [snd]
ip_vs 74328 0 (autoclean)
af_packet 13000 1 (autoclean)
ne2k-pci 5504 1 (autoclean)
8390 6192 0 (autoclean) [ne2k-pci]
keybdev 1920 0 (unused)
mousedev 4148 1
hid 18340 0 (unused)
usbmouse 2004 0 (unused)
input 3456 0 [sidewinder joydev keybdev mousedev hid
usbmouse]
ext3 73736 4 (autoclean)
jbd 38624 4 (autoclean) [ext3]
ide-cd 28712 0
cdrom 26912 0 [sr_mod ide-cd]
usb-storage 51952 0 (unused)
ide-scsi 8212 0
scsi_mod 90404 2 [sr_mod usb-storage ide-scsi]
printer 6944 0
usb-ohci 18248 0 (unused)
usbcore 58304 1 [hid usbmouse usb-storage printer
usb-ohci] rtc 6560 0 (autoclean)


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


"They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety. "
–Benjamin Franklin