From 4d3f6d0ed343546cbd7c8cfeaf0cce3f449122b6 Mon Sep 17 00:00:00 2001 From: Matthias Rampke Date: Sun, 8 May 2011 00:18:41 +0200 Subject: [PATCH] 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 --- sys/dev/sound/pcm/channel.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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; -- 1.7.7.2