Re: [hatari-devel] Falcon left-right sound swapper bug? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Falcon left-right sound swapper bug?
- From: David Savinkoff <dsavnkff@xxxxxxxxx>
- Date: Thu, 17 Apr 2014 09:09:04 -0600 (MDT)
- Thread-index: 6Ku/Z/0tbZMTjynw0kJ8w3n1WzutdA==
- Thread-topic: Falcon left-right sound swapper bug?
----- Eero Tamminen wrote:
> Hi,
>
> On torstai 17 huhtikuu 2014, David Savinkoff wrote:
> > crossbar.c is the only file that has:
> > dac.readPosition :: dac.writePosition
> > and:
> > adc2dac_readBufferPosition :: adc2dac_writeBufferPosition
> >
> > These circular buffer indexes must check that they do not over-run each
> > other.
> >
> > dmaSnd.c maintains the circular buffer indexes with:
> > static void DmaSnd_FIFO_Refill(void);
> > static Sint8 DmaSnd_FIFO_PullByte(void);
> >
> > crossbar.c has incomplete functions:
> > void Crossbar_GetMicrophoneDatas(Sint16 *micro_bufferL, Sint16
> > *micro_bufferR, Uint32 microBuffer_size); static void
> > Crossbar_SendDataToDAC(Sint16 value, Uint16 sample_pos); void
> > Crossbar_GenerateSamples(int nMixBufIdx, int nSamplesToGenerate);
>
> There's following old bug in Hatari Crossbar DMA code:
> http://listengine.tuxfamily.org/lists.tuxfamily.org/hatari-
> devel/2012/02/msg00082.html
>
> It doesn't check the indeces given by emulated code
> which is really bad because emulated code can then
> corrupt Hatari's own memory. That might then have also
> other effects.
>
>
> - Eero
>
The 'read buffer position' and 'write buffer position' pointers
stay within the buffer's allocated space, but each are unaware
of the others existence and can become unsynchronized.