From: Matthias Rampke Date: Sat, 7 May 2011 22:18:41 +0000 (+0200) Subject: sound/pcm: fix calculation of PCM channel timeout X-Git-Url: http://gitweb.dragonflybsd.org/~matthiasr/dragonfly.git/commitdiff_plain/4d3f6d0ed3435 sound/pcm: fix calculation of PCM channel timeout this fixes a "pcm0:virtual:0:dsp0.2: play interrupt timeout, channel dead" error and sound dying after a few seconds of playback. I encountered on my Thinkpad X40. It was discussed on freebsd-current in 2004[1] but that code is no longer present in FBSD while we still have it. The patch removes a line fixing a channel timeout to 1 tick instead of the value calculated immediately beforehand, thus restoring the calculation. [1] http://lists.freebsd.org/pipermail/freebsd-current/2004-September/036805.html --- diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 45f5d8f..cecf972 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -340,7 +340,7 @@ chn_write(struct pcm_channel *c, struct uio *buf, int ioflags) timeout = (hz * sndbuf_getblksz(bs)) / (sndbuf_getspd(bs) * sndbuf_getbps(bs)); if (timeout < 1) timeout = 1; - timeout = 1; + /* timeout = 1; */ ret = chn_sleep(c, "pcmwr", timeout); if (ret == EWOULDBLOCK) { count -= timeout;