Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28499
b: refs/heads/master
c: 2ce7fb5
h: refs/heads/master
i:
  28497: 1cbaf64
  28495: 3cae03d
v: v3
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Jun 22, 2006
1 parent d910883 commit ced0a58
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 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: 62fe78e90dc25b269362034487dc450cd8453e8c
refs/heads/master: 2ce7fb579f842f76a0216618c105bffd334d9233
32 changes: 23 additions & 9 deletions trunk/sound/pci/rme96.c
Original file line number Diff line number Diff line change
Expand Up @@ -1151,6 +1151,25 @@ static struct snd_pcm_hw_constraint_list hw_constraints_period_bytes = {
.mask = 0
};

static void
rme96_set_buffer_size_constraint(struct rme96 *rme96,
struct snd_pcm_runtime *runtime)
{
unsigned int size;

snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
RME96_BUFFER_SIZE, RME96_BUFFER_SIZE);
if ((size = rme96->playback_periodsize) != 0 ||
(size = rme96->capture_periodsize) != 0)
snd_pcm_hw_constraint_minmax(runtime,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
size, size);
else
snd_pcm_hw_constraint_list(runtime, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
&hw_constraints_period_bytes);
}

static int
snd_rme96_playback_spdif_open(struct snd_pcm_substream *substream)
{
Expand Down Expand Up @@ -1180,8 +1199,7 @@ snd_rme96_playback_spdif_open(struct snd_pcm_substream *substream)
runtime->hw.rate_min = rate;
runtime->hw.rate_max = rate;
}
snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, RME96_BUFFER_SIZE, RME96_BUFFER_SIZE);
snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, &hw_constraints_period_bytes);
rme96_set_buffer_size_constraint(rme96, runtime);

rme96->wcreg_spdif_stream = rme96->wcreg_spdif;
rme96->spdif_ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
Expand Down Expand Up @@ -1219,9 +1237,7 @@ snd_rme96_capture_spdif_open(struct snd_pcm_substream *substream)
rme96->capture_substream = substream;
spin_unlock_irq(&rme96->lock);

snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, RME96_BUFFER_SIZE, RME96_BUFFER_SIZE);
snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, &hw_constraints_period_bytes);

rme96_set_buffer_size_constraint(rme96, runtime);
return 0;
}

Expand Down Expand Up @@ -1254,8 +1270,7 @@ snd_rme96_playback_adat_open(struct snd_pcm_substream *substream)
runtime->hw.rate_min = rate;
runtime->hw.rate_max = rate;
}
snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, RME96_BUFFER_SIZE, RME96_BUFFER_SIZE);
snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, &hw_constraints_period_bytes);
rme96_set_buffer_size_constraint(rme96, runtime);
return 0;
}

Expand Down Expand Up @@ -1291,8 +1306,7 @@ snd_rme96_capture_adat_open(struct snd_pcm_substream *substream)
rme96->capture_substream = substream;
spin_unlock_irq(&rme96->lock);

snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, RME96_BUFFER_SIZE, RME96_BUFFER_SIZE);
snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, &hw_constraints_period_bytes);
rme96_set_buffer_size_constraint(rme96, runtime);
return 0;
}

Expand Down

0 comments on commit ced0a58

Please sign in to comment.