Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182705
b: refs/heads/master
c: d0d2c38
h: refs/heads/master
i:
  182703: 617cb0d
v: v3
  • Loading branch information
Takashi Iwai committed Jan 26, 2010
1 parent 7439ecc commit 68da82b
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cf944ee55cc318bdb1d4b2f3f5cce3257f7c07b3
refs/heads/master: d0d2c38e3963f4f86a9e62d74f45a371458f2787
1 change: 1 addition & 0 deletions trunk/include/sound/pcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
3 changes: 1 addition & 2 deletions trunk/sound/core/oss/pcm_oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down
7 changes: 5 additions & 2 deletions trunk/sound/core/pcm_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions trunk/sound/core/pcm_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 10 additions & 1 deletion trunk/sound/pci/hda/patch_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 68da82b

Please sign in to comment.