Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Josh Buhl <uzs33d@uni-bonn.de>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: aplay/arecord hang at 44100 Hz
Date: Wed, 12 Feb 2003 12:48:01 +0100	[thread overview]
Message-ID: <s5hr8adn2j2.wl@alsa2.suse.de> (raw)
In-Reply-To: <3E4A140A.7050300@uni-bonn.de>

[-- Attachment #1: Type: text/plain, Size: 103 bytes --]

Hi Josh,

the debug trace really helps debugging.
could you try the attached patch?


thanks,

Takashi

[-- Attachment #2: rate-multi-fix.dif --]
[-- Type: application/octet-stream, Size: 1232 bytes --]

Index: alsa-lib/src/pcm/pcm_params.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-lib/src/pcm/pcm_params.c,v
retrieving revision 1.31
diff -u -r1.31 pcm_params.c
--- alsa-lib/src/pcm/pcm_params.c	12 Feb 2003 11:37:09 -0000	1.31
+++ alsa-lib/src/pcm/pcm_params.c	12 Feb 2003 11:38:01 -0000
@@ -966,14 +966,19 @@
 	const snd_interval_t *it = hw_param_interval_c(src, var);
 	const snd_interval_t *st = hw_param_interval_c(params, var);
 	if (snd_interval_single(it)) {
-		unsigned int best = snd_interval_min(it), cur;
-		for (cur = best; ; cur += best) {
+		unsigned int best = snd_interval_min(it), cur, prev;
+		cur = best;
+		for (;;) {
 			if (st->max < cur || (st->max == cur && st->openmax))
 				break;
-			if (it->min > cur || (it->min == cur && st->openmin))
-				continue;
-			if (snd_pcm_hw_param_set(pcm, params, SND_TRY, var, cur, 0) == 0)
-				return 0; /* ok */
+			if (it->min <= cur && ! (it->min == cur && st->openmin)) {
+				if (! snd_pcm_hw_param_set(pcm, params, SND_TRY, var, cur, 0))
+					return; /* ok */
+			}
+			prev = cur;
+			cur += best;
+			if (cur <= prev)
+				break;
 		}
 	}
 	return snd_pcm_hw_param_refine_near(pcm, params, var, src);

  reply	other threads:[~2003-02-12 11:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-10  9:16 aplay/arecord hang at 44100 Hz Josh Buhl
2003-02-11  9:41 ` Takashi Iwai
2003-02-11 16:47   ` Josh Buhl
2003-02-11 17:03     ` Takashi Iwai
2003-02-12  9:01       ` Josh Buhl
2003-02-12  9:29       ` Josh Buhl
2003-02-12 11:48         ` Takashi Iwai [this message]
2003-02-12 12:18           ` Josh Buhl
2003-02-12 12:20             ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hr8adn2j2.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=uzs33d@uni-bonn.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox