diff mbox

Invalid PCM pointer with CMI8738 and pcm.c buffer underuns

Message ID s5heh0hbg1l.wl%tiwai@suse.de (mailing list archive)
State Deferred
Headers show

Commit Message

Takashi Iwai April 28, 2014, 4 p.m. UTC
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

---

Comments

Andoru April 29, 2014, 1:12 a.m. UTC | #1
Sorry, meant to reply this:
http://thread.gmane.org/gmane.linux.alsa.devel/122028/focus=122362 to you
instead.
diff mbox

Patch

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