aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sound/pcm/channel.c
diff options
context:
space:
mode:
authorAriff Abdullah <ariff@FreeBSD.org>2006-01-24 01:10:07 +0000
committerAriff Abdullah <ariff@FreeBSD.org>2006-01-24 01:10:07 +0000
commit14665331abd9d0186dcb9d79e54944dd8148647c (patch)
treeb485e6ba2c926dc4b3a555f290561dbe40d1de09 /sys/dev/sound/pcm/channel.c
parent7f34b521c733a71bc3a398cdc7ade794461acab7 (diff)
downloadsrc-14665331abd9d0186dcb9d79e54944dd8148647c.tar.gz
src-14665331abd9d0186dcb9d79e54944dd8148647c.zip
channel.c:
(1) Fix DMA alignment, based on bytes per sample. feeder_rate.c: Handle strayed bytes (mostly caused by #1) better. This DMA alignment issues are extremely hard to reproduce unless the user happen to have a 32bit capable soundcards (ATI IXP) and knowledgeable enough to force it to operate under pure 32bit operations on both record and play directions.
Notes
Notes: svn path=/head/; revision=154741
Diffstat (limited to 'sys/dev/sound/pcm/channel.c')
-rw-r--r--sys/dev/sound/pcm/channel.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index 0b16dc477d60..f17a9ab2a59a 100644
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -34,8 +34,11 @@
SND_DECLARE_FILE("$FreeBSD$");
#define MIN_CHUNK_SIZE 256 /* for uiomove etc. */
+#if 0
#define DMA_ALIGN_THRESHOLD 4
#define DMA_ALIGN_MASK (~(DMA_ALIGN_THRESHOLD - 1))
+#endif
+#define DMA_ALIGN_MASK(bps) (~((bps) - 1))
#define CANCHANGE(c) (!(c->flags & CHN_F_TRIGGERED))
@@ -1253,7 +1256,10 @@ chn_getptr(struct pcm_channel *c)
#if 1
hwptr &= ~a ; /* Apply channel align mask */
#endif
+#if 0
hwptr &= DMA_ALIGN_MASK; /* Apply DMA align mask */
+#endif
+ hwptr &= DMA_ALIGN_MASK(sndbuf_getbps(c->bufhard));
return hwptr;
}