diff options
Diffstat (limited to 'firmware/pcm_record.c')
-rw-r--r-- | firmware/pcm_record.c | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/firmware/pcm_record.c b/firmware/pcm_record.c index a1b2afd1bf..f7059dc40b 100644 --- a/firmware/pcm_record.c +++ b/firmware/pcm_record.c | |||
@@ -323,13 +323,9 @@ void audio_close_recording(void) | |||
323 | pcm_thread_wait_for_stop(); | 323 | pcm_thread_wait_for_stop(); |
324 | pcm_thread_sync_post(PCMREC_CLOSE, NULL); | 324 | pcm_thread_sync_post(PCMREC_CLOSE, NULL); |
325 | /* reset pcm to defaults (playback only) */ | 325 | /* reset pcm to defaults (playback only) */ |
326 | pcm_set_frequency(-1); | 326 | pcm_set_frequency(HW_SAMPR_DEFAULT); |
327 | pcm_set_monitor(-1); | 327 | audio_set_output_source(AUDIO_SRC_PLAYBACK); |
328 | pcm_set_rec_source(-1); | ||
329 | #ifdef HAVE_TLV320 | ||
330 | /* tlv320 screeches if left at 88.2 with no inputs */ | ||
331 | pcm_apply_settings(true); | 328 | pcm_apply_settings(true); |
332 | #endif | ||
333 | audio_remove_encoder(); | 329 | audio_remove_encoder(); |
334 | } /* audio_close_recording */ | 330 | } /* audio_close_recording */ |
335 | 331 | ||
@@ -408,12 +404,12 @@ void audio_set_recording_options(struct audio_recording_options *options) | |||
408 | pcm_set_frequency(sample_rate); | 404 | pcm_set_frequency(sample_rate); |
409 | } | 405 | } |
410 | 406 | ||
411 | pcm_set_monitor(rec_source); | 407 | /* set monitoring */ |
412 | pcm_set_rec_source(rec_source); | 408 | audio_set_output_source(rec_source); |
413 | 409 | ||
414 | /* apply pcm settings to hardware */ | 410 | /* apply pcm settings to hardware */ |
415 | pcm_apply_settings(true); | 411 | pcm_apply_settings(true); |
416 | 412 | ||
417 | if (audio_load_encoder(enc_config.afmt)) | 413 | if (audio_load_encoder(enc_config.afmt)) |
418 | { | 414 | { |
419 | /* start DMA transfer */ | 415 | /* start DMA transfer */ |
@@ -425,27 +421,10 @@ void audio_set_recording_options(struct audio_recording_options *options) | |||
425 | { | 421 | { |
426 | logf("set rec opt: enc load failed"); | 422 | logf("set rec opt: enc load failed"); |
427 | is_error = true; | 423 | is_error = true; |
428 | } | 424 | } |
429 | } /* audio_set_recording_options */ | 425 | } /* audio_set_recording_options */ |
430 | 426 | ||
431 | /** | 427 | /** |
432 | * Note that microphone is mono, only left value is used | ||
433 | * See {uda1380,tlv320}_set_recvol() for exact ranges. | ||
434 | * | ||
435 | * @param type 0=line-in (radio), 1=mic | ||
436 | * | ||
437 | */ | ||
438 | void audio_set_recording_gain(int left, int right, int type) | ||
439 | { | ||
440 | //logf("rcmrec: t=%d l=%d r=%d", type, left, right); | ||
441 | #if defined(HAVE_UDA1380) | ||
442 | uda1380_set_recvol(left, right, type); | ||
443 | #elif defined (HAVE_TLV320) | ||
444 | tlv320_set_recvol(left, right, type); | ||
445 | #endif | ||
446 | } /* audio_set_recording_gain */ | ||
447 | |||
448 | /** | ||
449 | * Start recording | 428 | * Start recording |
450 | * | 429 | * |
451 | * Use audio_set_recording_options first to select recording options | 430 | * Use audio_set_recording_options first to select recording options |