aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_intel.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-09-11 09:19:10 -0400
committerTakashi Iwai <tiwai@suse.de>2012-09-11 09:19:10 -0400
commit915bf29eb94beabed8bf577bfd62fc0ba9abbf37 (patch)
treec0851d04d9a26fb10bb16d08a9f11f1c70f4bfb6 /sound/pci/hda/hda_intel.c
parent5fe8e1e6717c0ed40abff8be3a441d0e2eb47169 (diff)
ALSA: hda - Avoid BDL position workaround when no_period_wakeup is set
Originally the bogus period at BDL head was introduced as a workaround for the mismatching position update at the period boundary, typically seen on dmix. However, for applications like PulseAudio that don't require period wake ups, this workaround is just superfluous. Thus better to disable it when no_period_wakeup is given in hw_params. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r--sound/pci/hda/hda_intel.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 6a19f6af9517..76ec2421fae1 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -415,6 +415,7 @@ struct azx_dev {
415 */ 415 */
416 unsigned int insufficient :1; 416 unsigned int insufficient :1;
417 unsigned int wc_marked:1; 417 unsigned int wc_marked:1;
418 unsigned int no_period_wakeup:1;
418}; 419};
419 420
420/* CORB/RIRB */ 421/* CORB/RIRB */
@@ -1419,7 +1420,7 @@ static int azx_setup_periods(struct azx *chip,
1419 ofs = 0; 1420 ofs = 0;
1420 azx_dev->frags = 0; 1421 azx_dev->frags = 0;
1421 pos_adj = bdl_pos_adj[chip->dev_index]; 1422 pos_adj = bdl_pos_adj[chip->dev_index];
1422 if (pos_adj > 0) { 1423 if (!azx_dev->no_period_wakeup && pos_adj > 0) {
1423 struct snd_pcm_runtime *runtime = substream->runtime; 1424 struct snd_pcm_runtime *runtime = substream->runtime;
1424 int pos_align = pos_adj; 1425 int pos_align = pos_adj;
1425 pos_adj = (pos_adj * runtime->rate + 47999) / 48000; 1426 pos_adj = (pos_adj * runtime->rate + 47999) / 48000;
@@ -1435,8 +1436,7 @@ static int azx_setup_periods(struct azx *chip,
1435 pos_adj = 0; 1436 pos_adj = 0;
1436 } else { 1437 } else {
1437 ofs = setup_bdle(chip, substream, azx_dev, 1438 ofs = setup_bdle(chip, substream, azx_dev,
1438 &bdl, ofs, pos_adj, 1439 &bdl, ofs, pos_adj, true);
1439 !substream->runtime->no_period_wakeup);
1440 if (ofs < 0) 1440 if (ofs < 0)
1441 goto error; 1441 goto error;
1442 } 1442 }
@@ -1449,7 +1449,7 @@ static int azx_setup_periods(struct azx *chip,
1449 else 1449 else
1450 ofs = setup_bdle(chip, substream, azx_dev, &bdl, ofs, 1450 ofs = setup_bdle(chip, substream, azx_dev, &bdl, ofs,
1451 period_bytes, 1451 period_bytes,
1452 !substream->runtime->no_period_wakeup); 1452 !azx_dev->no_period_wakeup);
1453 if (ofs < 0) 1453 if (ofs < 0)
1454 goto error; 1454 goto error;
1455 } 1455 }
@@ -1922,10 +1922,12 @@ static int azx_pcm_prepare(struct snd_pcm_substream *substream)
1922 1922
1923 if (bufsize != azx_dev->bufsize || 1923 if (bufsize != azx_dev->bufsize ||
1924 period_bytes != azx_dev->period_bytes || 1924 period_bytes != azx_dev->period_bytes ||
1925 format_val != azx_dev->format_val) { 1925 format_val != azx_dev->format_val ||
1926 runtime->no_period_wakeup != azx_dev->no_period_wakeup) {
1926 azx_dev->bufsize = bufsize; 1927 azx_dev->bufsize = bufsize;
1927 azx_dev->period_bytes = period_bytes; 1928 azx_dev->period_bytes = period_bytes;
1928 azx_dev->format_val = format_val; 1929 azx_dev->format_val = format_val;
1930 azx_dev->no_period_wakeup = runtime->no_period_wakeup;
1929 err = azx_setup_periods(chip, substream, azx_dev); 1931 err = azx_setup_periods(chip, substream, azx_dev);
1930 if (err < 0) 1932 if (err < 0)
1931 return err; 1933 return err;