|
Atari coding BBS
Re: STE & Falcon DMA sound |
Posted by: Mr.Styckx
|
Feb,07.2015-01:43
|
You're right about stopping dma, it won't necessary give "click" sound if next sound sample is setup fast enough.
This is what I learnt when improving STE DMA sound emulation for Hatari :
On STE, the DMA sound FIFO is indeed important. There's a 8 bytes / 4 words FIFO for DMA sound.
So, once DMA FIFO is filled, you always have 8 bytes ahead to be played. DMA will always try to keep it filled at max, loading missing bytes on every HBL.
This means that if you stop DMA sound, sound won't be turned off immediately, the sound will be played with the remaining bytes in the DMA FIFO (8 bytes at max).
If you reload new start/end addresses for DMA sound fast enough (before FIFO is emptied), then DMA will refill the FIFO with samples at this new address, and you will get seamless playback of different sample.
Put in other words, when you get bit 7 in IPRA in MFP, or timer A interrupt, this doesn't mean the last byte of the current sample was played ; it means the last byte of the current sample was loaded in the FIFO, this is a huge difference.
At this moment, you have the equivalent time of emptying the FIFO to load a new start/end address for next sample.
Even when playing 50 KHz stereo sound, it's possible to setup the next sample in a timer A interrupt ; but your timer A handler routine should be optimised to set the new start address as fast as possible, before DMA sound loops on the current sample.
In all cases, it's not necessary to stop DMA.
Falcon might be different, I don't know if there's a FIFO and what is its size, so seamless playback can be a little more complicated and this would explain why you get "clicks" when turning DMA off/on on falcon (if the FIFO is not as big as on STE).
Nicolas
|
[All messages in this thread] [Start new thread]
Topic
|
Posted by
|
Date
|
STE & Falcon DMA sound
|
defjam
|
Feb,05.2015-21:31
|
Re: STE & Falcon DMA sound
|
dml
|
Feb,06.2015-00:18
|
Re: STE & Falcon DMA sound
|
mikro
|
Feb,06.2015-09:22
|
Re: STE & Falcon DMA sound
|
Mr.Styckx
|
Feb,06.2015-01:04
|
Re: STE & Falcon DMA sound
|
gwEm/PHF
|
Feb,06.2015-11:06
|
Re: STE & Falcon DMA sound
|
evil
|
Feb,06.2015-22:36
|
Re: STE & Falcon DMA sound
|
Mr.Styckx
|
Feb,07.2015-01:43
|
Re: STE & Falcon DMA sound
|
Laurent / Thadoss
|
Feb,07.2015-10:40
|
Re: STE & Falcon DMA sound
|
Defjam
|
Feb,07.2015-18:00
|
Re: STE & Falcon DMA sound
|
Abstract_f
|
Feb,16.2015-15:56
|
Re: STE & Falcon DMA sound
|
ggn
|
Feb,16.2015-16:55
|
Re: STE & Falcon DMA sound
|
gwEm/PHF
|
Feb,18.2015-11:09
|
Re: STE & Falcon DMA sound
|
PeP
|
Feb,17.2015-16:55
|
Re: STE & Falcon DMA sound
|
gwEm/PHF
|
Feb,18.2015-11:05
|
What's the anti-troll code? That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
|