l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
August 5: Social gathering
Next Installfest:
TBD
Latest News:
Jul. 4: July, August and September: Security, Photography and Programming for Kids
Page last updated:
2001 Dec 30 17:14

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[vox-tech] es1371 and why I love open source
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] es1371 and why I love open source




hey all,

I have an es1371 based sound card (sb128, i believe), and my 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 0x2** range.
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 /usr/src/linux/drivers/sound/es1371.c, and note that the 0x2**
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 on.

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 0x200-0x218 (the
documented offset range), and then printk's the probed value.

A prayer to the penguin god, a 'rmmod es1371' and a '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 0x218, probably due to some small
change somewhere else that initialized my hardware differently.

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, so it now works.

now, if i were running windos and my joystick didn't work, what are the
chances that:

o. the driver would be open sources
 o. if not, that i would know who the author was
  o. i would have the author's email addr.
   o. he would be awake at 4am
    o. he would be willing to change things for me
     o. 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


_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!