Changeset 124f9bd in mainline for uspace/drv/audio/sb16/dsp.c
- Timestamp:
- 2012-07-05T20:52:36Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e941bf8
- Parents:
- 4bec78f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/dsp.c
r4bec78f r124f9bd 120 120 uint8_t *buffer = dma_create_buffer24(size); 121 121 if (buffer == NULL) { 122 ddf_log_error("Failed to allocate buffer.\n");122 ddf_log_error("Failed to allocate DMA buffer."); 123 123 return ENOMEM; 124 124 } … … 133 133 bzero(dsp->buffer.data, dsp->buffer.size); 134 134 } else { 135 ddf_log_error("Failed to setup DMA16 channel %s.\n",135 ddf_log_error("Failed to setup DMA16 channel: %s.", 136 136 str_error(ret)); 137 137 dma_destroy_buffer(buffer); … … 171 171 const int ret = sb_dsp_read(dsp, &response); 172 172 if (ret != EOK) { 173 ddf_log_error("Failed to read DSP reset response value. \n");173 ddf_log_error("Failed to read DSP reset response value."); 174 174 return ret; 175 175 } 176 176 if (response != DSP_RESET_RESPONSE) { 177 ddf_log_error("Invalid DSP reset response: %x. \n", response);177 ddf_log_error("Invalid DSP reset response: %x.", response); 178 178 return EIO; 179 179 } … … 191 191 assert(dsp); 192 192 if (dsp->event_exchange) { 193 ddf_log_verbose("Sending interrupt event."); 193 194 async_msg_0(dsp->event_exchange, IPC_FIRST_USER_METHOD); 194 195 } else { … … 214 215 215 216 const int ret = sb_setup_buffer(dsp, *size); 216 ddf_log_debug("Providing buffer(%u): %p, %zu B.\n", 217 BUFFER_ID, dsp->buffer.data, dsp->buffer.size); 218 219 if (ret == EOK && buffer) 220 *buffer = dsp->buffer.data; 221 if (ret == EOK && size) 222 *size = dsp->buffer.size; 223 if (ret == EOK && id) 224 *id = BUFFER_ID; 217 if (ret == EOK) { 218 ddf_log_debug("Providing buffer(%u): %p, %zu B.", 219 BUFFER_ID, dsp->buffer.data, dsp->buffer.size); 220 221 if (buffer) 222 *buffer = dsp->buffer.data; 223 if (size) 224 *size = dsp->buffer.size; 225 if (id) 226 *id = BUFFER_ID; 227 } 225 228 return ret; 226 229 } … … 235 238 return EBUSY; 236 239 dsp->event_session = session; 240 ddf_log_debug("Set event session."); 237 241 return EOK; 238 242 } … … 250 254 async_hangup(dsp->event_session); 251 255 dsp->event_session = NULL; 256 ddf_log_debug("DSP buffer released."); 252 257 return EOK; 253 258 } … … 269 274 /* Check supported parameters */ 270 275 ddf_log_debug("Starting playback on buffer(%u): rate: %u, size: %u, " 271 " channels: %u, signed: %s. \n", id, sampling_rate, sample_size,276 " channels: %u, signed: %s.", id, sampling_rate, sample_size, 272 277 channels, sign ? "YES" : "NO" ); 273 278 if (id != BUFFER_ID) … … 288 293 sb_dsp_write(dsp, sampling_rate & 0xff); 289 294 290 ddf_log_debug("Sampling rate: %hhx:%hhx. \n",295 ddf_log_debug("Sampling rate: %hhx:%hhx.", 291 296 sampling_rate >> 8, sampling_rate & 0xff); 292 297
Note:
See TracChangeset
for help on using the changeset viewer.