[alsa-devel] Noise using pulseaudio with ymf724f
Raymond Yau
superquad.vortex2 at gmail.com
Sat Sep 17 09:43:45 CEST 2011
2011/9/16 Clemens Ladisch <clemens at ladisch.de>:
> Raymond Yau wrote:
>> 2011/9/14 Clemens Ladisch <clemens at ladisch.de>:
>> > A block in the native format has 1024 bytes.
>>
>> Do you mean hardware pointer is only updated every 5.333ms ?
>
> Yes.
>
>
The noise can also be reproduced by change the value of the hw ptr of
hda-intel with 0xffffff00 so that it provide an less accurate pointer
position
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 2a8bed9..0ef368d 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1574,8 +1574,8 @@ static struct snd_pcm_hardware azx_pcm_hw = {
/* No full-resume yet implemented */
/* SNDRV_PCM_INFO_RESUME |*/
SNDRV_PCM_INFO_PAUSE |
- SNDRV_PCM_INFO_SYNC_START |
- SNDRV_PCM_INFO_NO_PERIOD_WAKEUP),
+ SNDRV_PCM_INFO_SYNC_START /* |
+ SNDRV_PCM_INFO_NO_PERIOD_WAKEUP */),
.formats = SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_48000,
.rate_min = 48000,
@@ -1639,6 +1639,8 @@ static int azx_pcm_open(struct snd_pcm_substream
*substream)
buff_step);
snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
buff_step);
+ snd_pcm_hw_constraint_minmax(runtime,
SNDRV_PCM_HW_PARAM_PERIOD_TIME, 5333, UINT_MAX);
+ snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIODS, 3, 1024);
snd_hda_power_up(apcm->codec);
err = hinfo->ops.open(hinfo, apcm->codec, substream);
if (err < 0) {
@@ -1986,7 +1988,7 @@ static snd_pcm_uframes_t azx_pcm_pointer(struct
snd_pcm_substream *substream)
struct azx *chip = apcm->chip;
struct azx_dev *azx_dev = get_azx_dev(substream);
return bytes_to_frames(substream->runtime,
- azx_get_position(chip, azx_dev));
+ azx_get_position(chip, azx_dev)) & 0xffffff00;
}
/*
--
1.6.0.6
More information about the Alsa-devel
mailing list