From alsa-devel-owner@alsa.jcu.cz  Fri Jan 29 16:10:50 1999
Received: from aleph.net.uniovi.es (aleph.net.uniovi.es [156.35.11.1])
	by marvin.jcu.cz (8.9.1a/8.9.1) with ESMTP id QAA07204
	for <alsa-devel@alsa.jcu.cz>; Fri, 29 Jan 1999 16:10:24 +0100
Received: from trasgu.aic.uniovi.es by aleph.net.uniovi.es
 (PMDF V5.1-11 #30226) with SMTP id <01J74AKQNYAE00775X@aleph.net.uniovi.es>
 for alsa-devel@alsa.jcu.cz; Fri, 29 Jan 1999 16:10:22 +0100 (MET)
Received: from pcinf28.inforg.uniovi.es by trasgu.aic.uniovi.es
 (NX5.67c/NX3.0S) id AA02648; Fri, 29 Jan 1999 16:10:12 +0000 (GMT)
Date: Sat, 02 Jan 1999 06:22:11 +0000
From: Unai Uribarri <unai@dobra.aic.uniovi.es>
Subject: IOCTL changes
To: alsa-devel <alsa-devel@alsa.jcu.cz>
Message-id: <004f01be3618$3be793e0$4382239c@pcinf28.inforg.uniovi.es>
MIME-version: 1.0
Content-type: multipart/alternative;
 boundary="----=_NextPart_000_004C_01BE3618.3B6A4D90"
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

This is a multi-part message in MIME format.

------=_NextPart_000_004C_01BE3618.3B6A4D90
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I think that to check the result of the ioctl call when changing the =
format will be convenient.=20
This little patch do it.

Also, I propose to change the name of SND_PCM1_IOCTL_RATE to =
SND_PCM1_IOCTL_FORMAT, or at least
to define an alias.


--- pcm1_native.c.old      Wed Jan 27 10:57:08 1999
+++ pcm1_native.c       Fri Jan 29 16:03:55 1999
@@ -1132,7 +1132,8 @@
        }
        pchn->rate =3D format.rate;
        pchn->voices =3D format.channels;
-       pchn->hw.ioctl(pcm1, SND_PCM1_IOCTL_RATE, NULL);
+       if (pchn->hw.ioctl(pcm1, SND_PCM1_IOCTL_RATE, NULL)<0)
+               err =3D -EINVAL;
        pchn->flags |=3D SND_PCM1_FLG_BUFFERS;
        pchn->neutral_byte =3D pchn->mode & =
(SND_PCM1_MODE_16|SND_PCM1_MODE_24|SND
_PCM1_MODE_32|SND_PCM1_MODE_FLOAT) ? 0x00 : 0x80;
        snd_pcm1_proc_format(direction =3D=3D SND_PCM1_PLAYBACK ?


------=_NextPart_000_004C_01BE3618.3B6A4D90
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.2106.6"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2></FONT><FONT color=3D#000000 size=3D2>I think that =
to check the=20
result of the ioctl call when changing the format will be convenient.=20
</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>This little patch do =
it.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Also, I propose to change the name of =
SND_PCM1_IOCTL_RATE to=20
SND_PCM1_IOCTL_FORMAT, or at least</FONT></DIV>
<DIV><FONT size=3D2>to define an alias.</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>--- pcm1_native.c.old&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Wed Jan 27=20
10:57:08 1999<BR>+++ pcm1_native.c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Fri Jan=20
29 16:03:55 1999<BR>@@ -1132,7 +1132,8=20
@@<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pchn-&gt;rate =3D=20
format.rate;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
pchn-&gt;voices =3D=20
format.channels;<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
pchn-&gt;hw.ioctl(pcm1, SND_PCM1_IOCTL_RATE,=20
NULL);<BR>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if =
(pchn-&gt;hw.ioctl(pcm1,=20
SND_PCM1_IOCTL_RATE,=20
NULL)&lt;0)<BR>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;=20
err =3D -EINVAL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
pchn-&gt;flags |=3D=20
SND_PCM1_FLG_BUFFERS;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
pchn-&gt;neutral_byte =3D pchn-&gt;mode &amp;=20
(SND_PCM1_MODE_16|SND_PCM1_MODE_24|SND<BR>_PCM1_MODE_32|SND_PCM1_MODE_FLO=
AT) ?=20
0x00 : 0x80;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
snd_pcm1_proc_format(direction =3D=3D SND_PCM1_PLAYBACK=20
?<BR></FONT></DIV></BODY></HTML>

------=_NextPart_000_004C_01BE3618.3B6A4D90--


