Changeset 57e8b3b in mainline for uspace/app/dplay/dplay.c
- Timestamp:
- 2012-07-15T15:25:43Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5cd5079
- Parents:
- 2cc5c835
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/dplay/dplay.c
r2cc5c835 r57e8b3b 51 51 52 52 #define DEFAULT_DEVICE "/hw/pci0/00:01.0/sb16/pcm" 53 #define SUBBUFFERS 253 #define BUFFER_PARTS 2 54 54 55 55 typedef struct { … … 85 85 async_answer_0(iid, EOK); 86 86 playback_t *pb = arg; 87 const size_t buffer_part = pb->buffer.size / SUBBUFFERS;87 const size_t buffer_part = pb->buffer.size / BUFFER_PARTS; 88 88 while (1) { 89 89 ipc_call_t call; 90 90 ipc_callid_t callid = async_get_call(&call); 91 91 switch(IPC_GET_IMETHOD(call)) { 92 case PCM_EVENT_ PLAYBACK_DONE:93 printf(" +");92 case PCM_EVENT_FRAMES_PLAYED: 93 printf("%u frames\n", IPC_GET_ARG1(call)); 94 94 async_answer_0(callid, EOK); 95 95 break; 96 96 case PCM_EVENT_PLAYBACK_TERMINATED: 97 printf(" \nPlayback terminated\n");97 printf("Playback terminated\n"); 98 98 fibril_mutex_lock(&pb->mutex); 99 99 pb->playing = false; … … 136 136 printf("Buffer data ready.\n"); 137 137 fibril_mutex_lock(&pb->mutex); 138 const unsigned frames = pb->buffer.size / 139 (BUFFER_PARTS * channels * pcm_sample_format_size(format)); 138 140 int ret = audio_pcm_start_playback(pb->device, 139 SUBBUFFERS, channels, sampling_rate, format);141 frames, channels, sampling_rate, format); 140 142 if (ret != EOK) { 141 143 fibril_mutex_unlock(&pb->mutex);
Note:
See TracChangeset
for help on using the changeset viewer.