kern/31398: [sound] newpcm does not play back the tail of sound
Jean-Yves Lefort
jylefort at FreeBSD.org
Wed Nov 9 13:34:40 GMT 2005
On Wed, 9 Nov 2005 20:45:13 +0800
Ariff Abdullah <skywizard at MyBSD.org.my> wrote:
> On Wed, 9 Nov 2005 13:02:45 +0100
> Jean-Yves Lefort <jylefort at FreeBSD.org> wrote:
> >
> > 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?
> >
> 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 = CTRL_CDC_EN | CTRL_SERR_DIS |
+ es->ctrl = 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);
@@ -502,7 +502,7 @@
if (debug > 0) printf("es_init\n");
es->num = 0;
- es->ctrl = 0;
+ es->ctrl = CTRL_JYSTK_EN;
es->sctrl = 0;
/* initialize the chips */
if ((devid == ES1371_PCI_ID && revid == 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_SYNC_RES);
+ bus_space_write_4(es->st, es->sh, ES1370_REG_CONTROL, es->ctrl); /*added 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 = 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 = ES_SET_SINGLE_PCM_MIX(es->escfg, 0);
}
- es->ctrl = CTRL_CDC_EN | CTRL_SERR_DIS |
+ es->ctrl = CTRL_CDC_EN | CTRL_JYSTK_EN | CTRL_SERR_DIS |
(DAC2_SRTODIV(fixed_rate) << CTRL_SH_PCLKDIV);
es->ctrl |= 3 << CTRL_SH_WTSRSEL;
es_wr(es, ES1370_REG_CONTROL, es->ctrl, 4);
@@ -801,7 +801,7 @@
/* This is NOT ES1370 */
es->escfg = ES_SET_IS_ES1370(es->escfg, 0);
es->num = 0;
- es->ctrl = 0;
+ es->ctrl = CTRL_JYSTK_EN;
es->sctrl = 0;
cssr = 0;
devid = 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 at pci0:9:0: class=0x040100 card=0x13711274 chip=0x13711274 rev=0x08 hdr=0x00 vendor = 'Creative (Was: Ensoniq)'
device = 'ES1371, ES1373 AudioPCI'
class = multimedia
subclass = audio
Thanks
--
Jean-Yves Lefort
jylefort at FreeBSD.org
http://lefort.be.eu.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-multimedia/attachments/20051109/45ba3159/attachment.bin
More information about the freebsd-multimedia
mailing list