Re: [AD] About inp & outp |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> Could you try this patch. If it does not work, try adding my_delay
> before inportb and outportb, if it still does not work, remove
> my_delay and replace inportb/outportb defines with inp/outp. If the
> last fix works, then we might just use it.
I've tried all the things you suggested: I took the original 3.9.32 sndscape.c file, and first I applied the patch as
is (din't work), then I put my_delay calls before inportb and outportb (still didn't work); only changing
inportb/outportb references with inp/outp calls made it to work... But as I found sometime ago, the sound I got was
distorted, so I also had to change the value on line 580 from ">16" to ">15". I tried also with a ">8" as Andy said,
but the sound was again distorted; puting ">7" made it to work again... So now I really suspect that distorted sound is
due to the odd times the IRQ has to be generated, before the buffers are switched; anyway, I'll try to directly remove
the need to wait several IRQ to switch the buffers. As Andy stated, old Allegro 3.12 used to switch them at each IRQ,
and it worked, so now I'll change it back that way to see what happens.
To Andy: as for the driver I use, it's the same I've always used from the first time I got my SB 64 PCI: it comes from
the Creative CD bundled with it. Maybe trying a more recent driver version (yours or another one taken from the
Creative web site) could help, but I doubt it... Anyway send your driver to me by mail, so I'll try.
> _inp:
> jmp _inportb
>
> _inportb:
> pushl %ebp
> movl %esp, %ebp
> movl 0x8(%ebp), %edx
> inb (%dx), %al
> movzbl %al, %eax
> movl %ebp, %esp
> pop %ebp
> ret
If it's really as you showed here, then it's -really- impossible that with inportb it doesn't work on my computer,
while with inp it does... Anyway, as I examined two very small inp/outp and inportb/outportb test programs, compiled to
asm, I noticed inportb and outportb C functions are translated into inline asm I/O instructions, while inp and outp and
translated as far calls to the _inp and _outp procedures, that are located somewhere in the libc core.
As far as I know, the _inp libc procedure should look something like the _inportb function you wrote above, but this
shouldn't be the case, as there must be some other kind of operations other than these, to make it work differently
from a simple "inb (%dx), %al" to which inportb() is directly transtaled into...
--
Angelo Mottola
a.mottola@xxxxxxxxxx