Subject: sound is not proper
To: None <Port-mips@netbsd.org>
From: Mahadeva Swamy T L <Swamy@soc-soft.com>
List: port-mips
Date: 02/28/2004 15:44:12
Hi,

I am working on a Audio Driver for MIPS, porting to TX4927 Target Board
with DMA enabled. Presently I am able to hear some junk sound when I
say,

"audioplay file_name.wav" from the application layer.

I feel my Interrupt routine is not properly sending the signal to upper
layer (/dev/audio.c)

This is my Interrupt Routine, can I do this way?

txdma_intr(void *arg)
{
struct txaudio_softc *sc =3D arg;
int s;
int count =3D sc->sc_pages; /* no. of pages (16 * 4026 =3D 65536->Ring
Buffer) */
s =3D splnet();
count --;
if(count =3D=3D 0){
 REGVAL64(DMA_ADDR + DMCSR) |=3D (1ULL << 5); /* Update Control Reg once
the DMA Transfer is Complete */
 REGVAL64(DMA_ADDR + DMCCR) &=3D (1ULL << 10); /* DMA Interrupt Disable =
*/
 REGVAL64(DMA_ADDR + DMCHAR) =3D 0; /* stop DMA */
 if(sc->sc_pintr) 	/* Update the argument through the function
pointer(/dev/audio.c) */
	(*sc->sc_pintr)(sc->sc_parg);
}
else{
 if(sc->sc_pintr)
 (*sc->sc_pintr)(sc->sc_parg);
 REGVAL64(DMA_ADDR + DMCSR) |=3D (1ULL << 5); /* Update Control Reg once
the DMA Transfer is Complete */
}
splx(s);
return (1);

I am using mapped and cacheable region.
Please give some inputs.

Regards
Swamy