Subject: RE: Audio file in /dev
To: Jared D. McNeill <jmcneill@invisible.ca>
From: Mahadeva Swamy T L <Swamy@soc-soft.com>
List: tech-kern
Date: 02/27/2004 20:53:17
Thank You for replying.


I am working on a Audio Driver with DMA enabled. Presently I am able to
hear some junk data when I say,

"audioplay file_name.wav" from the application layer.

I feel I have some problem in the Interrupt Routine:
This is my Interrupt Routine, Please verify:

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) */
=09
	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(/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




-----Original Message-----
From: Jared D. McNeill [mailto:jmcneill@invisible.ca]=20
Sent: Friday, February 27, 2004 8:29 PM
To: Mahadeva Swamy T L
Cc: tech-kern@netbsd.org
Subject: Re: Audio file in /dev


On 27-Feb-04, at 2:27 AM, Mahadeva Swamy T L wrote:

> I need to support the Audio Driver. I wanted to know whether the
> audio.c
> present in /sys/dev/ directory can be used to communicate between the
> application and the lower level driver, can I rely upon that? Will it
> hook-up to the Lower Level driver.

Yep! The audio(9) man page explains the API that the low-level HW=20
driver uses to interface with the audio subsystem. You also might want=20
to have a look at some of the existing drivers to see how they=20
interface with it.

Cheers,
Jared