Re: [hatari-devel] rev 3689 : splitting cpu cycles above 20

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

I reply to both Nicolas and Anders.

> But during this "while", nothing happens : M68000_AddCycles doesn't call any interrupts or things like that, it just increments the cycle counter. > So, you could replace the while + the 3 calls to DSP_run (40) with a single DSP_run (120) and it would be exactly the same.

Ok Nicolas, I agree here this patch is useless like this.
I first thought AddCycle would compute the internal interrupts (I didn't pay enough attention here).


I try to explain again why I tried this : let's take a movem 150 cycles.

During this time, the DSP can run 300 cycles (between 100 and 150 instructions), while the CPU runs 1 instruction.

In the same time, the crossbar will send 2 datas and a half to the DSP and the DSP will send 2 samples and a half to the crossbar (both for 25Mhz clock, it increases a bit with the 32 Mhz clock).

My aim was to split the 150 cycles into packets of 20 cycles, add these cycles (AddCycles), compute if there's a crossbar internal interrupt (to send some datas from <-> to the DSP and let run the DSP for an amount of 40 cycles). Like this, during the movem, the DSP continues to run, get the datas without hole and then back the result to the DAC.

This is of course useable not only for movem, but for all big cycles instructions.


> If there're "clicks" or "holes" in the output sound, then it's a bug in the falcon sound emulation code (bad emulation of the internal fifo).

You're certainly right here, as the internal 32 bytes FIFO of the Falcon is not yet emulated. Maybe I should start from here, remove the stupid patch and give it a try as described later ?


> Sound is noisy (scratchy) about every third time the module is started
> * Left and right channels are swapped almost every time the module is started > * Sometimes the left and right channels even swaps during playback of the module

I also noticed these strange behaviours + some more :
If I run Eko System, 2/3 of the time, it gets an error with the DMA buffer (end buffer < start buffer) and the last time, it's OK.

I don't understand yet the problem.

But I've done some tests yesterday evening with the 0xff8901 and the 0xff890d registers and it removes the problem for Eko System (but sound is noisier than without the patch). I'll discuss this in a separate thread to have your advise here.

I think there's still some work to do in the crossbar.

Best regards,

Laurent


Le 07/01/2012 11:20, Anders Eriksson a écrit :
On Sat, 7 Jan 2012, Laurent Sallafranque wrote:

A movem with all the registers can take more than 150 cycles.
A demo like Amanita (DHS) uses a lot of these movem.

Hi,

I don't think it's only the movem causing trouble. I did a little test now with playing a module using DSPMOD. Here are my observations:

* Sound is noisy (scratchy) about every third time the module is started

* Left and right channels are swapped almost every time the module is started

* Sometimes the left and right channels even swaps during playback of the module


Here is the player with the module (I did it just for test to be certain of left/right):

http://ae.dhs.nu/tmp/stertest.zip

Just drop stereo.mod on dump.ttp


--
Anders Eriksson
ae@xxxxxx     http://www.dhs.nu/
ae@xxxxxxxxx  http://www.atari.org/







Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/