Changeset 3bacee1 in mainline for uspace/drv/audio/sb16/dsp.c
- Timestamp:
- 2018-04-12T16:27:17Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3cf22f9
- Parents:
- 76d0981d
- git-author:
- Jiri Svoboda <jiri@…> (2018-04-11 19:25:33)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-04-12 16:27:17)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/dsp.c
r76d0981d r3bacee1 63 63 #define AUTO_DMA_MODE 64 64 65 static inline const char * 66 { 67 static const char *state_names[] = {65 static inline const char *dsp_state_to_str(dsp_state_t state) 66 { 67 static const char *state_names[] = { 68 68 [DSP_PLAYBACK_ACTIVE_EVENTS] = "PLAYBACK w/ EVENTS", 69 69 [DSP_CAPTURE_ACTIVE_EVENTS] = "CAPTURE w/ EVENTS", … … 240 240 dsp->active.samples / ((dsp->active.mode & DSP_MODE_STEREO) ? 2 : 1); 241 241 242 switch (dsp->state) 243 { 242 switch (dsp->state) { 244 243 case DSP_PLAYBACK_ACTIVE_EVENTS: 245 244 dsp_report_event(dsp, PCM_EVENT_FRAMES_PLAYED); … … 277 276 { 278 277 ddf_log_verbose("Querying cap %s", audio_pcm_cap_str(cap)); 279 switch (cap) {278 switch (cap) { 280 279 case AUDIO_CAP_CAPTURE: 281 280 case AUDIO_CAP_PLAYBACK: … … 312 311 313 312 errno_t sb_dsp_test_format(sb_dsp_t *dsp, unsigned *channels, unsigned *rate, 314 pcm_sample_format_t *format)313 pcm_sample_format_t *format) 315 314 { 316 315 errno_t ret = EOK; … … 346 345 } 347 346 348 async_sess_t * 347 async_sess_t *sb_dsp_get_event_session(sb_dsp_t *dsp) 349 348 { 350 349 assert(dsp); … … 416 415 } 417 416 418 dsp->active.mode = 0 419 | (pcm_sample_format_is_signed(format) ? DSP_MODE_SIGNED : 0)420 |(channels == 2 ? DSP_MODE_STEREO : 0);417 dsp->active.mode = 0 | 418 (pcm_sample_format_is_signed(format) ? DSP_MODE_SIGNED : 0) | 419 (channels == 2 ? DSP_MODE_STEREO : 0); 421 420 dsp->active.samples = frames * channels; 422 421 dsp->active.frame_count = 0; … … 446 445 if ((dsp->state == DSP_PLAYBACK_NOEVENTS || 447 446 dsp->state == DSP_PLAYBACK_ACTIVE_EVENTS) && 448 immediate) 449 { 447 immediate) { 450 448 dsp_write(dsp, DMA_16B_PAUSE); 451 449 dsp_reset(dsp); … … 459 457 return EOK; 460 458 } 461 if (dsp->state == DSP_PLAYBACK_ACTIVE_EVENTS) 462 { 459 if (dsp->state == DSP_PLAYBACK_ACTIVE_EVENTS) { 463 460 /* Stop after current fragment */ 464 461 assert(!immediate); … … 494 491 } 495 492 496 dsp->active.mode = 0 497 | (pcm_sample_format_is_signed(format) ? DSP_MODE_SIGNED : 0)498 |(channels == 2 ? DSP_MODE_STEREO : 0);493 dsp->active.mode = 0 | 494 (pcm_sample_format_is_signed(format) ? DSP_MODE_SIGNED : 0) | 495 (channels == 2 ? DSP_MODE_STEREO : 0); 499 496 dsp->active.samples = frames * channels; 500 497 dsp->active.frame_count = 0; … … 522 519 if ((dsp->state == DSP_CAPTURE_NOEVENTS || 523 520 dsp->state == DSP_CAPTURE_ACTIVE_EVENTS) && 524 immediate) 525 { 521 immediate) { 526 522 dsp_write(dsp, DMA_16B_PAUSE); 527 523 dsp_reset(dsp); … … 535 531 return EOK; 536 532 } 537 if (dsp->state == DSP_CAPTURE_ACTIVE_EVENTS) 538 { 533 if (dsp->state == DSP_CAPTURE_ACTIVE_EVENTS) { 539 534 /* Stop after current fragment */ 540 535 assert(!immediate);
Note:
See TracChangeset
for help on using the changeset viewer.