From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Gravis Ultrasound SDK and the DMA Date: Fri, 4 Apr 1997 20:36:50 +0100 Organization: None Distribution: world Message-ID: <5rI9tRAShVRzEwJ6@talula.demon.co.uk> References: NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 35 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Lemponen Olli writes: >I ported the Gravis Ultrasound SDK version 2.22 to DJGPP and C++. It was >relatively easy, but when I tested it, the machine hanged. It didn't even >respond to CTRL-ALT-DEL. I commented out the specific lines which actually >initiate the DMA transfer (two 'out' commands) to the GUS and everything >worked fine, except for the DMA (no longer hanged, but didn't work >properly either;) What could be wrong? I don't know much about GUS coding, but a couple of things spring to mind... Are you sure your DMA buffer is at a valid memory address, ie. in the first meg of physical RAM, and not crossing a 64k page boundary? You should be using a buffer allocated with __dpmi_allocate_dos_memory(), or some similar function, and you must check that it lies within a single page. Another possibility would be that the DMA is in fact executing correctly, but the GUS is then generating a "hey, I'm finished!" interrupt at the end of the transfer, and that is causing your program to lock up. Are you trapping any interrupts from the GUS? >Another possibility would be to move the sound data to the GUS is directly >pokeing the values, but that is _really_ slow. (btw, with pmode/dj it was >considerably faster than with cwsdpmi!) It would be. Port acceses are quite a bit faster in ring-0, which is used by pmode/dj. Try using cwsdpr0, and you'll probably see a similar speed increase. Unfortunately you can't rely on that if you want your program to run under other DPMI hosts like win95, though... -- Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/ Beauty is a French phonetic corruption of a short cloth neck ornament.