Changeset 277 for GPL/branches/alsa-resync1/alsa-kernel/drivers/dummy.c
- Timestamp:
- Dec 14, 2007, 8:27:04 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/alsa-resync1/alsa-kernel/drivers/dummy.c
r262 r277 44 44 #define MAX_MIDI_DEVICES 2 45 45 46 #if 0 /* emu10k1 emulation */ 47 #define MAX_BUFFER_SIZE (128 * 1024) 48 static int emu10k1_playback_constraints(snd_pcm_runtime_t *runtime) 49 { 50 int err; 51 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 52 return err; 53 if ((err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 256, UINT_MAX)) < 0) 54 return err; 55 return 0; 56 } 57 #define add_playback_constraints emu10k1_playback_constraints 58 #endif 46 59 47 60 #if 0 /* RME9652 emulation */ … … 105 118 #ifndef USE_PERIODS_MAX 106 119 #define USE_PERIODS_MAX 1024 120 #endif 121 #ifndef add_playback_constraints 122 #define add_playback_constraints(x) 0 123 #endif 124 #ifndef add_capture_constraints 125 #define add_capture_constraints(x) 0 107 126 #endif 108 127 … … 334 353 snd_pcm_runtime_t *runtime = substream->runtime; 335 354 snd_card_dummy_pcm_t *dpcm; 355 int err; 336 356 337 357 dpcm = kcalloc(1, sizeof(*dpcm), GFP_KERNEL); … … 356 376 if (substream->pcm->device & 2) 357 377 runtime->hw.info &= ~(SNDRV_PCM_INFO_MMAP|SNDRV_PCM_INFO_MMAP_VALID); 378 if ((err = add_playback_constraints(runtime)) < 0) { 379 snd_magic_kfree(dpcm); 380 return err; 381 } 382 358 383 return 0; 359 384 } … … 363 388 snd_pcm_runtime_t *runtime = substream->runtime; 364 389 snd_card_dummy_pcm_t *dpcm; 390 int err; 365 391 366 392 dpcm = kcalloc(1, sizeof(*dpcm), GFP_KERNEL); … … 386 412 if (substream->pcm->device & 2) 387 413 runtime->hw.info &= ~(SNDRV_PCM_INFO_MMAP|SNDRV_PCM_INFO_MMAP_VALID); 414 if ((err = add_capture_constraints(runtime)) < 0) { 415 snd_magic_kfree(dpcm); 416 return err; 417 } 418 388 419 return 0; 389 420 }
Note:
See TracChangeset
for help on using the changeset viewer.