From alsa-devel-owner@alsa.jcu.cz  Thu Jan 14 14:42:19 1999
Received: from entry.jcu.cz (IDENT:perex@entry.jcu.cz [160.217.1.111])
	by marvin.jcu.cz (8.9.1a/8.9.1) with SMTP id OAA09006;
	Thu, 14 Jan 1999 14:41:43 +0100
Date: Thu, 14 Jan 1999 14:41:43 +0100 (CET)
From: Jaroslav Kysela <perex@jcu.cz>
To: Martin Pahl <pahl@tnt.uni-hannover.de>
cc: alsa-devel@alsa.jcu.cz
Subject: Re: Problem with device-driver for ZA2
In-Reply-To: <199901141250.NAA07125@sokrates.tnt.uni-hannover.de>
Message-ID: <Pine.LNX.3.96.990114143514.19753C-100000@entry.jcu.cz>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

On Thu, 14 Jan 1999, Martin Pahl wrote:

> I've coded the device driver for ZA2 (using alsa0.3.0-pre2 and Linux
> kernel 2.2.0pre5). Interrupts and DMA are running
> fine, but nothing comes out of my speaker. Because there is no real
> documentation for the ALSA architecture (or have you recently worked
> on it) I've a few questions. 
> 
> If I play au-files (cat test.au >/dev/dsp, vplay test.au) some noise
> comes out of the speaker. That's because my driver only supports 16bit
> at 48000Hz stereo and au-files are 8bit, 8kHz, mono. If I play the
> same as wav-file (cat test.wav >/dev/dsp, vplay test.wav) nothing is
> hearable. The same thing happens with playing 16bit, 48kHz, stereo
> wav-files. So what is done with the data in the alsa-kernel in the
> case of au-files, wav-files, 8bit or 16bits, if my driver only
> supports 16bit, 48kHz stereo? If I play 16bit signed data with my own
> programm using the alsa-lib (format=SND_PCM_SFMT_S16_LE) nothing is
> hearable, although the alsa-kernel should not change the data and just
> transfer it to the soundcard (dma and interrupts are working). Is the
> dma-buffer altered after putting the data from userspace to the
> DMA-buffer? Please give me some hints.

ALSA midlevel code does nothing with samples at all. Unchanged data
are immediately (without any conversion delivered to dma() callback which
must do appropriate conversion. You can use some functions for Mu-Law <->
8-bit unsigned conversion and it's all. If you have some special
hardware, you should write own functions for sample conversion.

It looks like on some problem with mixer output...

							Jaroslav

-----
Jaroslav Kysela <perex@jcu.cz>
Academic Computer Centre, University of South Bohemia
Branisovska 31, C. Budejovice, CZ-370 05 Czech Republic


