From alsa-devel-owner@alsa.jcu.cz  Fri Dec 18 19:57:53 1998
Received: from bologna.nettuno.it (bologna.nettuno.it [193.43.2.1])
	by marvin.jcu.cz (8.9.1a/8.9.1) with ESMTP id TAA29817
	for <alsa-devel@alsa.jcu.cz>; Fri, 18 Dec 1998 19:56:54 +0100
Received: from igor.opun.it (ppp06-gw1.faenza.nettuno.it [193.207.49.147])
	by bologna.nettuno.it (8.8.6/8.8.6/NETTuno 3.1) with ESMTP id TAA07856
	for <alsa-devel@alsa.jcu.cz>; Fri, 18 Dec 1998 19:56:49 +0100 (MET)
Received: from racine.ra.it (localhost [127.0.0.1])
	by igor.opun.it (8.8.8/8.8.8) with ESMTP id TAA27194
	for <alsa-devel@alsa.jcu.cz>; Fri, 18 Dec 1998 19:56:44 +0100
Message-ID: <367AA56B.D88B998A@racine.ra.it>
Date: Fri, 18 Dec 1998 19:56:43 +0100
From: Abramo Bagnara <abbagnara@racine.ra.it>
MIME-Version: 1.0
To: alsa-devel@alsa.jcu.cz
Subject: Re: i'm a bit confused about PCI DMA versus Bus-Master..
References: <36793FFC.FDAFCD4D@cineca.it>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

Andrea Venturi wrote:
> 
> in brief.. i'm looking for a first implementation of a PCM/Mixer driver
> for my ess maestro ii card and i'm trying to understand the other pci
> cards alsa driver (like sonicvibes ..)
> 
> .... omissis ....
> 
> Instead, in the C source that i can browse, there is an autonomous timer
> (named BOB timer), that is programmed before the bus master transfer
> start, and raise an interrupt asynchronously (obviously before the
> playback come to the end of the buffer).
> 
> The interrupt service routine read from the chip the actual position of
> the playback in the buffer and set a global variable to this value, then
> the program loop fills the already consumed part of the buffer with new
> data from the "wav" file..
> 
> is this a clean way to  use the interrupt and feed the buffer for
> playback?

I'm the maintainer of ESS 1869 ALSA driver and I find this message very
interesting.

ES1869 has two audio channel, the first with record and playback
capability
and the second with playback only capability.

Using both channel with auto init DMA (both channel sharing the same
interrupt
and raising independently) at an high speed (44100 Hz) with a buffer of
65536
bytes divided in 4 fragments, the first channel omit about 1 interrupt
per
second.

Consequently 1st channel playback slows down and sound is garbled.
I have the same trouble using full duplex.
After many tries I feel that this is an hardware limit.

Windows driver does not suffer of this (in an ideal condition...)
I explain better:
using Audiorack to play a 44100 wav and Audio Recorder to record the
same sound
works without problems, but
if I use Audiorack to play the same wav and I switch window (putting
Audiorack
in "background") playback is paused shortly every few seconds.

There is a possibility that other ESS chips suffer of this and this is
the
reason to use and autonomous timer (BTW where I can find this source?)

There is many way to do ADC and DAC on these chips:
- programmed I/O (to avoid like the plague in a multitasking
environment)
- non autoinit DMA (not suitable for a not real time OS, I think)
- autoinit DMA with interrupt raise at end of fragment (the best way,
but
  I'm not able to make it work)
- hybrid way (like in that C source)
- others?

I don't know how Windows driver works, I've tried to read DSP registers
and mixer
registers during playback but all registers return 0xff (I suppose that
Windows
inhibits I/O ports reading/writing when it uses it). Reading the same
registers
when playback is not active works regularly, but I've not found any
useful info.

I hope that my experience with ES1869 would be useful to other ESS
driver developer.
(Reading 1688 and solo1 driver I've found the programming interface very
similar).

I'd like very much to have other opinions and experiences about this
strange trouble.

> 
> ciao
> 
> andrea

Ciao

Abramo

