I have an es1371 based sound card (SoundBlaster128, I believe), and my
[Linux Kernel] 2.4.x joystick ride has been kinda bumpy. Some kernels would
detect the joystick port, others wouldn't.
I really like having a working joystick so I can play emulated games :)
So tonight I decided that I was gonna get it working again. I inserted the
es1371 module, and noticed that it read:
es1371: features: joystick 0x0
That's not right. I knew my port was somewhere in the
If I gave it
joystick=0x200, my machine would freeze right
away when trying to load the joystick module. (
0x200 was the
previous value I remembered).
So I looked in
and note that the
range is not really the address, but the offset. Ok, so far nothing
spectacular, just an understanding that my machine hangs because I try to
use the soundcard like a joystick ;)
So after some tinkering and
printk'ing some values out, I realize
that since I wasn't giving a joystick offset, the es1371 driver was skipping
right over the joystick code. In reality, (after a bit of looking around)
I believe that it only tries to autodetect if there are more than 1 game ports.
(Also, the code has a catch for
0x200, since it seems to be a
common offset for the gameport). Otherwise, it doesn't even turn the port
Luckily, I'm staring right at the code, and I think i understand it ok. So
I added an 'else'-clause to the gameport init. code that probes
documented offset range), and then
printk's the probed value.
A prayer to the penguin god, a '
rmmod es1371' and an
insmod 1371' later and I'm looking at:
es1371: found chip, vendor id 0x1274 device id 0x1371 revision 0x07
es1371: debug -> found 0x218.
ac97_codec: AC97 Audio codec, id: 0x8384:0x7608 (SigmaTel STAC9708)
es1371: found es1371 rev 7 at io 0xe400 irq 5
es1371: features: joystick 0x218
Aha, so my port must have slid over to
probably due to some small change somewhere else that initialized my
Anyway, so I got it working.
What really makes me sing is that something didn't work, yet because I wanted
it to work, and I had the guts to go in and change stuff, it now works.
Now, if I were running Windows and my joystick didn't work, what are the
- The driver would be open source
- If not, that I would know who the author was
- I would have the author's email address
- He would be awake at 4am
- He would be willing to change things for me
- He would give me a binary to test every 15mins until it worked
I don't think so.
-Gabe has free time after finals, many games to finish