Update of /cvsroot/alsa/alsa-kernel/drivers In directory sc8-pr-cvs1:/tmp/cvs-serv8583
Modified Files: dummy.c Log Message: Added emu10k1 emulation by Takashi Index: dummy.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/drivers/dummy.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- dummy.c 3 Sep 2003 13:43:41 -0000 1.25 +++ dummy.c 30 Sep 2003 08:58:53 -0000 1.26 @@ -41,6 +41,20 @@ #define MAX_PCM_SUBSTREAMS 16 #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 */ #define MAX_BUFFER_SIZE (26 * 64 * 1024) #define USE_FORMATS SNDRV_PCM_FMTBIT_S32_LE @@ -102,6 +116,12 @@ #ifndef USE_PERIODS_MAX #define USE_PERIODS_MAX 1024 #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 char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ @@ -325,6 +345,7 @@ { snd_pcm_runtime_t *runtime = substream->runtime; snd_card_dummy_pcm_t *dpcm; + int err; dpcm = snd_magic_kcalloc(snd_card_dummy_pcm_t, 0, GFP_KERNEL); if (dpcm == NULL) @@ -347,6 +368,11 @@ } if (substream->pcm->device & 2) 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; } @@ -354,6 +380,7 @@ { snd_pcm_runtime_t *runtime = substream->runtime; snd_card_dummy_pcm_t *dpcm; + int err; dpcm = snd_magic_kcalloc(snd_card_dummy_pcm_t, 0, GFP_KERNEL); if (dpcm == NULL) @@ -377,6 +404,11 @@ } if (substream->pcm->device & 2) 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; } ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Alsa-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-cvslog