Changeset b7c080c in mainline for uspace/drv/audio/sb16/dsp.c
- Timestamp:
- 2012-07-15T18:55:48Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a9aae16e
- Parents:
- 63c34d7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/dsp.c
r63c34d7 rb7c080c 53 53 54 54 #define DSP_RESET_RESPONSE 0xaa 55 #define DSP_RATE_LIMIT 45000 55 56 56 57 #define AUTO_DMA_MODE … … 223 224 } 224 225 226 int sb_dsp_test_format(sb_dsp_t *dsp, unsigned *channels, unsigned *rate, 227 pcm_sample_format_t *format) 228 { 229 int ret = EOK; 230 if (*channels == 0 || *channels > 2) { 231 *channels = 2; 232 ret = ELIMIT; 233 } 234 if (*rate > DSP_RATE_LIMIT) { 235 *rate = DSP_RATE_LIMIT; 236 ret = ELIMIT; 237 } 238 //TODO 8bit DMA supports 8bit formats 239 if (*format != PCM_SAMPLE_SINT16_LE && *format != PCM_SAMPLE_UINT16_LE) { 240 *format = pcm_sample_format_is_signed(*format) ? 241 PCM_SAMPLE_SINT16_LE : PCM_SAMPLE_UINT16_LE; 242 ret = ELIMIT; 243 } 244 return ret; 245 } 246 225 247 int sb_dsp_get_buffer(sb_dsp_t *dsp, void **buffer, size_t *size) 226 248 { … … 283 305 if (channels != 1 && channels != 2) 284 306 return ENOTSUP; 285 if (sampling_rate > 44100)307 if (sampling_rate > DSP_RATE_LIMIT) 286 308 return ENOTSUP; 287 309 // FIXME We only support 16 bit playback … … 351 373 if (channels != 1 && channels != 2) 352 374 return ENOTSUP; 353 if (sampling_rate > 44100)375 if (sampling_rate > DSP_RATE_LIMIT) 354 376 return ENOTSUP; 355 377 // FIXME We only support 16 bit recording
Note:
See TracChangeset
for help on using the changeset viewer.