From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: aplay/arecord hang at 44100 Hz Date: Wed, 12 Feb 2003 12:48:01 +0100 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: <3E476DD8.7050907@uni-bonn.de> <3E49291E.7000307@uni-bonn.de> <3E4A140A.7050300@uni-bonn.de> Mime-Version: 1.0 (generated by SEMI 1.14.4 - "Hosorogi") Content-Type: multipart/mixed; boundary="Multipart_Wed_Feb_12_12:48:00_2003-1" Return-path: In-Reply-To: <3E4A140A.7050300@uni-bonn.de> Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: Josh Buhl Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org --Multipart_Wed_Feb_12_12:48:00_2003-1 Content-Type: text/plain; charset=US-ASCII Hi Josh, the debug trace really helps debugging. could you try the attached patch? thanks, Takashi --Multipart_Wed_Feb_12_12:48:00_2003-1 Content-Type: application/octet-stream Content-Disposition: attachment; filename="rate-multi-fix.dif" Content-Transfer-Encoding: 7bit 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); --Multipart_Wed_Feb_12_12:48:00_2003-1-- ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com