Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Andoru <andoru.blah@gmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: Invalid PCM pointer with CMI8738 and pcm.c buffer	underuns
Date: Mon, 28 Apr 2014 18:00:06 +0200	[thread overview]
Message-ID: <s5heh0hbg1l.wl%tiwai@suse.de> (raw)
In-Reply-To: <loom.20140420T165832-72@post.gmane.org>

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;
 }
 

  reply	other threads:[~2014-04-28 16:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-20 15:04 Invalid PCM pointer with CMI8738 and pcm.c buffer underuns Andoru
2014-04-28 16:00 ` Takashi Iwai [this message]
2014-04-29  1:12   ` Andoru
  -- strict thread matches above, loose matches on Subject: below --
2014-04-28 21:28 Andoru
2014-04-29  6:04 ` Takashi Iwai
2014-04-29 13:06   ` Andoru
2014-04-29 14:26     ` Takashi Iwai
2014-04-10 19:05 andoru
2014-04-12  4:38 ` Raymond Yau
2014-04-12 17:56   ` Andoru
2014-04-12 23:38   ` Andoru
2014-04-04 16:15 andoru
2014-04-05  6:21 ` Raymond Yau
2014-04-05 18:29   ` andoru
2014-04-05 21:55     ` Raymond Yau
2014-04-05 23:16       ` andoru
     [not found] <CAAvHfitJ2B1sr7_6h=ww_SVGgsuy4iNLGc3CjDyiNtwdpJTSUw@mail.gmail.com>
2014-04-01 11:37 ` Clemens Ladisch
2014-04-01 18:48   ` andoru
2014-04-01 22:58     ` Raymond Yau
2014-04-02  2:24     ` andoru
2014-03-26 16:02 andoru
     [not found] ` <CAN8ccib45znh-JbH57EhfbPNQg_fginmX9Tbr=yKMmd4D=iygQ@mail.gmail.com>
     [not found]   ` <CAN8cciZkGx5XBO+u0b7V9YN8VU_rz8ckL8B=6oBFJr+-Yg8cxw@mail.gmail.com>
2014-03-26 23:23     ` Raymond Yau
2014-03-27 20:44       ` andoru
2014-03-28  4:46         ` Raymond Yau
2014-03-28  8:42           ` Clemens Ladisch
2014-03-28 14:28             ` andoru
2014-03-28 15:21               ` Clemens Ladisch

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=s5heh0hbg1l.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=andoru.blah@gmail.com \
    /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