Module Name:    src
Committed By:   macallan
Date:           Wed Mar  9 05:40:11 UTC 2011

Modified Files:
        src/sys/dev/sbus: dbri.c

Log Message:
change dbri's DMA segment size to a power of two value - the ship allows
segments up to 0x1fff bytes but even rounded to 32bit this seems to
confuse the rest of the audio code these days
TODO: we don't need to interrupt at every single segment
either way, with this mpg123 doesn't produce semi-random funny noises
anymore


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/sbus/dbri.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sbus/dbri.c
diff -u src/sys/dev/sbus/dbri.c:1.32 src/sys/dev/sbus/dbri.c:1.33
--- src/sys/dev/sbus/dbri.c:1.32	Tue Jan 11 00:49:50 2011
+++ src/sys/dev/sbus/dbri.c	Wed Mar  9 05:40:11 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbri.c,v 1.32 2011/01/11 00:49:50 macallan Exp $	*/
+/*	$NetBSD: dbri.c,v 1.33 2011/03/09 05:40:11 macallan Exp $	*/
 
 /*
  * Copyright (C) 1997 Rudolf Koenig (rfkoe...@immd4.informatik.uni-erlangen.de)
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dbri.c,v 1.32 2011/01/11 00:49:50 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dbri.c,v 1.33 2011/03/09 05:40:11 macallan Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -1729,8 +1729,12 @@
 			const audio_params_t *param)
 {
 
-	/* DBRI DMA segment size, rounded down to 32bit alignment */
-	return 0x1ffc;
+	/*
+	 * DBRI DMA segment size can be up to 0x1fff, sixes that are not powers
+	 * of two seem to confuse the upper audio layer so we're going with
+	 * 0x1000 here
+	 */
+	return 0x1000;
 }
 
 static int
@@ -1946,7 +1950,7 @@
 dbri_round_buffersize(void *hdl, int dir, size_t bufsize)
 {
 #ifdef DBRI_BIG_BUFFER
-	return 16*0x1ffc;	/* use ~128KB buffer */
+	return 0x20000;	/* use 128KB buffer */
 #else
 	return bufsize;
 #endif

Reply via email to