You may want to try enabling the timer interrupt, and put your
countdown-til-buffer-swap in the timer interrupt handler, that way
you don't have to worry about synchronization. If you can eliminate
the need for timer 0, you can cascade 1 into 0, put the countdown in
timer 0, then generate a single interrupt when the buffer swap is
needed. If you're still getting the click, you may need to issue the
swap earlier (maybe the FIFO is starved)
John Marco Panettiere
--- In gbadev@y..., "Tristan Rybak" <tristan.rybak@w...> wrote:
> 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@y...
> 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
I am writing mixer, using stereo DMA1/2 transfer, drived by timer0. I am using double buffering that means my buffer have samples for two VBLANK periods (DMA...
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...
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...
I had similar problems with sound, but after reading http://belogic.com/gba/, I came up with a solution. Instead of trying to mix sounds once per frame, just...
Any help on this problem would be greatly appreciated. I have a gba binary file (of my own making), compiled with GCC. Burned onto a real cart using Visoly's...
Well, I had exactly the same problem. In my case it was the ONLY place in my project that a sprite was being displayed a co-ordinate from a ROM table, not a...
Francis Lillie
francis_lillie@...
Jan 5, 2002 4:45 pm
It seems to me that emulators would be the perfect tool for detecting this type of problem. Does anyone know of an emulator that can detect ROM writes? I had a...
Maybe you could check your prefetch settings. On official cartridges, you have to set them to 3-1-1. Codac/Apex http://hferradj.nerim.net ... De : Gimbel...
Poet007 - Da BondGirl...
hferradj@...
Jan 5, 2002 4:46 pm
I've had the same problem. I read the post on writing to ROM, but I'm sure that's not what happends in my project, because moving function calls around solved...
With my recently aquired and limited understanding of ROM writes, it seems moving function calls around could make the crash occur at a different place. ROM...
Hello Thomas, Sunday, January 06, 2002, 4:47:24 PM, you wrote: TEP> I've had the same problem. I read the post on writing to ROM, but I'm sure TEP> that's not...
... I would (before starting GBA coding) say that this is 100% correct. However, because the result of attempted ROM writes is apparently random, a point which...
Francis Lillie
francis_lillie@...
Jan 6, 2002 9:16 pm
Eh, how can it be, if it only crashes on official Nintendo flash cartridges? - Tom...
I'm aware it's been some time since this thread was active, and it's been some time since I found the solution too. The problem WAS that there was a write to...
Hi Thomas, ... Groepaz mentioned earlier that this was due to a bad crt0.s/lnkscript. The official lnkscript (atleast older versions anyway) does in fact put...
It seems to me that the easiest solution is to use the cascaded timers approach, but this does take up 2 timers, which may not be ideal. Since everything is...
Eddie Edwards
eddie@...
Jan 9, 2002 9:24 am
You may want to try enabling the timer interrupt, and put your countdown-til-buffer-swap in the timer interrupt handler, that way you don't have to worry about...