Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 270410
b: refs/heads/master
c: d877681
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Aug 15, 2011
1 parent 05a060c commit 599e0e9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 52 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: 3fa9e3d230911272eaf1c3856f5483b0af3903f3
refs/heads/master: d877681d2eab28ae2a7ff08bec9a6fe3b65973fb
76 changes: 25 additions & 51 deletions trunk/sound/pci/rme9652/hdspm.c
Original file line number Diff line number Diff line change
Expand Up @@ -5705,19 +5705,6 @@ static int snd_hdspm_prepare(struct snd_pcm_substream *substream)
return 0;
}

static unsigned int period_sizes_old[] = {
64, 128, 256, 512, 1024, 2048, 4096, 8192
};

static unsigned int period_sizes_new[] = {
64, 128, 256, 512, 1024, 2048, 4096, 32
};

/* RayDAT and AIO always have a buffer of 16384 samples per channel */
static unsigned int raydat_aio_buffer_sizes[] = {
16384
};

static struct snd_pcm_hardware snd_hdspm_playback_subinfo = {
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
Expand Down Expand Up @@ -5768,24 +5755,6 @@ static struct snd_pcm_hardware snd_hdspm_capture_subinfo = {
.fifo_size = 0
};

static struct snd_pcm_hw_constraint_list hw_constraints_period_sizes_old = {
.count = ARRAY_SIZE(period_sizes_old),
.list = period_sizes_old,
.mask = 0
};

static struct snd_pcm_hw_constraint_list hw_constraints_period_sizes_new = {
.count = ARRAY_SIZE(period_sizes_new),
.list = period_sizes_new,
.mask = 0
};

static struct snd_pcm_hw_constraint_list hw_constraints_raydat_io_buffer = {
.count = ARRAY_SIZE(raydat_aio_buffer_sizes),
.list = raydat_aio_buffer_sizes,
.mask = 0
};

static int snd_hdspm_hw_rule_in_channels_rate(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule)
{
Expand Down Expand Up @@ -5986,23 +5955,25 @@ static int snd_hdspm_playback_open(struct snd_pcm_substream *substream)
spin_unlock_irq(&hdspm->lock);

snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
snd_pcm_hw_constraint_pow2(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE);

switch (hdspm->io_type) {
case AIO:
case RayDAT:
snd_pcm_hw_constraint_list(runtime, 0,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
&hw_constraints_period_sizes_new);
snd_pcm_hw_constraint_list(runtime, 0,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
&hw_constraints_raydat_io_buffer);

snd_pcm_hw_constraint_minmax(runtime,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
32, 4096);
/* RayDAT & AIO have a fixed buffer of 16384 samples per channel */
snd_pcm_hw_constraint_minmax(runtime,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
16384, 16384);
break;

default:
snd_pcm_hw_constraint_list(runtime, 0,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
&hw_constraints_period_sizes_old);
snd_pcm_hw_constraint_minmax(runtime,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
64, 8192);
break;
}

if (AES32 == hdspm->io_type) {
Expand Down Expand Up @@ -6059,21 +6030,24 @@ static int snd_hdspm_capture_open(struct snd_pcm_substream *substream)
spin_unlock_irq(&hdspm->lock);

snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
snd_pcm_hw_constraint_pow2(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE);

switch (hdspm->io_type) {
case AIO:
case RayDAT:
snd_pcm_hw_constraint_list(runtime, 0,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
&hw_constraints_period_sizes_new);
snd_pcm_hw_constraint_list(runtime, 0,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
&hw_constraints_raydat_io_buffer);
break;
snd_pcm_hw_constraint_minmax(runtime,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
32, 4096);
snd_pcm_hw_constraint_minmax(runtime,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
16384, 16384);
break;

default:
snd_pcm_hw_constraint_list(runtime, 0,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
&hw_constraints_period_sizes_old);
snd_pcm_hw_constraint_minmax(runtime,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
64, 8192);
break;
}

if (AES32 == hdspm->io_type) {
Expand Down

0 comments on commit 599e0e9

Please sign in to comment.