From alsa-devel-owner@alsa.jcu.cz  Mon Sep 14 15:19:43 1998
Received: from darwi.internal ([194.88.121.181])
	by marvin.jcu.cz (8.8.8/8.8.8) with ESMTP id PAA18216
	for <alsa-devel@alsa.jcu.cz>; Mon, 14 Sep 1998 15:18:51 +0200
Received: from localhost (dmoerenh@localhost)
	by darwi.internal (8.8.8/8.8.8) with SMTP id PAA08991
	for <alsa-devel@alsa.jcu.cz>; Mon, 14 Sep 1998 15:31:26 +0200
Date: Mon, 14 Sep 1998 15:31:26 +0200 (MET DST)
From: Dirk Moerenhout <dmoerenh@livingstone.be>
To: alsa-devel@alsa.jcu.cz
Subject: Patch to get more record/playback rates on CS4236 compatibles
Message-ID: <Pine.LNX.3.95.980914150442.8394D-200000@darwi.internal>
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="666112-1273752936-905779886=:8394"
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--666112-1273752936-905779886=:8394
Content-Type: TEXT/PLAIN; charset=US-ASCII

I heard of alsa for the first time last week after which I downloaded
it. I've installed at work (SB16) and at home (CS4236B). It works
pretty good for me so that already made me kinda happy :)

As this seems to be a pretty new project (mailing-list volume is pretty
low at the moment ;) ) I guess some help might come in handy. As I only
started looking at it last week you shouldn't expect to much already but
I do have a first patch for /lowlevel/isa/cs4236.c.

Description of patch:
in 0.2.0-pre7 (so the latest I guess) the rates a cs4236 can use for
are limited to 10 rates (48000, 44100, 32000, 27420, 22050, 16000,
11025, 9600, 8000, 6620). These are only a few of the possibilities and
I couldn't see an immediate reason for limiting them to only 10.
Therefor I wrote a patch to address this. The result of the patch is
that you have somewhat more than 170 rates, it can handle from 50400hz
to 5512.5hz. Sanity checking is done although not really necessary as at
the moment the ranges are already limited to 48000 to 5510.

I have tested it at home and it works fine. To check the difference
simply play a raw sample at both 8000hz and 7999hz with the old and the
new driver. With the old there's a big difference between 8000 and 7999
because the 7999 becomes 6620. After applying the patch this is gone.



My computer (A recent DELL) also has a PCI 3D Sound-accelerator which
should be a CS4610 and the wavetable add-on CS9236. I am going to play
with both of them as alsa progresses and will help to add support. I
have downloaded docs for all CS-chips and while accustoming myself with
the alsa-code I'll use these to see if enhancements can be made. I
might also install my good old SB 1.5 (cheer, 8bit mono sound ;) ) and a
classic GUS.


I really think we can do sound better than OSS. GPL is the way to go,
it's ridiculous that one should have to pay 20$ to get something as
simple as sound working.

Dirk Moerenhout

--666112-1273752936-905779886=:8394
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="patch.2"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.95.980914153126.8394E@darwi.internal>
Content-Description: Patch to get more record/playbackrates on CS4236 comp.

LS0tIG9sZC9jczQyMzYuYwlNb24gU2VwIDE0IDEyOjE1OjI2IDE5OTgNCisr
KyBjczQyMzYuYwlNb24gU2VwIDE0IDEyOjE5OjQyIDE5OTgNCkBAIC0xNDIs
MzEgKzE0Miw1MSBAQA0KIHsNCiAgIHN0YXRpYyBzdHJ1Y3Qgew0KICAgICB1
bnNpZ25lZCBjaGFyIHZhbDsNCisgICAgdW5zaWduZWQgaW50IGRpdmlkZXI7
DQogICAgIHVuc2lnbmVkIGludCByYXRlOw0KLSAgfSByYXRlc1tdID0gew0K
LSAgICB7IDEsICAgNDgwMDAgfSwNCi0gICAgeyAyNCwgIDQ0MTAwIH0sDQot
ICAgIHsgMiwgICAzMjAwMCB9LA0KLSAgICB7IDQ4LCAgMjIwNTAgfSwNCi0g
ICAgeyAzLCAgIDI3NDIwIH0sDQotICAgIHsgNCwgICAxNjAwMCB9LA0KLSAg
ICB7IDk2LCAgMTEwMjUgfSwNCi0gICAgeyA1LCAgIDk2MDAgfSwNCi0gICAg
eyA2LCAgIDgwMDAgfSwNCi0gICAgeyA3LCAgIDY2MjAgfSwNCisgIH0gZGl2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aWRlciA8IDMzNiApDQorICAgIHsNCisgICAgICB2YWwgPSAyMTsN
CisgICAgfQ0KKyAgICBlbHNlDQorICAgIHsNCisgICAgICB2YWwgPSBkaXZp
ZGVyIC8gMTY7DQorICAgIH0NCisgIH0NCisgIHJyYXRlID0gY2xvY2tyYXRl
IC8gKCB2YWwgKiAxNiApOw0KICAgaWYgKCByZWFsX3JhdGUgKQ0KLSAgICAq
cmVhbF9yYXRlID0gcmF0ZXNbaWR4XS5yYXRlOw0KLSAgcmV0dXJuIHJhdGVz
WzldLnZhbDsNCisgICAgKnJlYWxfcmF0ZSA9IHJyYXRlOw0KKyAgcmV0dXJu
IHZhbDsNCiB9DQogDQogc3RhdGljIHVuc2lnbmVkIGludCBzbmRfY3M0MjM2
X3hyYXRlKCBzbmRfcGNtMV90ICpwY20xLCBjczQyMzFfdCAqY29kZWMsIHVu
c2lnbmVkIGludCByYXRlICkNCg==
--666112-1273752936-905779886=:8394--

