Changeset 0ea8f83 in mainline for uspace/drv/audio/sb16/dsp.c
- Timestamp:
- 2011-11-11T19:44:07Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d98d136
- Parents:
- 751d17a2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/dsp.c
r751d17a2 r0ea8f83 43 43 #include "dsp.h" 44 44 45 #define BUFFER_SIZE (PAGE_SIZE / 4)45 #define BUFFER_SIZE (PAGE_SIZE) 46 46 #define PLAY_BLOCK_SIZE (BUFFER_SIZE / 2) 47 47 … … 108 108 { 109 109 assert(dsp); 110 uint8_t *buffer = malloc24(BUFFER_SIZE);110 uint8_t *buffer = dma_create_buffer24(BUFFER_SIZE); 111 111 if (buffer == NULL) { 112 112 ddf_log_error("Failed to allocate buffer.\n"); … … 118 118 /* Set 16 bit channel */ 119 119 const int ret = dma_setup_channel(SB_DMA_CHAN_16, pa, BUFFER_SIZE, 120 DMA_MODE_READ | DMA_MODE_AUTO | DMA_MODE_ SINGLE);120 DMA_MODE_READ | DMA_MODE_AUTO | DMA_MODE_ON_DEMAND); 121 121 if (ret == EOK) { 122 122 dsp->buffer.data = buffer; … … 127 127 ddf_log_error("Failed to setup DMA16 channel %s.\n", 128 128 str_error(ret)); 129 free24(buffer);129 dma_destroy_buffer(buffer); 130 130 } 131 131 return ret; … … 134 134 static inline void sb_clear_buffer(sb_dsp_t *dsp) 135 135 { 136 free24(dsp->buffer.data);136 dma_destroy_buffer(dsp->buffer.data); 137 137 dsp->buffer.data = NULL; 138 138 dsp->buffer.position = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.