Merge remote branch 'alsa/devel' into topic/misc
authorTakashi Iwai <tiwai@suse.de>
Tue, 26 Jan 2010 17:13:04 +0000 (18:13 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 26 Jan 2010 17:13:04 +0000 (18:13 +0100)
include/sound/pcm.h
sound/core/oss/pcm_oss.c
sound/core/pcm_lib.c
sound/core/pcm_native.c
sound/pci/hda/patch_analog.c

index ee16122a188671e7d554c3bbaa906d2c8996e800..8b611a561985a8350c217d160f167cb4d224d01a 100644 (file)
@@ -271,6 +271,7 @@ struct snd_pcm_runtime {
        int overrange;
        snd_pcm_uframes_t avail_max;
        snd_pcm_uframes_t hw_ptr_base;  /* Position at buffer restart */
+       snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */
        unsigned long hw_ptr_jiffies;   /* Time when hw_ptr is updated */
        snd_pcm_sframes_t delay;        /* extra delay; typically FIFO size */
 
index 255ad910077ae906cb4427a120f24ca92d0e9a32..82d4e3329b3daa11c956e631bab2fb65a59f5d58 100644 (file)
@@ -635,8 +635,7 @@ static long snd_pcm_alsa_frames(struct snd_pcm_substream *substream, long bytes)
 static inline
 snd_pcm_uframes_t get_hw_ptr_period(struct snd_pcm_runtime *runtime)
 {
-       snd_pcm_uframes_t ptr = runtime->status->hw_ptr;
-       return ptr - (ptr % runtime->period_size);
+       return runtime->hw_ptr_interrupt;
 }
 
 /* define extended formats in the recent OSS versions (if any) */
index 272f15d19017f25815ee208bf226d2a76436aef2..b546ac2660f9f64b8436e3efe836cfa0f298afee 100644 (file)
@@ -325,8 +325,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
        if (in_interrupt) {
                /* we know that one period was processed */
                /* delta = "expected next hw_ptr" for in_interrupt != 0 */
-               delta = old_hw_ptr - (old_hw_ptr % runtime->period_size)
-                       + runtime->period_size;
+               delta = runtime->hw_ptr_interrupt + runtime->period_size;
                if (delta > new_hw_ptr) {
                        hw_base += runtime->buffer_size;
                        if (hw_base >= runtime->boundary)
@@ -437,6 +436,10 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
            runtime->silence_size > 0)
                snd_pcm_playback_silence(substream, new_hw_ptr);
 
+       if (in_interrupt) {
+               runtime->hw_ptr_interrupt = new_hw_ptr -
+                               (new_hw_ptr % runtime->period_size);
+       }
        runtime->hw_ptr_base = hw_base;
        runtime->status->hw_ptr = new_hw_ptr;
        runtime->hw_ptr_jiffies = jiffies;
index b53fa845004dac007b5e5b556dbbaa6856fc95f4..b79c777d2118803509ef328e5c5b3325533c41f2 100644 (file)
@@ -1252,6 +1252,8 @@ static int snd_pcm_do_reset(struct snd_pcm_substream *substream, int state)
        if (err < 0)
                return err;
        runtime->hw_ptr_base = 0;
+       runtime->hw_ptr_interrupt = runtime->status->hw_ptr -
+               runtime->status->hw_ptr % runtime->period_size;
        runtime->silence_start = runtime->status->hw_ptr;
        runtime->silence_filled = 0;
        return 0;
index cecd3c10899080f180a8ae8dd370539532e4722f..865715e3f938a84ef21434c9927a17ada6a1c6f5 100644 (file)
@@ -2458,6 +2458,12 @@ static struct hda_verb ad1988_spdif_init_verbs[] = {
        { }
 };
 
+static struct hda_verb ad1988_spdif_in_init_verbs[] = {
+       /* unmute SPDIF input pin */
+       {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
+       { }
+};
+
 /* AD1989 has no ADC -> SPDIF route */
 static struct hda_verb ad1989_spdif_init_verbs[] = {
        /* SPDIF-1 out pin */
@@ -3193,8 +3199,11 @@ static int patch_ad1988(struct hda_codec *codec)
                                ad1988_spdif_init_verbs;
                }
        }
-       if (spec->dig_in_nid && codec->vendor_id < 0x11d4989a)
+       if (spec->dig_in_nid && codec->vendor_id < 0x11d4989a) {
                spec->mixers[spec->num_mixers++] = ad1988_spdif_in_mixers;
+               spec->init_verbs[spec->num_init_verbs++] =
+                       ad1988_spdif_in_init_verbs;
+       }
 
        codec->patch_ops = ad198x_patch_ops;
        switch (board_config) {
This page took 0.034557 seconds and 5 git commands to generate.