Changeset d86c9736 in mainline for uspace/drv/audio
- Timestamp:
- 2012-08-19T14:35:32Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fa91c0f
- Parents:
- ad42844
- Location:
- uspace/drv/audio/sb16
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/dsp.c
rad42844 rd86c9736 215 215 } 216 216 217 if (dsp->status == DSP_ RECORDING) {217 if (dsp->status == DSP_CAPTURE) { 218 218 sb_dsp_start_active(dsp, SINGLE_DMA_16B_AD); 219 219 } … … 232 232 PCM_EVENT_FRAMES_PLAYED, dsp->active.frame_count); 233 233 break; 234 case DSP_ RECORDING:234 case DSP_CAPTURE: 235 235 async_msg_1(dsp->event_exchange, 236 PCM_EVENT_FRAMES_ RECORDED, dsp->active.frame_count);236 PCM_EVENT_FRAMES_CAPTURED, dsp->active.frame_count); 237 237 break; 238 238 default: … … 251 251 { 252 252 switch(cap) { 253 case AUDIO_CAP_ RECORD:253 case AUDIO_CAP_CAPTURE: 254 254 case AUDIO_CAP_PLAYBACK: 255 255 case AUDIO_CAP_INTERRUPT: … … 393 393 } 394 394 395 int sb_dsp_start_ record(sb_dsp_t *dsp, unsigned frames,395 int sb_dsp_start_capture(sb_dsp_t *dsp, unsigned frames, 396 396 unsigned channels, unsigned sampling_rate, pcm_sample_format_t format) 397 397 { … … 401 401 402 402 /* Check supported parameters */ 403 ddf_log_debug("Requested record: %u frames, %uHz, %s, %u channel(s).",403 ddf_log_debug("Requested capture: %u frames, %uHz, %s, %u channel(s).", 404 404 frames, sampling_rate, pcm_sample_format_str(format), channels); 405 405 if (sb_dsp_test_format(dsp, &channels, &sampling_rate, &format) != EOK) … … 433 433 "(~1/%u sec)", dsp->active.samples, 434 434 sampling_rate / (dsp->active.samples * channels)); 435 dsp->status = DSP_ RECORDING;436 437 return EOK; 438 } 439 440 int sb_dsp_stop_ record(sb_dsp_t *dsp)435 dsp->status = DSP_CAPTURE; 436 437 return EOK; 438 } 439 440 int sb_dsp_stop_capture(sb_dsp_t *dsp) 441 441 { 442 442 assert(dsp); 443 443 sb_dsp_write(dsp, DMA_16B_EXIT); 444 ddf_log_debug("Stopped recording");445 async_msg_0(dsp->event_exchange, PCM_EVENT_ RECORDING_TERMINATED);444 ddf_log_debug("Stopped capture"); 445 async_msg_0(dsp->event_exchange, PCM_EVENT_CAPTURE_TERMINATED); 446 446 async_exchange_end(dsp->event_exchange); 447 447 dsp->event_exchange = NULL; -
uspace/drv/audio/sb16/dsp.h
rad42844 rd86c9736 63 63 enum { 64 64 DSP_PLAYBACK, 65 DSP_ RECORDING,65 DSP_CAPTURE, 66 66 DSP_STOPPED, 67 67 } status; … … 83 83 unsigned channels, unsigned sample_rate, pcm_sample_format_t format); 84 84 int sb_dsp_stop_playback(sb_dsp_t *dsp); 85 int sb_dsp_start_ record(sb_dsp_t *dsp, unsigned frames,85 int sb_dsp_start_capture(sb_dsp_t *dsp, unsigned frames, 86 86 unsigned channels, unsigned sample_rate, pcm_sample_format_t format); 87 int sb_dsp_stop_ record(sb_dsp_t *dsp);87 int sb_dsp_stop_capture(sb_dsp_t *dsp); 88 88 89 89 #endif -
uspace/drv/audio/sb16/pcm_iface.c
rad42844 rd86c9736 104 104 } 105 105 106 static int sb_start_ record(ddf_fun_t *fun, unsigned frames,106 static int sb_start_capture(ddf_fun_t *fun, unsigned frames, 107 107 unsigned channels, unsigned sample_rate, pcm_sample_format_t format) 108 108 { … … 110 110 assert(fun->driver_data); 111 111 sb_dsp_t *dsp = fun->driver_data; 112 return sb_dsp_start_ record(112 return sb_dsp_start_capture( 113 113 dsp, frames, channels, sample_rate, format); 114 114 } 115 115 116 static int sb_stop_ record(ddf_fun_t *fun)116 static int sb_stop_capture(ddf_fun_t *fun) 117 117 { 118 118 assert(fun); 119 119 assert(fun->driver_data); 120 120 sb_dsp_t *dsp = fun->driver_data; 121 return sb_dsp_stop_ record(dsp);121 return sb_dsp_stop_capture(dsp); 122 122 } 123 123 … … 134 134 .stop_playback = sb_stop_playback, 135 135 136 .start_ record = sb_start_record,137 .stop_ record = sb_stop_record136 .start_capture = sb_start_capture, 137 .stop_capture = sb_stop_capture, 138 138 }; 139 139 /**
Note:
See TracChangeset
for help on using the changeset viewer.