Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
sound loop problem, please help!!!   Message List  
Reply | Forward Message #9146 of 15019 |
Re: sound loop problem, please help!!!

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




Sat Jan 5, 2002 12:00 am

agd_developer
Offline Offline
Send Email Send Email

Forward
Message #9146 of 15019 |
Expand Messages Author Sort by Date

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...
tristanrybak
Offline Send Email
Jan 4, 2002
1:33 am

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...
rogermilne100
Offline Send Email
Jan 4, 2002
9:33 am

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...
Tristan Rybak
tristanrybak
Offline Send Email
Jan 4, 2002
11:44 am

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...
dekutree65
Offline Send Email
Jan 4, 2002
6:36 pm

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...
Gimbel Baxter
gimbelbaxter
Offline Send Email
Jan 5, 2002
1:15 am

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@...
Send Email
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...
Gimbel Baxter
gimbelbaxter
Offline Send Email
Jan 5, 2002
7:14 pm

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@...
Send Email
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...
Thomas Egeskov Petersen
laxityms
Offline Send Email
Jan 6, 2002
4:31 pm

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...
Gimbel Baxter
gimbelbaxter
Offline Send Email
Jan 6, 2002
7:52 pm

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...
groepaz
groepaz2000
Offline Send Email
Jan 6, 2002
7:53 pm

... 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@...
Send Email
Jan 6, 2002
9:16 pm

Eh, how can it be, if it only crashes on official Nintendo flash cartridges? - Tom...
Thomas Egeskov Petersen
laxityms
Offline Send Email
Jan 10, 2002
10:54 am

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...
Thomas Egeskov Petersen
laxityms
Offline Send Email
Feb 16, 2002
1:52 pm

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...
Jeff Frohwein
jfrohwei
Offline Send Email
Feb 16, 2002
3:13 pm

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@...
Send Email
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...
agd_developer
Offline Send Email
Jan 5, 2002
1:14 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help