[Pkg-alsa-devel] Bug#233200: Too strict max periods constraints for dmix plugin

Michel Dänzer Michel Dänzer , 233200@bugs.debian.org
Tue, 17 Feb 2004 12:25:07 +0100


--=-RZryNNrp8KxQ05Uh6iYM
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Package: alsa-oss
Version: 1.0.2-1
Severity: normal
Tags: patch
X-Debbugs-Cc: alsa-devel@lists.sf.net


I encountered a problem with alsa-oss with some OSS only apps: they try
to limit the maximum number of fragments to a lower value than the
number of periods configured for dmix (the minimum number which provides
smooth playback with all ALSA apps), which fails. This patch changes
oss_dsp_hw_params() to pass the minimum number of periods to
snd_pcm_hw_params_set_periods_max() if it's larger than the maximum
requested by the OSS app. Works here with bzflag at least, but I don't
know if it makes sense in general... Feedback appreciated.


-- System Information:
Debian Release: testing/unstable
Architecture: powerpc
Kernel: Linux thor 2.6.3-rc3-ben1-ck1 #1 Mon Feb 16 16:25:14 CET 2004
ppc
Locale: LANG=de_CH.UTF-8, LC_CTYPE=de_CH.UTF-8

Versions of packages alsa-oss depends on:
hi  libasound2	1.0.1+cvs20040120-1 Advanced Linux Sound Architecture 
ii  libc6	2.3.2.ds1-11        GNU C Library: Shared libraries an

-- no debconf information


-- 
Earthling Michel Dänzer      |     Debian (powerpc), X and DRI developer
Libre software enthusiast    |   http://svcs.affero.net/rm.php?r=daenzer

--=-RZryNNrp8KxQ05Uh6iYM
Content-Description: 
Content-Disposition: inline; filename=alsa-oss-max-fragments.diff
Content-Type: text/x-patch; charset=UTF-8
Content-Transfer-Encoding: 7bit

? build-arch-stamp
? debian
? local.diff
Index: alsa-oss.c
===================================================================
RCS file: /cvsroot/alsa/alsa-oss/alsa-oss.c,v
retrieving revision 1.41
diff -p -u -r1.41 alsa-oss.c
--- alsa-oss.c	1 Dec 2003 14:06:23 -0000	1.41
+++ alsa-oss.c	27 Jan 2004 17:01:31 -0000
@@ -250,7 +250,9 @@ static int oss_dsp_hw_params(oss_dsp_t *
 			if (err < 0)
 				return err;
 			if (dsp->maxfrags > 0) {
-				unsigned int periods_max = dsp->maxfrags;
+				unsigned int periods_max = periods_min > dsp->maxfrags
+							 ? periods_min
+							 : dsp->maxfrags;
 				err = snd_pcm_hw_params_set_periods_max(pcm, hw,
 									&periods_max, 0);
 				if (err < 0)

--=-RZryNNrp8KxQ05Uh6iYM--