Index: uspace/app/wavplay/drec.c
===================================================================
--- uspace/app/wavplay/drec.c	(revision 7f9d97f3ef14161b0334989eea3a64581e2c86cc)
+++ uspace/app/wavplay/drec.c	(revision c0393dbcc040eb89952593433df3e021f9e0c323)
@@ -47,5 +47,5 @@
 
 
-#define BUFFER_PARTS   2
+#define BUFFER_PARTS   16
 
 /** Recording format */
@@ -103,7 +103,7 @@
 			printf("Recording terminated\n");
 			record = false;
+			break;
 		case PCM_EVENT_FRAMES_CAPTURED:
 			printf("%" PRIun " frames\n", IPC_GET_ARG1(call));
-			async_answer_0(callid, EOK);
 			break;
 		default:
@@ -111,5 +111,9 @@
 			async_answer_0(callid, ENOTSUP);
 			continue;
-
+		}
+
+		if (!record) {
+			async_answer_0(callid, EOK);
+			break;
 		}
 
@@ -156,4 +160,8 @@
 	printf("\n");
 	audio_pcm_stop_capture(rec->device);
+	/* XXX Control returns even before we can be sure callbacks finished */
+	printf("Delay before playback termination\n");
+	async_usleep(1000000);
+	printf("Terminate playback\n");
 }
 
Index: uspace/app/wavplay/main.c
===================================================================
--- uspace/app/wavplay/main.c	(revision 7f9d97f3ef14161b0334989eea3a64581e2c86cc)
+++ uspace/app/wavplay/main.c	(revision c0393dbcc040eb89952593433df3e021f9e0c323)
@@ -308,4 +308,5 @@
 			if (direct) {
 				drecord(device, file);
+				continue;
 			} else {
 				printf("Indirect recording is not supported "
Index: uspace/app/wavplay/wave.c
===================================================================
--- uspace/app/wavplay/wave.c	(revision 7f9d97f3ef14161b0334989eea3a64581e2c86cc)
+++ uspace/app/wavplay/wave.c	(revision c0393dbcc040eb89952593433df3e021f9e0c323)
@@ -116,5 +116,5 @@
 		*channels = uint16_t_le2host(header->channels);
 	if (format) {
-		const unsigned size = uint32_t_le2host(header->sample_size);
+		const unsigned size = uint16_t_le2host(header->sample_size);
 		switch (size) {
 		case 8: *format = PCM_SAMPLE_UINT8; break;
@@ -157,5 +157,5 @@
 	header->channels = host2uint32_t_le(format.channels);
 	header->sample_size =
-	    host2uint32_t_le(pcm_sample_format_size(format.sample_format));
+	    host2uint16_t_le(pcm_sample_format_size(format.sample_format) * 8);
 }
 /**
