HelenOS sources
This source file includes following definitions.
- audio_pcm_cap_str
- audio_pcm_event_str
- audio_pcm_open_default
- audio_pcm_open
- audio_pcm_open_service
- audio_pcm_close
- audio_pcm_get_info_str
- audio_pcm_query_cap
- audio_pcm_get_buffer_pos
- audio_pcm_test_format
- audio_pcm_register_event_callback
- audio_pcm_unregister_event_callback
- audio_pcm_get_buffer
- audio_pcm_release_buffer
- audio_pcm_start_playback_fragment
- audio_pcm_last_playback_fragment
- audio_pcm_start_playback
- audio_pcm_stop_playback_immediate
- audio_pcm_stop_playback
- audio_pcm_start_capture_fragment
- audio_pcm_start_capture
- audio_pcm_last_capture_fragment
- audio_pcm_stop_capture_immediate
- audio_pcm_stop_capture
- remote_audio_pcm_get_info_str
- remote_audio_pcm_query_caps
- remote_audio_pcm_events_register
- remote_audio_pcm_events_unregister
- remote_audio_pcm_get_buffer_pos
- remote_audio_pcm_test_format
- remote_audio_pcm_get_buffer
- remote_audio_pcm_release_buffer
- remote_audio_pcm_start_playback
- remote_audio_pcm_stop_playback
- remote_audio_pcm_start_capture
- remote_audio_pcm_stop_capture
#include <async.h>
#include <devman.h>
#include <ddf/log.h>
#include <errno.h>
#include <macros.h>
#include <str.h>
#include <as.h>
#include "audio_pcm_iface.h"
#include "ddf/driver.h"
typedef enum {
IPC_M_AUDIO_PCM_GET_INFO_STR,
IPC_M_AUDIO_PCM_QUERY_CAPS,
IPC_M_AUDIO_PCM_REGISTER_EVENTS,
IPC_M_AUDIO_PCM_UNREGISTER_EVENTS,
IPC_M_AUDIO_PCM_TEST_FORMAT,
IPC_M_AUDIO_PCM_GET_BUFFER,
IPC_M_AUDIO_PCM_RELEASE_BUFFER,
IPC_M_AUDIO_PCM_GET_BUFFER_POS,
IPC_M_AUDIO_PCM_START_PLAYBACK,
IPC_M_AUDIO_PCM_STOP_PLAYBACK,
IPC_M_AUDIO_PCM_START_CAPTURE,
IPC_M_AUDIO_PCM_STOP_CAPTURE,
} audio_pcm_iface_funcs_t;
const char *audio_pcm_cap_str(audio_cap_t cap)
{
static const char *caps[] = {
[AUDIO_CAP_CAPTURE] = "CAPTURE",
[AUDIO_CAP_PLAYBACK] = "PLAYBACK",
[AUDIO_CAP_MAX_BUFFER] = "MAXIMUM BUFFER SIZE",
[AUDIO_CAP_BUFFER_POS] = "KNOWS BUFFER POSITION",
[AUDIO_CAP_INTERRUPT] = "FRAGMENT INTERRUPTS",
[AUDIO_CAP_INTERRUPT_MIN_FRAMES] = "MINIMUM FRAGMENT SIZE",
[AUDIO_CAP_INTERRUPT_MAX_FRAMES] = "MAXIMUM FRAGMENT SIZE",
};
if (cap >= ARRAY_SIZE(caps))
return "UNKNOWN CAP";
return caps[cap];
}
const char *audio_pcm_event_str(pcm_event_t event)
{
static const char *events[] = {
[PCM_EVENT_PLAYBACK_STARTED] = "PLAYBACK STARTED",
[PCM_EVENT_CAPTURE_STARTED] = "CAPTURE STARTED",
[PCM_EVENT_FRAMES_PLAYED] = "FRAGMENT PLAYED",
[PCM_EVENT_FRAMES_CAPTURED] = "FRAGMENT CAPTURED",
[PCM_EVENT_PLAYBACK_TERMINATED] = "PLAYBACK TERMINATED",
[PCM_EVENT_CAPTURE_TERMINATED] = "CAPTURE TERMINATED",
};
if (event >= ARRAY_SIZE(events))
return "UNKNOWN EVENT";
return events[event];
}
audio_pcm_sess_t *audio_pcm_open_default(void)
{
static bool resolved = false;
static category_id_t pcm_id = 0;
if (!resolved) {
const errno_t ret = loc_category_get_id("audio-pcm", &pcm_id,
IPC_FLAG_BLOCKING);
if (ret != EOK)
return NULL;
resolved = true;
}
service_id_t *svcs = NULL;
size_t count = 0;
const errno_t ret = loc_category_get_svcs(pcm_id, &svcs, &count);
if (ret != EOK)
return NULL;
audio_pcm_sess_t *session = NULL;
if (count)
session = audio_pcm_open_service(svcs[0]);
free(svcs);
return session;
}
audio_pcm_sess_t *audio_pcm_open(const char *name)
{
service_id_t sid;
const errno_t ret = loc_service_get_id(name, &sid, 0);
if (ret != EOK)
return NULL;
return loc_service_connect(sid, INTERFACE_DDF, 0);
}
audio_pcm_sess_t *audio_pcm_open_service(service_id_t id)
{
return loc_service_connect(id, INTERFACE_DDF, IPC_FLAG_BLOCKING);
}
void audio_pcm_close(audio_pcm_sess_t *sess)
{
if (sess)
async_hangup(sess);
}
errno_t audio_pcm_get_info_str(audio_pcm_sess_t *sess, char **name)
{
if (!name)
return EINVAL;
async_exch_t *exch = async_exchange_begin(sess);
sysarg_t name_size;
const errno_t ret = async_req_1_1(exch,
DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
IPC_M_AUDIO_PCM_GET_INFO_STR, &name_size);
if (ret == EOK) {
char *name_place = calloc(1, name_size);
if (!name_place) {
async_data_read_start(exch, (void *)-1, 0);
async_exchange_end(exch);
return ENOMEM;
}
const errno_t ret =
async_data_read_start(exch, name_place, name_size);
if (ret != EOK) {
free(name_place);
async_exchange_end(exch);
return ret;
}
*name = name_place;
}
async_exchange_end(exch);
return ret;
}
errno_t audio_pcm_query_cap(audio_pcm_sess_t *sess, audio_cap_t cap, sysarg_t *value)
{
async_exch_t *exch = async_exchange_begin(sess);
const errno_t ret = async_req_2_1(exch,
DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), IPC_M_AUDIO_PCM_QUERY_CAPS,
cap, value);
async_exchange_end(exch);
return ret;
}
errno_t audio_pcm_get_buffer_pos(audio_pcm_sess_t *sess, size_t *pos)
{
if (!pos)
return EINVAL;
async_exch_t *exch = async_exchange_begin(sess);
sysarg_t value = 0;
const errno_t ret = async_req_1_1(exch,
DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
IPC_M_AUDIO_PCM_GET_BUFFER_POS, &value);
if (ret == EOK)
*pos = value;
async_exchange_end(exch);
return ret;
}
errno_t audio_pcm_test_format(audio_pcm_sess_t *sess, unsigned *channels,
unsigned *rate, pcm_sample_format_t *format)
{
async_exch_t *exch = async_exchange_begin(sess);
sysarg_t channels_arg = channels ? *channels : 0;
sysarg_t rate_arg = rate ? *rate : 0;
sysarg_t format_arg = format ? *format : 0;
const errno_t ret = async_req_4_3(exch,
DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
IPC_M_AUDIO_PCM_TEST_FORMAT, channels_arg, rate_arg, format_arg,
&channels_arg, &rate_arg, &format_arg);
async_exchange_end(exch);
if ((ret == EOK || ret == ELIMIT) &&
(!channels || *channels == channels_arg) &&
(!rate || *rate == rate_arg) &&
(!format || *format == format_arg))
return EOK;
if (channels)
*channels = channels_arg;
if (rate)
*rate = rate_arg;
if (format)
*format = format_arg;
return ret;
}
errno_t audio_pcm_register_event_callback(audio_pcm_sess_t *sess,
async_port_handler_t event_callback, void *arg)
{
if (!event_callback)
return EINVAL;
async_exch_t *exch = async_exchange_begin(sess);
errno_t ret = async_req_1_0(exch, DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
IPC_M_AUDIO_PCM_REGISTER_EVENTS);
if (ret == EOK) {
port_id_t port;
ret = async_create_callback_port(exch, INTERFACE_AUDIO_PCM_CB, 0, 0,
event_callback, arg, &port);
}
async_exchange_end(exch);
return ret;
}
errno_t audio_pcm_unregister_event_callback(audio_pcm_sess_t *sess)
{
async_exch_t *exch = async_exchange_begin(sess);
const errno_t ret = async_req_1_0(exch,
DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
IPC_M_AUDIO_PCM_UNREGISTER_EVENTS);
async_exchange_end(exch);
return ret;
}
errno_t audio_pcm_get_buffer(audio_pcm_sess_t *sess, void **buffer, size_t *size)
{
if (!buffer || !size)
return EINVAL;
async_exch_t *exch = async_exchange_begin(sess);
sysarg_t buffer_size = *size;
errno_t ret = async_req_2_1(exch, DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
IPC_M_AUDIO_PCM_GET_BUFFER, (sysarg_t)buffer_size, &buffer_size);
if (ret == EOK) {
void *dst = NULL;
ret = async_share_in_start_0_0(exch, buffer_size, &dst);
if (ret != EOK) {
async_exchange_end(exch);
return ret;
}
*buffer = dst;
*size = buffer_size;
}
async_exchange_end(exch);
return ret;
}
errno_t audio_pcm_release_buffer(audio_pcm_sess_t *sess)
{
async_exch_t *exch = async_exchange_begin(sess);
const errno_t ret = async_req_1_0(exch,
DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
IPC_M_AUDIO_PCM_RELEASE_BUFFER);
async_exchange_end(exch);
return ret;
}
errno_t audio_pcm_start_playback_fragment(audio_pcm_sess_t *sess, unsigned frames,
unsigned channels, unsigned sample_rate, pcm_sample_format_t format)
{
if (channels > UINT16_MAX)
return EINVAL;
assert((format & UINT16_MAX) == format);
const sysarg_t packed = (channels << 16) | (format & UINT16_MAX);
async_exch_t *exch = async_exchange_begin(sess);
const errno_t ret = async_req_4_0(exch,
DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
IPC_M_AUDIO_PCM_START_PLAYBACK,
frames, sample_rate, packed);
async_exchange_end(exch);
return ret;
}
errno_t audio_pcm_last_playback_fragment(audio_pcm_sess_t *sess)
{
async_exch_t *exch = async_exchange_begin(sess);
const errno_t 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;
}
errno_t 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);
}
errno_t audio_pcm_stop_playback_immediate(audio_pcm_sess_t *sess)
{
async_exch_t *exch = async_exchange_begin(sess);
const errno_t 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;
}
errno_t audio_pcm_stop_playback(audio_pcm_sess_t *sess)
{
async_exch_t *exch = async_exchange_begin(sess);
const errno_t 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;
}
errno_t audio_pcm_start_capture_fragment(audio_pcm_sess_t *sess, unsigned frames,
unsigned channels, unsigned sample_rate, pcm_sample_format_t format)
{
if (channels > UINT16_MAX)
return EINVAL;
assert((format & UINT16_MAX) == format);
const sysarg_t packed = (channels << 16) | (format & UINT16_MAX);
async_exch_t *exch = async_exchange_begin(sess);
const errno_t ret = async_req_4_0(exch,
DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), IPC_M_AUDIO_PCM_START_CAPTURE,
frames, sample_rate, packed);
async_exchange_end(exch);
return ret;
}
errno_t 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);
}
errno_t audio_pcm_last_capture_fragment(audio_pcm_sess_t *sess)
{
async_exch_t *exch = async_exchange_begin(sess);
const errno_t 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;
}
errno_t audio_pcm_stop_capture_immediate(audio_pcm_sess_t *sess)
{
async_exch_t *exch = async_exchange_begin(sess);
const errno_t 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;
}
errno_t audio_pcm_stop_capture(audio_pcm_sess_t *sess)
{
async_exch_t *exch = async_exchange_begin(sess);
const errno_t 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;
}
static void remote_audio_pcm_get_info_str(ddf_fun_t *, void *, ipc_call_t *);
static void remote_audio_pcm_query_caps(ddf_fun_t *, void *, ipc_call_t *);
static void remote_audio_pcm_events_register(ddf_fun_t *, void *, ipc_call_t *);
static void remote_audio_pcm_events_unregister(ddf_fun_t *, void *, ipc_call_t *);
static void remote_audio_pcm_get_buffer_pos(ddf_fun_t *, void *, ipc_call_t *);
static void remote_audio_pcm_test_format(ddf_fun_t *, void *, ipc_call_t *);
static void remote_audio_pcm_get_buffer(ddf_fun_t *, void *, ipc_call_t *);
static void remote_audio_pcm_release_buffer(ddf_fun_t *, void *, ipc_call_t *);
static void remote_audio_pcm_start_playback(ddf_fun_t *, void *, ipc_call_t *);
static void remote_audio_pcm_stop_playback(ddf_fun_t *, void *, ipc_call_t *);
static void remote_audio_pcm_start_capture(ddf_fun_t *, void *, ipc_call_t *);
static void remote_audio_pcm_stop_capture(ddf_fun_t *, void *, ipc_call_t *);
static const remote_iface_func_ptr_t remote_audio_pcm_iface_ops[] = {
[IPC_M_AUDIO_PCM_GET_INFO_STR] = remote_audio_pcm_get_info_str,
[IPC_M_AUDIO_PCM_QUERY_CAPS] = remote_audio_pcm_query_caps,
[IPC_M_AUDIO_PCM_REGISTER_EVENTS] = remote_audio_pcm_events_register,
[IPC_M_AUDIO_PCM_UNREGISTER_EVENTS] = remote_audio_pcm_events_unregister,
[IPC_M_AUDIO_PCM_GET_BUFFER_POS] = remote_audio_pcm_get_buffer_pos,
[IPC_M_AUDIO_PCM_TEST_FORMAT] = remote_audio_pcm_test_format,
[IPC_M_AUDIO_PCM_GET_BUFFER] = remote_audio_pcm_get_buffer,
[IPC_M_AUDIO_PCM_RELEASE_BUFFER] = remote_audio_pcm_release_buffer,
[IPC_M_AUDIO_PCM_START_PLAYBACK] = remote_audio_pcm_start_playback,
[IPC_M_AUDIO_PCM_STOP_PLAYBACK] = remote_audio_pcm_stop_playback,
[IPC_M_AUDIO_PCM_START_CAPTURE] = remote_audio_pcm_start_capture,
[IPC_M_AUDIO_PCM_STOP_CAPTURE] = remote_audio_pcm_stop_capture,
};
const remote_iface_t remote_audio_pcm_iface = {
.method_count = ARRAY_SIZE(remote_audio_pcm_iface_ops),
.methods = remote_audio_pcm_iface_ops
};
void remote_audio_pcm_get_info_str(ddf_fun_t *fun, void *iface,
ipc_call_t *call)
{
const audio_pcm_iface_t *pcm_iface = iface;
if (!pcm_iface->get_info_str) {
async_answer_0(call, ENOTSUP);
return;
}
const char *name = NULL;
const errno_t ret = pcm_iface->get_info_str(fun, &name);
const size_t name_size = name ? str_size(name) + 1 : 0;
async_answer_1(call, ret, name_size);
if (ret == EOK && name_size > 0) {
ipc_call_t call;
size_t size;
if (!async_data_read_receive(&call, &size)) {
async_answer_0(&call, EPARTY);
return;
}
if (size != name_size) {
async_answer_0(&call, ELIMIT);
return;
}
async_data_read_finalize(&call, name, name_size);
}
}
void remote_audio_pcm_query_caps(ddf_fun_t *fun, void *iface,
ipc_call_t *call)
{
const audio_pcm_iface_t *pcm_iface = iface;
const audio_cap_t cap = DEV_IPC_GET_ARG1(*call);
if (pcm_iface->query_cap) {
const unsigned value = pcm_iface->query_cap(fun, cap);
async_answer_1(call, EOK, value);
} else {
async_answer_0(call, ENOTSUP);
}
}
static void remote_audio_pcm_events_register(ddf_fun_t *fun, void *iface,
ipc_call_t *call)
{
const audio_pcm_iface_t *pcm_iface = iface;
if (!pcm_iface->get_event_session ||
!pcm_iface->set_event_session) {
async_answer_0(call, ENOTSUP);
return;
}
async_answer_0(call, EOK);
ipc_call_t callback_call;
async_get_call(&callback_call);
async_sess_t *sess =
async_callback_receive_start(EXCHANGE_ATOMIC, &callback_call);
if (sess == NULL) {
ddf_msg(LVL_DEBUG, "Failed to create event callback");
async_answer_0(&callback_call, EAGAIN);
return;
}
const errno_t ret = pcm_iface->set_event_session(fun, sess);
if (ret != EOK) {
ddf_msg(LVL_DEBUG, "Failed to set event callback.");
async_hangup(sess);
async_answer_0(&callback_call, ret);
return;
}
async_answer_0(&callback_call, EOK);
}
static void remote_audio_pcm_events_unregister(ddf_fun_t *fun, void *iface,
ipc_call_t *call)
{
const audio_pcm_iface_t *pcm_iface = iface;
if (!pcm_iface->get_event_session ||
!pcm_iface->set_event_session) {
async_answer_0(call, ENOTSUP);
return;
}
async_sess_t *sess = pcm_iface->get_event_session(fun);
if (sess) {
async_hangup(sess);
pcm_iface->set_event_session(fun, NULL);
}
async_answer_0(call, EOK);
}
void remote_audio_pcm_get_buffer_pos(ddf_fun_t *fun, void *iface,
ipc_call_t *call)
{
const audio_pcm_iface_t *pcm_iface = iface;
size_t pos = 0;
const errno_t ret = pcm_iface->get_buffer_pos ?
pcm_iface->get_buffer_pos(fun, &pos) : ENOTSUP;
async_answer_1(call, ret, pos);
}
void remote_audio_pcm_test_format(ddf_fun_t *fun, void *iface,
ipc_call_t *call)
{
const audio_pcm_iface_t *pcm_iface = iface;
unsigned channels = DEV_IPC_GET_ARG1(*call);
unsigned rate = DEV_IPC_GET_ARG2(*call);
pcm_sample_format_t format = DEV_IPC_GET_ARG3(*call);
const errno_t ret = pcm_iface->test_format ?
pcm_iface->test_format(fun, &channels, &rate, &format) : ENOTSUP;
async_answer_3(call, ret, channels, rate, format);
}
void remote_audio_pcm_get_buffer(ddf_fun_t *fun, void *iface,
ipc_call_t *call)
{
const audio_pcm_iface_t *pcm_iface = iface;
if (!pcm_iface->get_buffer ||
!pcm_iface->release_buffer) {
async_answer_0(call, ENOTSUP);
return;
}
void *buffer = NULL;
size_t size = DEV_IPC_GET_ARG1(*call);
errno_t ret = pcm_iface->get_buffer(fun, &buffer, &size);
async_answer_1(call, ret, size);
if (ret != EOK || size == 0)
return;
ipc_call_t share;
size_t share_size = 0;
ddf_msg(LVL_DEBUG2, "Receiving share request.");
if (!async_share_in_receive(&share, &share_size)) {
ddf_msg(LVL_DEBUG, "Failed to share pcm buffer.");
pcm_iface->release_buffer(fun);
async_answer_0(&share, EPARTY);
return;
}
ddf_msg(LVL_DEBUG2, "Checking requested share size.");
if (share_size != size) {
ddf_msg(LVL_DEBUG, "Incorrect pcm buffer size requested.");
pcm_iface->release_buffer(fun);
async_answer_0(&share, ELIMIT);
return;
}
ddf_msg(LVL_DEBUG2, "Calling share finalize.");
ret = async_share_in_finalize(&share, buffer, AS_AREA_WRITE |
AS_AREA_READ);
if (ret != EOK) {
ddf_msg(LVL_DEBUG, "Failed to share buffer.");
pcm_iface->release_buffer(fun);
return;
}
ddf_msg(LVL_DEBUG2, "Buffer shared with size %zu.", share_size);
}
void remote_audio_pcm_release_buffer(ddf_fun_t *fun, void *iface,
ipc_call_t *call)
{
const audio_pcm_iface_t *pcm_iface = iface;
const errno_t ret = pcm_iface->release_buffer ?
pcm_iface->release_buffer(fun) : ENOTSUP;
async_answer_0(call, ret);
}
void remote_audio_pcm_start_playback(ddf_fun_t *fun, void *iface,
ipc_call_t *call)
{
const audio_pcm_iface_t *pcm_iface = iface;
const unsigned frames = DEV_IPC_GET_ARG1(*call);
const unsigned rate = DEV_IPC_GET_ARG2(*call);
const unsigned channels = (DEV_IPC_GET_ARG3(*call) >> 16) & UINT8_MAX;
const pcm_sample_format_t format = DEV_IPC_GET_ARG3(*call) & UINT16_MAX;
const errno_t ret = pcm_iface->start_playback ?
pcm_iface->start_playback(fun, frames, channels, rate, format) :
ENOTSUP;
async_answer_0(call, ret);
}
void remote_audio_pcm_stop_playback(ddf_fun_t *fun, void *iface,
ipc_call_t *call)
{
const audio_pcm_iface_t *pcm_iface = iface;
const bool immediate = DEV_IPC_GET_ARG1(*call);
const errno_t ret = pcm_iface->stop_playback ?
pcm_iface->stop_playback(fun, immediate) : ENOTSUP;
async_answer_0(call, ret);
}
void remote_audio_pcm_start_capture(ddf_fun_t *fun, void *iface,
ipc_call_t *call)
{
const audio_pcm_iface_t *pcm_iface = iface;
const unsigned frames = DEV_IPC_GET_ARG1(*call);
const unsigned rate = DEV_IPC_GET_ARG2(*call);
const unsigned channels = (DEV_IPC_GET_ARG3(*call) >> 16) & UINT16_MAX;
const pcm_sample_format_t format = DEV_IPC_GET_ARG3(*call) & UINT16_MAX;
const errno_t ret = pcm_iface->start_capture ?
pcm_iface->start_capture(fun, frames, channels, rate, format) :
ENOTSUP;
async_answer_0(call, ret);
}
void remote_audio_pcm_stop_capture(ddf_fun_t *fun, void *iface,
ipc_call_t *call)
{
const audio_pcm_iface_t *pcm_iface = iface;
const bool immediate = DEV_IPC_GET_ARG1(*call);
const errno_t ret = pcm_iface->stop_capture ?
pcm_iface->stop_capture(fun, immediate) : ENOTSUP;
async_answer_0(call, ret);
}
HelenOS homepage, sources at GitHub