Changeset ff396ea in mainline
- Timestamp:
- 2012-08-19T13:23:32Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d2765ab3
- Parents:
- b881226
- Location:
- uspace/drv/audio/sb16
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/dsp.c
rb881226 rff396ea 167 167 dsp->sb_dev = dev; 168 168 dsp->status = DSP_STOPPED; 169 dsp->ignore_interrupts = false; 169 170 sb_dsp_reset(dsp); 170 171 /* "DSP takes about 100 microseconds to initialize itself" */ … … 192 193 { 193 194 assert(dsp); 195 196 #ifndef AUTO_DMA_MODE 197 if (dsp->status == DSP_PLAYBACK) { 198 sb_dsp_write(dsp, SINGLE_DMA_16B_DA); 199 sb_dsp_write(dsp, dsp->active.mode); 200 sb_dsp_write(dsp, (dsp->active.samples - 1) & 0xff); 201 sb_dsp_write(dsp, (dsp->active.samples - 1) >> 8); 202 } 203 204 if (dsp->status == DSP_RECORDING) { 205 sb_dsp_write(dsp, SINGLE_DMA_16B_AD); 206 sb_dsp_write(dsp, dsp->active.mode); 207 sb_dsp_write(dsp, (dsp->active.samples - 1) & 0xff); 208 sb_dsp_write(dsp, (dsp->active.samples - 1) >> 8); 209 } 210 #endif 211 212 if (dsp->ignore_interrupts) 213 return; 214 194 215 dsp->active.frame_count += 195 216 dsp->active.samples / ((dsp->active.mode & DSP_MODE_STEREO) ? 2 : 1); … … 215 236 ddf_log_warning("Interrupt with no event consumer."); 216 237 } 217 #ifndef AUTO_DMA_MODE218 if (dsp->active.playing)219 sb_dsp_write(dsp, SINGLE_DMA_16B_DA);220 else221 sb_dsp_write(dsp, SINGLE_DMA_16B_AD);222 223 sb_dsp_write(dsp, dsp->active.mode);224 sb_dsp_write(dsp, (dsp->active.samples - 1) & 0xff);225 sb_dsp_write(dsp, (dsp->active.samples - 1) >> 8);226 #endif227 238 } 228 239 … … 333 344 return ENOTSUP; 334 345 335 dsp->event_exchange = async_exchange_begin(dsp->event_session); 336 if (!dsp->event_exchange) 337 return ENOMEM; 346 /* Client requested regular interrupts */ 347 if (frames) { 348 dsp->event_exchange = async_exchange_begin(dsp->event_session); 349 if (!dsp->event_exchange) 350 return ENOMEM; 351 dsp->ignore_interrupts = false; 352 } 338 353 339 354 const bool sign = (format == PCM_SAMPLE_SINT16_LE); … … 349 364 sb_dsp_write(dsp, AUTO_DMA_16B_DA_FIFO); 350 365 #else 351 sb_dsp_write(dsp, SINGLE_DMA_16B_DA _FIFO);366 sb_dsp_write(dsp, SINGLE_DMA_16B_DA); 352 367 #endif 353 368 … … 401 416 return ENOTSUP; 402 417 403 dsp->event_exchange = async_exchange_begin(dsp->event_session); 404 if (!dsp->event_exchange) 405 return ENOMEM; 418 /* client requested regular interrupts */ 419 if (frames) { 420 dsp->event_exchange = async_exchange_begin(dsp->event_session); 421 if (!dsp->event_exchange) 422 return ENOMEM; 423 dsp->ignore_interrupts = false; 424 } 406 425 407 426 const bool sign = (format == PCM_SAMPLE_SINT16_LE); … … 417 436 sb_dsp_write(dsp, AUTO_DMA_16B_AD_FIFO); 418 437 #else 419 sb_dsp_write(dsp, SINGLE_DMA_16B_AD _FIFO);438 sb_dsp_write(dsp, SINGLE_DMA_16B_AD); 420 439 #endif 421 440 -
uspace/drv/audio/sb16/dsp.h
rb881226 rff396ea 47 47 int dma8_channel; 48 48 int dma16_channel; 49 bool ignore_interrupts; 49 50 struct { 50 51 uint8_t major;
Note:
See TracChangeset
for help on using the changeset viewer.