From patchwork Mon Apr 28 16:00:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 4079981 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 45C75BFF02 for ; Mon, 28 Apr 2014 16:00:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 777A0202B4 for ; Mon, 28 Apr 2014 16:00:28 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id EFB5C20268 for ; Mon, 28 Apr 2014 16:00:26 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 09CD32616EF; Mon, 28 Apr 2014 18:00:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 126062617AD; Mon, 28 Apr 2014 18:00:15 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 059E72619F0; Mon, 28 Apr 2014 18:00:14 +0200 (CEST) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 722402616EF for ; Mon, 28 Apr 2014 18:00:06 +0200 (CEST) Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1F10AACF0; Mon, 28 Apr 2014 16:00:06 +0000 (UTC) Date: Mon, 28 Apr 2014 18:00:06 +0200 Message-ID: From: Takashi Iwai To: Andoru In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: alsa-devel@alsa-project.org Subject: Re: [alsa-devel] Invalid PCM pointer with CMI8738 and pcm.c buffer underuns X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP At Sun, 20 Apr 2014 15:04:48 +0000 (UTC), Andoru wrote: > > [Continued from here: > http://news.gmane.org/find-root.php?message_id=loom.20140406T010044%2d863%40post.gmane.org] > > Since I didn't get any answer again, I decided to try and build the latest > ALSA snapshots myself (alsa-driver-1.0.25.3584.gb044d; It's way too old. Better to build the latest kernel. > alsa-firmware-1.0.27.2.gf21a8; alsa-lib-1.0.27.2; alsa-oss-1.0.25.2.g39df1; > alsa-plugins-1.0.27.10.gb5917; alsa-utils-1.0.27.2.22.gb7ed4) and purge the > Debian ALSA packages to see if I could do something at compile time or if it > would fix the problems, but they're still there. The OS still slows down to > a crawl at random times and I still have the issue with the volume control > plus other quirks I mentioned in the previous threads... You need to figure out the condition reproducing the issue. For example, application may apply some strange buffer size and period size the hardware chip doesn't like. If so, changing the buffer size and/or period size may reduce the problem. Meanwhile, you can try the patch below, too, which aligns the period size. Takashi diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index 12c318e175f4..e8c8a2256fd2 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c @@ -1683,6 +1683,7 @@ static int snd_cmipci_playback_open(struct snd_pcm_substream *substream) runtime->hw.rate_max = 128000; } snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 0x10000); + snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); cm->dig_pcm_status = cm->dig_status; return 0; } @@ -1708,6 +1709,7 @@ static int snd_cmipci_capture_open(struct snd_pcm_substream *substream) runtime->hw.rate_max = 128000; } snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 0x10000); + snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); return 0; } @@ -1746,6 +1748,7 @@ static int snd_cmipci_playback2_open(struct snd_pcm_substream *substream) runtime->hw.rate_max = 128000; } snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 0x10000); + snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); return 0; } @@ -1772,6 +1775,7 @@ static int snd_cmipci_playback_spdif_open(struct snd_pcm_substream *substream) runtime->hw = snd_cmipci_playback_iec958_subframe; } snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 0x40000); + snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); cm->dig_pcm_status = cm->dig_status; return 0; } @@ -1791,6 +1795,7 @@ static int snd_cmipci_capture_spdif_open(struct snd_pcm_substream *substream) runtime->hw.rate_max = 96000; } snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 0x40000); + snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); return 0; }