[alsa-devel] Problem with snd_hda_intel from 05-27-2010 snapshot

Jaroslav Kysela perex at perex.cz
Tue Jun 1 07:39:58 CEST 2010


On Mon, 31 May 2010, VDR User wrote:

> On Mon, May 31, 2010 at 1:43 PM, Jaroslav Kysela <perex at perex.cz> wrote:
>>> I've got a bit of a strange result.  With the above patch (and the
>>> wallclk logging patch from your previous email), sound does not work.
>>> However, it _does_ start working only if I `echo 29 >
>>> /proc/asound/card1/pcm3p/xrun_debug`.  I tested these results with a
>>> reboot in between each attempt just to make sure I'm working with a
>>> clean boot.  I can't imagine what's causing this weird condition.  Any
>>> ideas?
>>
>> Try to disable jiffies check (value 25 for xrun_debug). Please, post your
>> log for value 29 for inspection. Thanks.
>
> With xrun_debug 25 I get sound for about 1 second and then it
> disappears.  29 of course works fine as mentioned previously.

Thanks. Here is next correction:

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 170610e..b6ba210 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1910,11 +1910,11 @@ static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev)
  	if (WARN_ONCE(!azx_dev->period_bytes,
  		      "hda-intel: zero azx_dev->period_bytes"))
  		return -1; /* this shouldn't happen! */
-	if (wallclk <= azx_dev->period_wallclk &&
+	if (wallclk < (azx_dev->period_wallclk * 3) / 2 &&
  	    pos % azx_dev->period_bytes > azx_dev->period_bytes / 2)
  		/* NG - it's below the first next period boundary */
  		return bdl_pos_adj[chip->dev_index] ? 0 : -1;
-	azx_dev->start_wallclk = wallclk;
+	azx_dev->start_wallclk += wallclk;
  	return 1; /* OK, it's fine */
  }

 					Jaroslav

-----
Jaroslav Kysela <perex at perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.


More information about the Alsa-devel mailing list