I think, that's not the problem. I isolated my code so there is no other DMA
transfer then that feeding SOUND FIFO's.
And I don't use DMA interrupt when sound completes (I use VBLANK).
I think the problem is in synchronizing DMA restart with VBLANK. But I can not
find working values of frequency/buffer size.
When I use emulator and read DMA SOURCE ADDRESS at VBLANK IRQ (it's possible in
emulator) the address is pointing at the first byte after my buffer and
sometimes (lets say every 4th sound click:-) 16 bytes after. I guess DMA is
feeding sound fifo 16 bytes a time.
But I know emulator is not enough reliable for such measurements.
I have no idea what to do, If someone share with me working buffer switching
routine (at vblank) that would be great.
Thanks very much
Tristan
----- Original Message -----
From: rogermilne100
To: gbadev@yahoogroups.com
Sent: Friday, January 04, 2002 6:17 AM
Subject: [gbadev] Re: sound loop problem, please help!!!
If you are performing DMA's *anywhere* in your code, while the sound
is playing, you risk pre-empting the CPU's interrupt handler from
being able to feed more sound when the existing sample completes.
That situation caused random, intermittant clicking in my code.
Basically, you really have to make sure that when the sound DMA
completes its' last transfer, and generates an interrupt so that it
can be given more sample-data, you really need to service it ASAP.
DMA's take higher precidence than CPU, and if active when the
interrupt is triggered, can cause a delay before the interrupt is
serviced, and thus, a click is heard once in a while. There may be
more reasons for these clicks, but that's the only problem I ran into
which caused them. I hope that helps lead to a solution...
Roger
Yahoo! Groups Sponsor
ADVERTISEMENT
list rules: http://www.gbadev.org/rules.txt
unsubscribe: gbadev-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]