The ULTRASOUND Plug 'n' Play MINI howto 0.01 1. Introduction ------------ As a fan of the gravis sound cards since a long time, I was really happy to finally see something really new coming from gravis. I had planned to buy the new ultrasound since a long time, and I bought it with one meg of RAM as soon as at was available here in France. I installed it, and ho joy it was detected by my plug and play bios, and even by windows95 (sorry no silly jokes on marketing95 today). So I thinked the card would work anywhere ... Then I launched linux, I had no problem, the card was detected as a gus rev 3.4, which seemed to be fine, but it wasn't ... Sometime later I tried quake, and didn't get any sound. Then I read the manual of the game, and saw that it was using some DMA thingies the standart gus coudn't afford ... I thinked it was not cool for me, having such a damn good card and could'nt have sound with such a great (the dos version needs the sound blaster emulation, and I even prefer no sound than that) So What now ? should I wait till May for a gus PnP driver ? shall I buy a sound blaster (bahhhhh) ? what will be in the next episode of the x-files ? 2. GUS MAX ? --------- Then I went back to dos, and played a little bit with the iwinit program. I looked at what the program said when I used verbose mode and saw something like CODEC adress 32c ... What ? the gus PnP has a CS4231/CS1848 Codec like the gus MAX ??? Then I looked at my backup tapes for the last gravis drivers, took ultrinit 2.31 from it, and typed : >set ultrasnd=220,6,5,5,5 >set ultra16=32c,0,0,1,0 >set ultradir=c:\ultrapnp >ultrinit and guess what : Ultrasound MAX detected !!! waow cool !, I thinked then I only have to put this before loading linux and I'll get gus MAX support, and finally get that f*****g quake to work this sound ! It wasn't so easy 8( 3. Driver hacking -------------- I'm not a good programmer, but I know enough on C to look through a driver and see what happens (especially when it's good commented) I looked at the file gus_card.c, but didn't find anything interesting. Then looked at gus_wave.c, and saw this : * Value 255 means pre-3.7 which don't have mixer. * Values 5 thru 9 mean v3.7 which has a ICS2101 mixer. * 10 and above is GUS MAX which has the CS4231 codec/mixer. Cool, I just have to force the value to 10, and it will work ... No ! doing this will make the kernel think you got a gus MAX, but it won't detect the codec chip ! I so had to force the codec detection too ... That was no so easy to find what to do, but I finally discovered what to do : In the file gus_wave.c, there was a line : if (ad1848_detect (gus_base + 0x10c, NULL, hw_config->osp)) which meaned the kernel was trying to autodetect the AD1848 chip, I thinked it couldn't detect with the gus PnP, and I was right ! I simply changed the line to : if (!(ad1848_detect (gus_base + 0x10c, NULL, hw_config->osp))) recompiled the kernel, and ho joy, quake worked like a charm !!! by the way there is there is a flag gus_pnp_flag in gus_card.c, but I didn't see any difference with it enabled or disabled 8( (perhaps I did something wrong) 4. So what shall we do exactly ? ----------------------------- Don't forget that this won't work if you haven't ram on your gus ... First of all don't use lilo anymore, as you need to initialise the gus PnP before starting linux ... (do a fdisk /mbr under dos, see other how-to's for more details on this) In your autoexec.bat, put : set interwave=c:\ultrapnp\iw.ini c:\ultrapnp\iwinit set ultrasnd=220,6,5,5,5 (or whatever you want or need) set ultra16=32c,0,0,1,0 set ultradir=c:\ultrapnp c:\ultrapnp\ultrinit you can find ultrinit in the file gus00045.zip, on any gravis site ... Under linux, open the file gus_wave.c, in /usr/src/linux/drivers/sound (or anywhere else) Find the line : if (val == 255 || val < 5) (line 3049 in 3.5b7) and the line before add val=10; Then find the line if (ad1848_detect (gus_base + 0x10c, NULL, hw_config->osp)) (line 3085) and change it to if (!(ad1848_detect (gus_base + 0x10c, NULL, hw_config->osp))) recompile the kernel with gus and gus max support For my configuration that is : BASE = 220 IRQ = 5 DMA1 = 6 DMA2 = 5 DMABUF = 65536 Enjoy the sound ! 5. Credits ------- I used the 1.3.75 kernel for patching, but it should be ok for any 1.3.70 and more kernel (please write me if any problem) This mini HOWTO is written by J-F MAMMET e-mail : mammet@diva.univ-mlv.fr www : http://diva.univ-mlv.fr/~mammet/ you can get the latest version of this document from my web page at http://diva.univ-mlv.fr/~mammet/linux.html (to come soon) I don't take any responsability if you lose informations or whatever bad can happen (even crashing win95) If you see some spelling mistakes (or even technical mistakes 8-p) , feel free to write me, I am just a poor frenchy lost in an english world, trying to speak an understandable langage. 27 March of 1996