From alsa-devel-owner@alsa.jcu.cz  Mon Jul 13 11:51:20 1998
Received: from entry.jcu.cz (perex@entry.jcu.cz [160.217.1.111])
	by marvin.jcu.cz (8.8.8/8.8.8) with SMTP id LAA25554;
	Mon, 13 Jul 1998 11:50:51 +0200
Date: Mon, 13 Jul 1998 11:50:51 +0200 (MET DST)
From: Jaroslav Kysela <perex@jcu.cz>
To: joris jansen <jansen@ats.nld.alcatel.nl>
cc: alsa-devel@alsa.jcu.cz
Subject: Re: Bug in cs4231.c ??
In-Reply-To: <35A9BA8B.D96BC9CA@ats.nld.alcatel.nl>
Message-ID: <Pine.LNX.3.96.980713114250.502B-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 Mon, 13 Jul 1998, joris jansen wrote:

> Jaroslav,
> 
> I'm trying to 'port' the Mozart code to OPTi92x code,
> therefore I started with code-reading. Because my OPTi 924
> card has an AD1845 codec, I'm checking the AD1848 and the CS4231
> code as well. These two chips are quite compatible, though the AD1848
> has some features the CS4231 lacks. (Like supporting every sample rate
> form 4 kHz up to 50kHz) of course the CS4231 has some features the
> AD1848 lacks (like dithering on 8bit samples).
> While reading your code I noticed in the function snd_cs4231_timer_start
> you write to CS4231_TIMER_LOW before you write to CS4231_TIMER_HIGH.
> According to the CS4231A documentation this should be the other way
> around, because a write to CS4231_TIMER_LOW will transfer both
> CS4231_TIMER_LOW and CS4231_TIMER_HIGH to the internal counter.
> I don't know if it's that important, I guess this only 'damages'
> the first loop.

OK. My fault. Fixed.

> 
> Besides this, I also have 2 questions right now:
> - what the f**k is a jiffie ? (I see jiffies appear in the code.)

Variable jiffies is 100Hz counter.

> - what do the functions mb() and schedule() do ?

Function mb() means memory barrier and it isn't important for i386, but
for example on alpha systems this function allows parallel i/o writes to
slow (for example ISA) hardware.

Function shedule() runs other waiting process(es).

Variable jiffies and function shedule() are used in calibration routine.
It seems that CS4231 chip and clones need some big time to calibration
and my code allows run other processes in this time.

						Jaroslav

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


