Index: uspace/lib/drv/generic/remote_audio_pcm.c
===================================================================
--- uspace/lib/drv/generic/remote_audio_pcm.c	(revision ed3816df9c8d9f9483b524e9564aa65c6fb406e4)
+++ uspace/lib/drv/generic/remote_audio_pcm.c	(revision f2a92b0c6f94b0d6beff63fc001c81aa909272d9)
@@ -342,5 +342,5 @@
  * 0 to turn off event generation.
  */
-int audio_pcm_start_playback(audio_pcm_sess_t *sess, unsigned frames,
+int audio_pcm_start_playback_fragment(audio_pcm_sess_t *sess, unsigned frames,
     unsigned channels, unsigned sample_rate, pcm_sample_format_t format)
 {
@@ -357,7 +357,40 @@
 	return ret;
 }
-
-/**
- * Stop current playback.
+/**
+ * Stops playback after current fragment.
+ *
+ * @param sess Audio device session.
+ *
+ * @return Error code.
+ */
+int audio_pcm_last_playback_fragment(audio_pcm_sess_t *sess)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	const int ret = async_req_2_0(exch,
+	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
+	    IPC_M_AUDIO_PCM_STOP_PLAYBACK, false);
+	async_exchange_end(exch);
+	return ret;
+}
+
+/**
+ * Start playback on buffer from the current position.
+ *
+ * @param sess Audio device session.
+ * @param channels Number of channels.
+ * @param sample_rate Sampling rate (for one channel).
+ * @param format Sample format.
+ *
+ * @return Error code.
+ */
+int audio_pcm_start_playback(audio_pcm_sess_t *sess,
+    unsigned channels, unsigned sample_rate, pcm_sample_format_t format)
+{
+	return audio_pcm_start_playback_fragment(
+	    sess, 0, channels, sample_rate, format);
+}
+
+/**
+ * Immediately stops current playback.
  *
  * @param sess Audio device session.
@@ -368,13 +401,13 @@
 {
 	async_exch_t *exch = async_exchange_begin(sess);
-	const int ret = async_req_1_0(exch,
-	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
-	    IPC_M_AUDIO_PCM_STOP_PLAYBACK);
-	async_exchange_end(exch);
-	return ret;
-}
-
-/**
- * Start capture on buffer from position 0.
+	const int ret = async_req_2_0(exch,
+	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
+	    IPC_M_AUDIO_PCM_STOP_PLAYBACK, true);
+	async_exchange_end(exch);
+	return ret;
+}
+
+/**
+ * Start capture on buffer from the current position.
  *
  * @param sess Audio device session.
@@ -389,5 +422,5 @@
  * 0 to turn off event generation.
  */
-int audio_pcm_start_capture(audio_pcm_sess_t *sess, unsigned frames,
+int audio_pcm_start_capture_fragment(audio_pcm_sess_t *sess, unsigned frames,
     unsigned channels, unsigned sample_rate, pcm_sample_format_t format)
 {
@@ -405,5 +438,40 @@
 
 /**
- * Stop current playback.
+ * Start capture on buffer from the current position.
+ *
+ * @param sess Audio device session.
+ * @param channels Number of channels.
+ * @param sample_rate Sampling rate (for one channel).
+ * @param format Sample format.
+ *
+ * @return Error code.
+ */
+int audio_pcm_start_capture(audio_pcm_sess_t *sess,
+    unsigned channels, unsigned sample_rate, pcm_sample_format_t format)
+{
+	return audio_pcm_start_capture_fragment(
+	    sess, 0, channels, sample_rate, format);
+}
+
+/**
+ * Stops capture at the end of current fragment.
+ *
+ * Won't work if capture was started with fragment size 0.
+ * @param sess Audio device session.
+ *
+ * @return Error code.
+ */
+int audio_pcm_last_capture_fragment(audio_pcm_sess_t *sess)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	const int ret = async_req_2_0(exch,
+	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
+	    IPC_M_AUDIO_PCM_STOP_CAPTURE, false);
+	async_exchange_end(exch);
+	return ret;
+}
+
+/**
+ * Immediately stops current capture.
  *
  * @param sess Audio device session.
@@ -414,6 +482,7 @@
 {
 	async_exch_t *exch = async_exchange_begin(sess);
-	const int ret = async_req_1_0(exch,
-	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), IPC_M_AUDIO_PCM_STOP_CAPTURE);
+	const int ret = async_req_2_0(exch,
+	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
+	    IPC_M_AUDIO_PCM_STOP_CAPTURE, true);
 	async_exchange_end(exch);
 	return ret;
@@ -648,7 +717,8 @@
 {
 	const audio_pcm_iface_t *pcm_iface = iface;
+	const bool immediate = DEV_IPC_GET_ARG1(*call);
 
 	const int ret = pcm_iface->stop_playback ?
-	    pcm_iface->stop_playback(fun) : ENOTSUP;
+	    pcm_iface->stop_playback(fun, immediate) : ENOTSUP;
 	async_answer_0(callid, ret);
 }
@@ -674,7 +744,8 @@
 {
 	const audio_pcm_iface_t *pcm_iface = iface;
+	const bool immediate = DEV_IPC_GET_ARG1(*call);
 
 	const int ret = pcm_iface->stop_capture ?
-	    pcm_iface->stop_capture(fun) : ENOTSUP;
+	    pcm_iface->stop_capture(fun, immediate) : ENOTSUP;
 	async_answer_0(callid, ret);
 }
Index: uspace/lib/drv/include/audio_pcm_iface.h
===================================================================
--- uspace/lib/drv/include/audio_pcm_iface.h	(revision ed3816df9c8d9f9483b524e9564aa65c6fb406e4)
+++ uspace/lib/drv/include/audio_pcm_iface.h	(revision f2a92b0c6f94b0d6beff63fc001c81aa909272d9)
@@ -81,9 +81,17 @@
 int audio_pcm_release_buffer(audio_pcm_sess_t *);
 
-int audio_pcm_start_playback(audio_pcm_sess_t *, unsigned,
+int audio_pcm_start_playback_fragment(audio_pcm_sess_t *, unsigned,
+    unsigned, unsigned, pcm_sample_format_t);
+int audio_pcm_last_playback_fragment(audio_pcm_sess_t *);
+
+int audio_pcm_start_playback(audio_pcm_sess_t *,
     unsigned, unsigned, pcm_sample_format_t);
 int audio_pcm_stop_playback(audio_pcm_sess_t *);
 
-int audio_pcm_start_capture(audio_pcm_sess_t *, unsigned,
+int audio_pcm_start_capture_fragment(audio_pcm_sess_t *, unsigned,
+    unsigned, unsigned, pcm_sample_format_t);
+int audio_pcm_last_capture_fragment(audio_pcm_sess_t *);
+
+int audio_pcm_start_capture(audio_pcm_sess_t *,
     unsigned, unsigned, pcm_sample_format_t);
 int audio_pcm_stop_capture(audio_pcm_sess_t *);
@@ -102,8 +110,8 @@
 	int (*start_playback)(ddf_fun_t *, unsigned,
 	    unsigned, unsigned, pcm_sample_format_t);
-	int (*stop_playback)(ddf_fun_t *);
+	int (*stop_playback)(ddf_fun_t *, bool);
 	int (*start_capture)(ddf_fun_t *, unsigned,
 	    unsigned, unsigned, pcm_sample_format_t);
-	int (*stop_capture)(ddf_fun_t *);
+	int (*stop_capture)(ddf_fun_t *, bool);
 } audio_pcm_iface_t;
 
