Commit f723d1ec authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update

D:2003/09/30 09:58:53
C:Generic drivers
A:Jaroslav Kysela <perex@suse.cz>
F:drivers/dummy.c:1.25->1.26 
L:Added emu10k1 emulation by Takashi
parent 8527da9e
...@@ -41,6 +41,20 @@ MODULE_DEVICES("{{ALSA,Dummy soundcard}}"); ...@@ -41,6 +41,20 @@ MODULE_DEVICES("{{ALSA,Dummy soundcard}}");
#define MAX_PCM_SUBSTREAMS 16 #define MAX_PCM_SUBSTREAMS 16
#define MAX_MIDI_DEVICES 2 #define MAX_MIDI_DEVICES 2
#if 0 /* emu10k1 emulation */
#define MAX_BUFFER_SIZE (128 * 1024)
static int emu10k1_playback_constraints(snd_pcm_runtime_t *runtime)
{
int err;
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
return err;
if ((err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 256, UINT_MAX)) < 0)
return err;
return 0;
}
#define add_playback_constraints emu10k1_playback_constraints
#endif
#if 0 /* RME9652 emulation */ #if 0 /* RME9652 emulation */
#define MAX_BUFFER_SIZE (26 * 64 * 1024) #define MAX_BUFFER_SIZE (26 * 64 * 1024)
#define USE_FORMATS SNDRV_PCM_FMTBIT_S32_LE #define USE_FORMATS SNDRV_PCM_FMTBIT_S32_LE
...@@ -102,6 +116,12 @@ MODULE_DEVICES("{{ALSA,Dummy soundcard}}"); ...@@ -102,6 +116,12 @@ MODULE_DEVICES("{{ALSA,Dummy soundcard}}");
#ifndef USE_PERIODS_MAX #ifndef USE_PERIODS_MAX
#define USE_PERIODS_MAX 1024 #define USE_PERIODS_MAX 1024
#endif #endif
#ifndef add_playback_constraints
#define add_playback_constraints(x) 0
#endif
#ifndef add_capture_constraints
#define add_capture_constraints(x) 0
#endif
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
...@@ -325,6 +345,7 @@ static int snd_card_dummy_playback_open(snd_pcm_substream_t * substream) ...@@ -325,6 +345,7 @@ static int snd_card_dummy_playback_open(snd_pcm_substream_t * substream)
{ {
snd_pcm_runtime_t *runtime = substream->runtime; snd_pcm_runtime_t *runtime = substream->runtime;
snd_card_dummy_pcm_t *dpcm; snd_card_dummy_pcm_t *dpcm;
int err;
dpcm = snd_magic_kcalloc(snd_card_dummy_pcm_t, 0, GFP_KERNEL); dpcm = snd_magic_kcalloc(snd_card_dummy_pcm_t, 0, GFP_KERNEL);
if (dpcm == NULL) if (dpcm == NULL)
...@@ -347,6 +368,11 @@ static int snd_card_dummy_playback_open(snd_pcm_substream_t * substream) ...@@ -347,6 +368,11 @@ static int snd_card_dummy_playback_open(snd_pcm_substream_t * substream)
} }
if (substream->pcm->device & 2) if (substream->pcm->device & 2)
runtime->hw.info &= ~(SNDRV_PCM_INFO_MMAP|SNDRV_PCM_INFO_MMAP_VALID); runtime->hw.info &= ~(SNDRV_PCM_INFO_MMAP|SNDRV_PCM_INFO_MMAP_VALID);
if ((err = add_playback_constraints(runtime)) < 0) {
snd_magic_kfree(dpcm);
return err;
}
return 0; return 0;
} }
...@@ -354,6 +380,7 @@ static int snd_card_dummy_capture_open(snd_pcm_substream_t * substream) ...@@ -354,6 +380,7 @@ static int snd_card_dummy_capture_open(snd_pcm_substream_t * substream)
{ {
snd_pcm_runtime_t *runtime = substream->runtime; snd_pcm_runtime_t *runtime = substream->runtime;
snd_card_dummy_pcm_t *dpcm; snd_card_dummy_pcm_t *dpcm;
int err;
dpcm = snd_magic_kcalloc(snd_card_dummy_pcm_t, 0, GFP_KERNEL); dpcm = snd_magic_kcalloc(snd_card_dummy_pcm_t, 0, GFP_KERNEL);
if (dpcm == NULL) if (dpcm == NULL)
...@@ -377,6 +404,11 @@ static int snd_card_dummy_capture_open(snd_pcm_substream_t * substream) ...@@ -377,6 +404,11 @@ static int snd_card_dummy_capture_open(snd_pcm_substream_t * substream)
} }
if (substream->pcm->device & 2) if (substream->pcm->device & 2)
runtime->hw.info &= ~(SNDRV_PCM_INFO_MMAP|SNDRV_PCM_INFO_MMAP_VALID); runtime->hw.info &= ~(SNDRV_PCM_INFO_MMAP|SNDRV_PCM_INFO_MMAP_VALID);
if ((err = add_capture_constraints(runtime)) < 0) {
snd_magic_kfree(dpcm);
return err;
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment