Changeset 018ab50 in mainline for uspace/drv/audio/sb16
- Timestamp:
- 2012-08-20T11:28:46Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fb6c98f
- Parents:
- 20840922
- Location:
- uspace/drv/audio/sb16
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/dsp.c
r20840922 r018ab50 55 55 56 56 #define DSP_RESET_RESPONSE 0xaa 57 #define DSP_RATE_LIMIT 45000 57 58 /* These are only for SB16 (DSP4.00+) */ 59 #define DSP_RATE_UPPER_LIMIT 44100 60 #define DSP_RATE_LOWER_LIMIT 5000 58 61 59 62 #define AUTO_DMA_MODE … … 294 297 ret = ELIMIT; 295 298 } 296 if (*rate > DSP_RATE_LIMIT) {297 *rate = DSP_RATE_LIMIT;298 ret = ELIMIT;299 }300 299 //TODO 8bit DMA supports 8bit formats 301 300 if (*format != PCM_SAMPLE_SINT16_LE && *format != PCM_SAMPLE_UINT16_LE) { … … 304 303 ret = ELIMIT; 305 304 } 305 if (*rate > DSP_RATE_UPPER_LIMIT) { 306 *rate = DSP_RATE_UPPER_LIMIT; 307 ret = ELIMIT; 308 } 309 if (*rate < DSP_RATE_LOWER_LIMIT) { 310 *rate = DSP_RATE_LOWER_LIMIT; 311 ret = ELIMIT; 312 } 306 313 return ret; 307 314 } … … 333 340 { 334 341 assert(dsp); 335 assert(session);336 342 if (dsp->event_session) 337 343 return EBUSY; 338 344 dsp->event_session = session; 339 ddf_log_debug("Set event session."); 340 return EOK; 345 ddf_log_debug("Set event session to %p.", session); 346 return EOK; 347 } 348 349 async_sess_t * sb_dsp_get_event_session(sb_dsp_t *dsp) 350 { 351 assert(dsp); 352 ddf_log_debug("Get event session: %p.", dsp->event_session); 353 return dsp->event_session; 341 354 } 342 355 -
uspace/drv/audio/sb16/dsp.h
r20840922 r018ab50 80 80 int sb_dsp_get_buffer(sb_dsp_t *dsp, void **buffer, size_t *size); 81 81 int sb_dsp_set_event_session(sb_dsp_t *dsp, async_sess_t *session); 82 async_sess_t * sb_dsp_get_event_session(sb_dsp_t *dsp); 82 83 int sb_dsp_release_buffer(sb_dsp_t *dsp); 83 84 int sb_dsp_start_playback(sb_dsp_t *dsp, unsigned frames, -
uspace/drv/audio/sb16/pcm_iface.c
r20840922 r018ab50 87 87 } 88 88 89 static async_sess_t * sb_get_event_session(ddf_fun_t *fun) 90 { 91 assert(fun); 92 assert(fun->driver_data); 93 sb_dsp_t *dsp = fun->driver_data; 94 return sb_dsp_get_event_session(dsp); 95 } 96 89 97 static int sb_release_buffer(ddf_fun_t *fun) 90 98 { … … 139 147 .release_buffer = sb_release_buffer, 140 148 .set_event_session = sb_set_event_session, 149 .get_event_session = sb_get_event_session, 141 150 .get_buffer_pos = sb_get_buffer_position, 142 151
Note:
See TracChangeset
for help on using the changeset viewer.