Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Nov 2005 14:34:35 +0100
From:      Jean-Yves Lefort <jylefort@FreeBSD.org>
To:        Ariff Abdullah <skywizard@MyBSD.org.my>
Cc:        freebsd-multimedia@FreeBSD.org
Subject:   Re: kern/31398: [sound] newpcm does not play back the tail of sound
Message-ID:  <20051109143435.7ee172cb.jylefort@FreeBSD.org>
In-Reply-To: <20051109204513.54f482d3.skywizard@MyBSD.org.my>
References:  <200511081520.jA8FKJZd045781@freefall.freebsd.org> <20051108233517.5ec73d79.skywizard@MyBSD.org.my> <20051108181710.5c94a158.jylefort@FreeBSD.org> <20051109174843.7e97f8d7.skywizard@MyBSD.org.my> <20051109130245.3e807703.jylefort@FreeBSD.org> <20051109204513.54f482d3.skywizard@MyBSD.org.my>

next in thread | previous in thread | raw e-mail | index | archive | help
--Signature=_Wed__9_Nov_2005_14_34_36_+0100_f5jwmRpZ4yErazx0
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, 9 Nov 2005 20:45:13 +0800
Ariff Abdullah <skywizard@MyBSD.org.my> wrote:

> On Wed, 9 Nov 2005 13:02:45 +0100
> Jean-Yves Lefort <jylefort@FreeBSD.org> wrote:
> >=20
> > I also like the 2nd DAC support for es137x cards. Good job. Do you
> > think you will be able to MFC your mega-patch for 6.1?
> >=20
> Hopefully before 6.1 all dust will be settled.

Excellent. While here, could you also incorporate kern/40132 (and
kern/20297 can be closed)?

Without your patch:

--- sys/dev/sound/pci/es137x.c.orig	Tue May 10 00:55:52 2005
+++ sys/dev/sound/pci/es137x.c	Wed Oct  5 21:21:42 2005
@@ -474,7 +474,7 @@
 static int
 es1370_init(struct es_info *es)
 {
-	es->ctrl =3D CTRL_CDC_EN | CTRL_SERR_DIS |
+	es->ctrl =3D CTRL_CDC_EN | CTRL_JYSTK_EN | CTRL_SERR_DIS |
 		(DAC2_SRTODIV(DSP_DEFAULT_SPEED) << CTRL_SH_PCLKDIV);
 	bus_space_write_4(es->st, es->sh, ES1370_REG_CONTROL, es->ctrl);
=20
@@ -502,7 +502,7 @@
 	if (debug > 0) printf("es_init\n");
=20
 	es->num =3D 0;
-	es->ctrl =3D 0;
+	es->ctrl =3D CTRL_JYSTK_EN;=09
 	es->sctrl =3D 0;
 	/* initialize the chips */
 	if ((devid =3D=3D ES1371_PCI_ID && revid =3D=3D ES1371REV_ES1373_8) ||
@@ -521,9 +521,10 @@
 	bus_space_write_4(es->st, es->sh, ES1370_REG_SERIAL_CONTROL, es->sctrl);
 	bus_space_write_4(es->st, es->sh, ES1371_REG_LEGACY, 0);
 	/* AC'97 warm reset to start the bitclk */
-	bus_space_write_4(es->st, es->sh, ES1371_REG_LEGACY, es->ctrl | ES1371_SY=
NC_RES);
+	bus_space_write_4(es->st, es->sh, ES1370_REG_CONTROL, es->ctrl);					/*ad=
ded CTRL_JYSTK_EN*/
+	bus_space_write_4(es->st, es->sh, ES1371_REG_LEGACY,ES1371_SYNC_RES);
 	DELAY(2000);
-	bus_space_write_4(es->st, es->sh, ES1370_REG_SERIAL_CONTROL, es->ctrl);
+	bus_space_write_4(es->st, es->sh, ES1370_REG_SERIAL_CONTROL, es->sctrl);
 	/* Init the sample rate converter */
 	bus_space_write_4(es->st, es->sh, ES1371_REG_SMPRATE, ES1371_DIS_SRC);
 	for (idx =3D 0; idx < 0x80; idx++)

Adapted to your patch:

--- sys/dev/sound/pci/es137x.c.orig	Tue Nov  8 16:56:09 2005
+++ sys/dev/sound/pci/es137x.c	Tue Nov  8 17:04:24 2005
@@ -771,7 +771,7 @@
 	} else {
 		es->escfg =3D ES_SET_SINGLE_PCM_MIX(es->escfg, 0);
 	}
-	es->ctrl =3D CTRL_CDC_EN | CTRL_SERR_DIS |
+	es->ctrl =3D CTRL_CDC_EN | CTRL_JYSTK_EN | CTRL_SERR_DIS |
 		(DAC2_SRTODIV(fixed_rate) << CTRL_SH_PCLKDIV);
 	es->ctrl |=3D 3 << CTRL_SH_WTSRSEL;
 	es_wr(es, ES1370_REG_CONTROL, es->ctrl, 4);
@@ -801,7 +801,7 @@
 	/* This is NOT ES1370 */
 	es->escfg =3D ES_SET_IS_ES1370(es->escfg, 0);
 	es->num =3D 0;
-	es->ctrl =3D 0;
+	es->ctrl =3D CTRL_JYSTK_EN;=09
 	es->sctrl =3D 0;
 	cssr =3D 0;
 	devid =3D pci_get_devid(es->dev);
@@ -824,9 +824,10 @@
 		DELAY(20000);
 	}
 	/* AC'97 warm reset to start the bitclk */
-	es_wr(es, ES1370_REG_CONTROL, es->ctrl | ES1371_SYNC_RES, 4);
-	DELAY(2000);
 	es_wr(es, ES1370_REG_CONTROL, es->ctrl, 4);
+	es_wr(es, ES1371_REG_LEGACY, ES1371_SYNC_RES, 4);
+	DELAY(2000);
+	es_wr(es, ES1370_REG_CONTROL, es->sctrl, 4);
 	es1371_wait_src_ready(es);
 	/* Init the sample rate converter */
 	es_wr(es, ES1371_REG_SMPRATE, ES1371_DIS_SRC, 4);

Both versions work fine for me, my sound card:

pcm0@pci0:9:0:  class=3D0x040100 card=3D0x13711274 chip=3D0x13711274 rev=3D=
0x08 hdr=3D0x00    vendor   =3D 'Creative (Was: Ensoniq)'
    device   =3D 'ES1371, ES1373 AudioPCI'
    class    =3D multimedia
    subclass =3D audio

Thanks

--=20
Jean-Yves Lefort

jylefort@FreeBSD.org
http://lefort.be.eu.org/

--Signature=_Wed__9_Nov_2005_14_34_36_+0100_f5jwmRpZ4yErazx0
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (FreeBSD)

iD8DBQFDcfrsyzD7UaO4AGoRApxkAJ43q7mVqmGT8QPvTGQUmpMWKjERhQCeP9wc
fBl4UEYTOXYfVbi4VCNGxt8=
=Wk2m
-----END PGP SIGNATURE-----

--Signature=_Wed__9_Nov_2005_14_34_36_+0100_f5jwmRpZ4yErazx0--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051109143435.7ee172cb.jylefort>