mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-09 10:06:17 -05:00
replace SNDMSG,SYSMSG,SNDERR,SYSERR with new log macros
... with interface identifiers Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
492df4bb94
commit
62c8e635dc
82 changed files with 1292 additions and 1201 deletions
|
|
@ -1367,7 +1367,7 @@ int snd_ctl_wait(snd_ctl_t *ctl, int timeout)
|
|||
|
||||
npfds = snd_ctl_poll_descriptors_count(ctl);
|
||||
if (npfds <= 0 || npfds >= 16) {
|
||||
SNDERR("Invalid poll_fds %d", npfds);
|
||||
snd_error(CONTROL, "Invalid poll_fds %d", npfds);
|
||||
return -EIO;
|
||||
}
|
||||
pfd = alloca(sizeof(*pfd) * npfds);
|
||||
|
|
@ -1375,7 +1375,7 @@ int snd_ctl_wait(snd_ctl_t *ctl, int timeout)
|
|||
if (err < 0)
|
||||
return err;
|
||||
if (err != npfds) {
|
||||
SNDMSG("invalid poll descriptors %d", err);
|
||||
snd_check(CONTROL, "invalid poll descriptors %d", err);
|
||||
return -EIO;
|
||||
}
|
||||
for (;;) {
|
||||
|
|
@ -1458,30 +1458,30 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name,
|
|||
#endif
|
||||
if (snd_config_get_type(ctl_conf) != SND_CONFIG_TYPE_COMPOUND) {
|
||||
if (name)
|
||||
SNDERR("Invalid type for CTL %s definition", name);
|
||||
snd_error(CONTROL, "Invalid type for CTL %s definition", name);
|
||||
else
|
||||
SNDERR("Invalid type for CTL definition");
|
||||
snd_error(CONTROL, "Invalid type for CTL definition");
|
||||
return -EINVAL;
|
||||
}
|
||||
err = snd_config_search(ctl_conf, "type", &conf);
|
||||
if (err < 0) {
|
||||
SNDERR("type is not defined");
|
||||
snd_error(CONTROL, "type is not defined");
|
||||
return err;
|
||||
}
|
||||
err = snd_config_get_id(conf, &id);
|
||||
if (err < 0) {
|
||||
SNDERR("unable to get id");
|
||||
snd_error(CONTROL, "unable to get id");
|
||||
return err;
|
||||
}
|
||||
err = snd_config_get_string(conf, &str);
|
||||
if (err < 0) {
|
||||
SNDERR("Invalid type for %s", id);
|
||||
snd_error(CONTROL, "Invalid type for %s", id);
|
||||
return err;
|
||||
}
|
||||
err = snd_config_search_definition(ctl_root, "ctl_type", str, &type_conf);
|
||||
if (err >= 0) {
|
||||
if (snd_config_get_type(type_conf) != SND_CONFIG_TYPE_COMPOUND) {
|
||||
SNDERR("Invalid type for CTL type %s definition", str);
|
||||
snd_error(CONTROL, "Invalid type for CTL type %s definition", str);
|
||||
err = -EINVAL;
|
||||
goto _err;
|
||||
}
|
||||
|
|
@ -1495,7 +1495,7 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name,
|
|||
if (strcmp(id, "lib") == 0) {
|
||||
err = snd_config_get_string(n, &lib);
|
||||
if (err < 0) {
|
||||
SNDERR("Invalid type for %s", id);
|
||||
snd_error(CONTROL, "Invalid type for %s", id);
|
||||
goto _err;
|
||||
}
|
||||
continue;
|
||||
|
|
@ -1503,12 +1503,12 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name,
|
|||
if (strcmp(id, "open") == 0) {
|
||||
err = snd_config_get_string(n, &open_name);
|
||||
if (err < 0) {
|
||||
SNDERR("Invalid type for %s", id);
|
||||
snd_error(CONTROL, "Invalid type for %s", id);
|
||||
goto _err;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
SNDERR("Unknown field %s", id);
|
||||
snd_error(CONTROL, "Unknown field %s", id);
|
||||
err = -EINVAL;
|
||||
goto _err;
|
||||
}
|
||||
|
|
@ -1572,7 +1572,7 @@ static int snd_ctl_open_noupdate(snd_ctl_t **ctlp, snd_config_t *root,
|
|||
|
||||
err = snd_config_search_definition(root, "ctl", name, &ctl_conf);
|
||||
if (err < 0) {
|
||||
SNDERR("Invalid CTL %s", name);
|
||||
snd_error(CONTROL, "Invalid CTL %s", name);
|
||||
return err;
|
||||
}
|
||||
if (snd_config_get_string(ctl_conf, &str) >= 0)
|
||||
|
|
|
|||
|
|
@ -87,11 +87,11 @@ int _snd_ctl_empty_open(snd_ctl_t **handlep, const char *name ATTRIBUTE_UNUSED,
|
|||
child = n;
|
||||
continue;
|
||||
}
|
||||
SNDERR("Unknown field %s", id);
|
||||
snd_error(CONTROL, "Unknown field %s", id);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!child) {
|
||||
SNDERR("child is not defined");
|
||||
snd_error(CONTROL, "child is not defined");
|
||||
return -EINVAL;
|
||||
}
|
||||
return _snd_ctl_open_named_child(handlep, name, root, child, mode, conf);
|
||||
|
|
|
|||
|
|
@ -560,7 +560,7 @@ SND_CTL_PLUGIN_DEFINE_FUNC(myctl)
|
|||
....
|
||||
continue;
|
||||
}
|
||||
SNDERR("Unknown field %s", id);
|
||||
snd_error(CONTROL, "Unknown field %s", id);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -712,7 +712,7 @@ int snd_ctl_ext_create(snd_ctl_ext_t *ext, const char *name, int mode)
|
|||
|
||||
if (ext->version < SNDRV_PROTOCOL_VERSION(1, 0, 0) ||
|
||||
ext->version > SND_CTL_EXT_VERSION) {
|
||||
SNDERR("ctl_ext: Plugin version mismatch");
|
||||
snd_error(CONTROL, "ctl_ext: Plugin version mismatch");
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ static int snd_ctl_hw_nonblock(snd_ctl_t *handle, int nonblock)
|
|||
long flags;
|
||||
int fd = hw->fd;
|
||||
if ((flags = fcntl(fd, F_GETFL)) < 0) {
|
||||
SYSERR("F_GETFL failed");
|
||||
snd_errornum(CONTROL, "F_GETFL failed");
|
||||
return -errno;
|
||||
}
|
||||
if (nonblock)
|
||||
|
|
@ -79,7 +79,7 @@ static int snd_ctl_hw_nonblock(snd_ctl_t *handle, int nonblock)
|
|||
else
|
||||
flags &= ~O_NONBLOCK;
|
||||
if (fcntl(fd, F_SETFL, flags) < 0) {
|
||||
SYSERR("F_SETFL for O_NONBLOCK failed");
|
||||
snd_errornum(CONTROL, "F_SETFL for O_NONBLOCK failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -92,7 +92,7 @@ static int snd_ctl_hw_async(snd_ctl_t *ctl, int sig, pid_t pid)
|
|||
int fd = hw->fd;
|
||||
|
||||
if ((flags = fcntl(fd, F_GETFL)) < 0) {
|
||||
SYSERR("F_GETFL failed");
|
||||
snd_errornum(CONTROL, "F_GETFL failed");
|
||||
return -errno;
|
||||
}
|
||||
if (sig >= 0)
|
||||
|
|
@ -100,17 +100,17 @@ static int snd_ctl_hw_async(snd_ctl_t *ctl, int sig, pid_t pid)
|
|||
else
|
||||
flags &= ~O_ASYNC;
|
||||
if (fcntl(fd, F_SETFL, flags) < 0) {
|
||||
SYSERR("F_SETFL for O_ASYNC failed");
|
||||
snd_errornum(CONTROL, "F_SETFL for O_ASYNC failed");
|
||||
return -errno;
|
||||
}
|
||||
if (sig < 0)
|
||||
return 0;
|
||||
if (fcntl(fd, F_SETSIG, (long)sig) < 0) {
|
||||
SYSERR("F_SETSIG failed");
|
||||
snd_errornum(CONTROL, "F_SETSIG failed");
|
||||
return -errno;
|
||||
}
|
||||
if (fcntl(fd, F_SETOWN, (long)pid) < 0) {
|
||||
SYSERR("F_SETOWN failed");
|
||||
snd_errornum(CONTROL, "F_SETOWN failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -120,7 +120,7 @@ static int snd_ctl_hw_subscribe_events(snd_ctl_t *handle, int subscribe)
|
|||
{
|
||||
snd_ctl_hw_t *hw = handle->private_data;
|
||||
if (ioctl(hw->fd, SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS, &subscribe) < 0) {
|
||||
SYSERR("SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS failed");
|
||||
snd_errornum(CONTROL, "SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -130,7 +130,7 @@ static int snd_ctl_hw_card_info(snd_ctl_t *handle, snd_ctl_card_info_t *info)
|
|||
{
|
||||
snd_ctl_hw_t *hw = handle->private_data;
|
||||
if (ioctl(hw->fd, SNDRV_CTL_IOCTL_CARD_INFO, info) < 0) {
|
||||
SYSERR("SNDRV_CTL_IOCTL_CARD_INFO failed");
|
||||
snd_errornum(CONTROL, "SNDRV_CTL_IOCTL_CARD_INFO failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -375,8 +375,9 @@ static int snd_ctl_hw_read(snd_ctl_t *handle, snd_ctl_event_t *event)
|
|||
if (res <= 0)
|
||||
return -errno;
|
||||
if (CHECK_SANITY(res != sizeof(*event))) {
|
||||
SNDMSG("snd_ctl_hw_read: read size error (req:%d, got:%d)",
|
||||
sizeof(*event), res);
|
||||
snd_check(CONTROL, "snd_ctl_hw_read: read size error (req:%d, got:%d)",
|
||||
sizeof(*event), res);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
return 1;
|
||||
|
|
@ -437,7 +438,7 @@ int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card, int mode)
|
|||
*handle = NULL;
|
||||
|
||||
if (CHECK_SANITY(card < 0 || card >= SND_MAX_CARDS)) {
|
||||
SNDMSG("Invalid card index %d", card);
|
||||
snd_check(CONTROL, "Invalid card index %d", card);
|
||||
return -EINVAL;
|
||||
}
|
||||
sprintf(filename, SNDRV_FILE_CONTROL, card);
|
||||
|
|
|
|||
|
|
@ -1242,27 +1242,27 @@ static int parse_remap(snd_ctl_remap_t *priv, snd_config_t *conf)
|
|||
if (snd_config_get_id(n, &id) < 0)
|
||||
continue;
|
||||
if (snd_config_get_string(n, &str) < 0) {
|
||||
SNDERR("expected string with the target control id!");
|
||||
snd_error(CONTROL, "expected string with the target control id!");
|
||||
return -EINVAL;
|
||||
}
|
||||
snd_ctl_elem_id_clear(&app);
|
||||
err = snd_ctl_ascii_elem_id_parse(&app, str);
|
||||
if (err < 0) {
|
||||
SNDERR("unable to parse target id '%s'!", str);
|
||||
snd_error(CONTROL, "unable to parse target id '%s'!", str);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (remap_find_id_app(priv, &app)) {
|
||||
SNDERR("duplicate target id '%s'!", id);
|
||||
snd_error(CONTROL, "duplicate target id '%s'!", id);
|
||||
return -EINVAL;
|
||||
}
|
||||
snd_ctl_elem_id_clear(&child);
|
||||
err = snd_ctl_ascii_elem_id_parse(&child, id);
|
||||
if (err < 0) {
|
||||
SNDERR("unable to parse source id '%s'!", id);
|
||||
snd_error(CONTROL, "unable to parse source id '%s'!", id);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (remap_find_id_child(priv, &app)) {
|
||||
SNDERR("duplicate source id '%s'!", id);
|
||||
snd_error(CONTROL, "duplicate source id '%s'!", id);
|
||||
return -EINVAL;
|
||||
}
|
||||
err = add_to_remap(priv, &child, &app);
|
||||
|
|
@ -1321,7 +1321,7 @@ static int add_chn_to_map(struct snd_ctl_map_ctl *mctl, long idx, long src_idx,
|
|||
long *map;
|
||||
|
||||
if (src_idx >= mctl->src_channels) {
|
||||
SNDERR("Wrong channel mapping (extra source channel?)");
|
||||
snd_error(CONTROL, "Wrong channel mapping (extra source channel?)");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (mctl->channel_map_alloc <= (size_t)idx) {
|
||||
|
|
@ -1350,7 +1350,7 @@ static int add_chn_to_map_array(struct snd_ctl_map_ctl *mctl, const char *dst_id
|
|||
snd_config_t *n = snd_config_iterator_entry(i);
|
||||
long idx = -1, chn = -1;
|
||||
if (safe_strtol(dst_id, &idx) || snd_config_get_integer(n, &chn)) {
|
||||
SNDERR("Wrong channel mapping (%ld -> %ld)", idx, chn);
|
||||
snd_error(CONTROL, "Wrong channel mapping (%ld -> %ld)", idx, chn);
|
||||
return -EINVAL;
|
||||
}
|
||||
err = add_chn_to_map(mctl, idx, src_idx, chn);
|
||||
|
|
@ -1383,7 +1383,7 @@ static int parse_map_vindex(struct snd_ctl_map_ctl *mctl, snd_config_t *conf)
|
|||
err = add_chn_to_map_array(mctl, id, n);
|
||||
} else {
|
||||
if (safe_strtol(id, &idx) || snd_config_get_integer(n, &chn)) {
|
||||
SNDERR("Wrong channel mapping (%ld -> %ld)", idx, chn);
|
||||
snd_error(CONTROL, "Wrong channel mapping (%ld -> %ld)", idx, chn);
|
||||
return -EINVAL;
|
||||
}
|
||||
err = add_chn_to_map(mctl, idx, 0, chn);
|
||||
|
|
@ -1430,7 +1430,7 @@ static int parse_map1(snd_ctl_map_t *map, snd_config_t *conf)
|
|||
snd_ctl_elem_id_clear(&cid);
|
||||
err = snd_ctl_ascii_elem_id_parse(&cid, id);
|
||||
if (err < 0) {
|
||||
SNDERR("unable to parse control id '%s'!", id);
|
||||
snd_error(CONTROL, "unable to parse control id '%s'!", id);
|
||||
return -EINVAL;
|
||||
}
|
||||
err = add_ctl_to_map(map, &mctl, &cid);
|
||||
|
|
@ -1461,7 +1461,7 @@ static int parse_map(snd_ctl_remap_t *priv, snd_config_t *conf)
|
|||
snd_ctl_elem_id_clear(&eid);
|
||||
err = snd_ctl_ascii_elem_id_parse(&eid, id);
|
||||
if (err < 0) {
|
||||
SNDERR("unable to parse id '%s'!", id);
|
||||
snd_error(CONTROL, "unable to parse id '%s'!", id);
|
||||
return -EINVAL;
|
||||
}
|
||||
err = new_map(priv, &map, &eid);
|
||||
|
|
@ -1508,14 +1508,14 @@ static int parse_sync1(snd_ctl_remap_t *priv, unsigned int count, snd_config_t *
|
|||
snd_config_for_each(i, next, conf) {
|
||||
snd_config_t *n = snd_config_iterator_entry(i);
|
||||
if (snd_config_get_string(n, &str) < 0) {
|
||||
SNDERR("strings are expected in sync array");
|
||||
snd_error(CONTROL, "strings are expected in sync array");
|
||||
return -EINVAL;
|
||||
}
|
||||
eid = &sync->control_ids[index];
|
||||
snd_ctl_elem_id_clear(eid);
|
||||
err = snd_ctl_ascii_elem_id_parse(eid, str);
|
||||
if (err < 0) {
|
||||
SNDERR("unable to parse control id '%s'!", str);
|
||||
snd_error(CONTROL, "unable to parse control id '%s'!", str);
|
||||
return -EINVAL;
|
||||
}
|
||||
sync->control_items++;
|
||||
|
|
@ -1542,12 +1542,12 @@ static int parse_sync_compound(snd_ctl_remap_t *priv, snd_config_t *conf)
|
|||
continue;
|
||||
if (strcmp(id, "switch") == 0) {
|
||||
if (snd_config_get_string(n, &str) < 0) {
|
||||
SNDERR("String is expected for switch");
|
||||
snd_error(CONTROL, "String is expected for switch");
|
||||
return -EINVAL;
|
||||
}
|
||||
err = snd_ctl_ascii_elem_id_parse(&eid, str);
|
||||
if (err < 0) {
|
||||
SNDERR("unable to parse id '%s'!", str);
|
||||
snd_error(CONTROL, "unable to parse id '%s'!", str);
|
||||
return -EINVAL;
|
||||
}
|
||||
eid_found = true;
|
||||
|
|
@ -1555,7 +1555,7 @@ static int parse_sync_compound(snd_ctl_remap_t *priv, snd_config_t *conf)
|
|||
if (strcmp(id, "controls") == 0) {
|
||||
count = snd_config_is_array(n);
|
||||
if (count <= 0) {
|
||||
SNDERR("Array is expected for sync!");
|
||||
snd_error(CONTROL, "Array is expected for sync!");
|
||||
return -EINVAL;
|
||||
}
|
||||
err = parse_sync1(priv, count, n);
|
||||
|
|
@ -1591,7 +1591,7 @@ static int parse_sync(snd_ctl_remap_t *priv, snd_config_t *conf)
|
|||
} else {
|
||||
count = snd_config_is_array(n);
|
||||
if (count <= 0) {
|
||||
SNDERR("Array is expected for sync!");
|
||||
snd_error(CONTROL, "Array is expected for sync!");
|
||||
return -EINVAL;
|
||||
}
|
||||
err = parse_sync1(priv, count, n);
|
||||
|
|
@ -1817,11 +1817,11 @@ int _snd_ctl_remap_open(snd_ctl_t **handlep, char *name, snd_config_t *root, snd
|
|||
child = n;
|
||||
continue;
|
||||
}
|
||||
SNDERR("Unknown field %s", id);
|
||||
snd_error(CONTROL, "Unknown field %s", id);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!child) {
|
||||
SNDERR("child is not defined");
|
||||
snd_error(CONTROL, "child is not defined");
|
||||
return -EINVAL;
|
||||
}
|
||||
err = _snd_ctl_open_child(&cctl, root, child, mode, conf);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ static int snd_ctl_shm_action(snd_ctl_t *ctl)
|
|||
if (err != 1)
|
||||
return -EBADFD;
|
||||
if (ctrl->cmd) {
|
||||
SNDERR("Server has not done the cmd");
|
||||
snd_error(CONTROL, "Server has not done the cmd");
|
||||
return -EBADFD;
|
||||
}
|
||||
return ctrl->result;
|
||||
|
|
@ -79,7 +79,7 @@ static int snd_ctl_shm_action_fd(snd_ctl_t *ctl, int *fd)
|
|||
if (err != 1)
|
||||
return -EBADFD;
|
||||
if (ctrl->cmd) {
|
||||
SNDERR("Server has not done the cmd");
|
||||
snd_error(CONTROL, "Server has not done the cmd");
|
||||
return -EBADFD;
|
||||
}
|
||||
return ctrl->result;
|
||||
|
|
@ -448,7 +448,7 @@ int snd_ctl_shm_open(snd_ctl_t **handlep, const char *name, const char *sockname
|
|||
|
||||
result = make_local_socket(sockname);
|
||||
if (result < 0) {
|
||||
SNDERR("server for socket %s is not running", sockname);
|
||||
snd_error(CONTROL, "server for socket %s is not running", sockname);
|
||||
goto _err;
|
||||
}
|
||||
sock = result;
|
||||
|
|
@ -463,23 +463,23 @@ int snd_ctl_shm_open(snd_ctl_t **handlep, const char *name, const char *sockname
|
|||
req->namelen = snamelen;
|
||||
err = write(sock, req, reqlen);
|
||||
if (err < 0) {
|
||||
SNDERR("write error");
|
||||
snd_error(CONTROL, "write error");
|
||||
result = -errno;
|
||||
goto _err;
|
||||
}
|
||||
if ((size_t) err != reqlen) {
|
||||
SNDERR("write size error");
|
||||
snd_error(CONTROL, "write size error");
|
||||
result = -EINVAL;
|
||||
goto _err;
|
||||
}
|
||||
err = read(sock, &ans, sizeof(ans));
|
||||
if (err < 0) {
|
||||
SNDERR("read error");
|
||||
snd_error(CONTROL, "read error");
|
||||
result = -errno;
|
||||
goto _err;
|
||||
}
|
||||
if (err != sizeof(ans)) {
|
||||
SNDERR("read size error");
|
||||
snd_error(CONTROL, "read size error");
|
||||
result = -EINVAL;
|
||||
goto _err;
|
||||
}
|
||||
|
|
@ -546,7 +546,7 @@ int _snd_ctl_shm_open(snd_ctl_t **handlep, char *name, snd_config_t *root, snd_c
|
|||
if (strcmp(id, "server") == 0) {
|
||||
err = snd_config_get_string(n, &server);
|
||||
if (err < 0) {
|
||||
SNDERR("Invalid type for %s", id);
|
||||
snd_error(CONTROL, "Invalid type for %s", id);
|
||||
return -EINVAL;
|
||||
}
|
||||
continue;
|
||||
|
|
@ -554,29 +554,29 @@ int _snd_ctl_shm_open(snd_ctl_t **handlep, char *name, snd_config_t *root, snd_c
|
|||
if (strcmp(id, "ctl") == 0) {
|
||||
err = snd_config_get_string(n, &ctl_name);
|
||||
if (err < 0) {
|
||||
SNDERR("Invalid type for %s", id);
|
||||
snd_error(CONTROL, "Invalid type for %s", id);
|
||||
return -EINVAL;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
SNDERR("Unknown field %s", id);
|
||||
snd_error(CONTROL, "Unknown field %s", id);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!ctl_name) {
|
||||
SNDERR("ctl is not defined");
|
||||
snd_error(CONTROL, "ctl is not defined");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!server) {
|
||||
SNDERR("server is not defined");
|
||||
snd_error(CONTROL, "server is not defined");
|
||||
return -EINVAL;
|
||||
}
|
||||
err = snd_config_search_definition(root, "server", server, &sconfig);
|
||||
if (err < 0) {
|
||||
SNDERR("Unknown server %s", server);
|
||||
snd_error(CONTROL, "Unknown server %s", server);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (snd_config_get_type(sconfig) != SND_CONFIG_TYPE_COMPOUND) {
|
||||
SNDERR("Invalid type for server %s definition", server);
|
||||
snd_error(CONTROL, "Invalid type for server %s definition", server);
|
||||
err = -EINVAL;
|
||||
goto _err;
|
||||
}
|
||||
|
|
@ -592,7 +592,7 @@ int _snd_ctl_shm_open(snd_ctl_t **handlep, char *name, snd_config_t *root, snd_c
|
|||
if (strcmp(id, "socket") == 0) {
|
||||
err = snd_config_get_string(n, &sockname);
|
||||
if (err < 0) {
|
||||
SNDERR("Invalid type for %s", id);
|
||||
snd_error(CONTROL, "Invalid type for %s", id);
|
||||
goto _err;
|
||||
}
|
||||
continue;
|
||||
|
|
@ -600,18 +600,18 @@ int _snd_ctl_shm_open(snd_ctl_t **handlep, char *name, snd_config_t *root, snd_c
|
|||
if (strcmp(id, "port") == 0) {
|
||||
err = snd_config_get_integer(n, &port);
|
||||
if (err < 0) {
|
||||
SNDERR("Invalid type for %s", id);
|
||||
snd_error(CONTROL, "Invalid type for %s", id);
|
||||
goto _err;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
SNDERR("Unknown field %s", id);
|
||||
snd_error(CONTROL, "Unknown field %s", id);
|
||||
err = -EINVAL;
|
||||
goto _err;
|
||||
}
|
||||
|
||||
if (!sockname) {
|
||||
SNDERR("socket is not defined");
|
||||
snd_error(CONTROL, "socket is not defined");
|
||||
goto _err;
|
||||
}
|
||||
err = snd_ctl_shm_open(handlep, name, sockname, ctl_name, mode);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ int __snd_pcm_info_eld_fixup(snd_pcm_info_t * info)
|
|||
|
||||
ret = snd_ctl_hw_open(&ctl, NULL, info->card, 0);
|
||||
if (ret < 0) {
|
||||
SYSMSG("Cannot open the associated CTL");
|
||||
snd_checknum(CONTROL, "Cannot open the associated CTL");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ int __snd_pcm_info_eld_fixup(snd_pcm_info_t * info)
|
|||
if (ret == -ENOENT || cinfo.type != SND_CTL_ELEM_TYPE_BYTES || cinfo.count == 0)
|
||||
return 0;
|
||||
if (ret < 0) {
|
||||
SYSMSG("Cannot read ELD");
|
||||
snd_checknum(CONTROL, "Cannot read ELD");
|
||||
return ret;
|
||||
}
|
||||
/* decode connected HDMI device name */
|
||||
|
|
@ -78,7 +78,7 @@ int __snd_pcm_info_eld_fixup(snd_pcm_info_t * info)
|
|||
/* no monitor name detected */
|
||||
goto __present;
|
||||
if (l > 16 || 20 + l > cinfo.count) {
|
||||
SNDERR("ELD decode failed, using old HDMI output names");
|
||||
snd_error(CONTROL, "ELD decode failed, using old HDMI output names");
|
||||
return 0;
|
||||
}
|
||||
s = alloca(l + 1);
|
||||
|
|
|
|||
|
|
@ -680,7 +680,7 @@ int snd_hctl_wait(snd_hctl_t *hctl, int timeout)
|
|||
|
||||
npfds = snd_hctl_poll_descriptors_count(hctl);
|
||||
if (npfds <= 0 || npfds >= 16) {
|
||||
SNDERR("Invalid poll_fds %d", npfds);
|
||||
snd_error(CONTROL, "Invalid poll_fds %d", npfds);
|
||||
return -EIO;
|
||||
}
|
||||
pfd = alloca(sizeof(*pfd) * npfds);
|
||||
|
|
@ -689,7 +689,7 @@ int snd_hctl_wait(snd_hctl_t *hctl, int timeout)
|
|||
if (err < 0)
|
||||
return err;
|
||||
if (err != npfds) {
|
||||
SNDMSG("invalid poll descriptors %d", err);
|
||||
snd_check(CONTROL, "invalid poll descriptors %d", err);
|
||||
return -EIO;
|
||||
}
|
||||
do {
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ static int try_config(snd_config_t *config,
|
|||
strcmp(str, "hw") == 0) {
|
||||
if (snd_config_search(cfg1, "device", &cfg) >= 0) {
|
||||
if (snd_config_get_integer(cfg, &dev) < 0) {
|
||||
SNDERR("(%s) device must be an integer", buf);
|
||||
snd_error(CONTROL, "(%s) device must be an integer", buf);
|
||||
err = -EINVAL;
|
||||
goto __cleanup;
|
||||
}
|
||||
|
|
@ -309,7 +309,7 @@ static int try_config(snd_config_t *config,
|
|||
|
||||
if (snd_config_search(cfg1, "hint", &cfg) >= 0) {
|
||||
if (snd_config_get_type(cfg) != SND_CONFIG_TYPE_COMPOUND) {
|
||||
SNDERR("hint (%s) must be a compound", buf);
|
||||
snd_error(CONTROL, "hint (%s) must be a compound", buf);
|
||||
err = -EINVAL;
|
||||
goto __cleanup;
|
||||
}
|
||||
|
|
@ -332,7 +332,7 @@ static int try_config(snd_config_t *config,
|
|||
}
|
||||
if (snd_config_search(cfg, "device", &n) >= 0) {
|
||||
if (snd_config_get_integer(n, &dev) < 0) {
|
||||
SNDERR("(%s) device must be an integer", buf);
|
||||
snd_error(CONTROL, "(%s) device must be an integer", buf);
|
||||
err = -EINVAL;
|
||||
goto __cleanup;
|
||||
}
|
||||
|
|
@ -341,7 +341,7 @@ static int try_config(snd_config_t *config,
|
|||
}
|
||||
if (snd_config_search(cfg, "device_input", &n) >= 0) {
|
||||
if (snd_config_get_integer(n, &list->device_input) < 0) {
|
||||
SNDERR("(%s) device_input must be an integer", buf);
|
||||
snd_error(CONTROL, "(%s) device_input must be an integer", buf);
|
||||
err = -EINVAL;
|
||||
goto __cleanup;
|
||||
}
|
||||
|
|
@ -351,7 +351,7 @@ static int try_config(snd_config_t *config,
|
|||
}
|
||||
if (snd_config_search(cfg, "device_output", &n) >= 0) {
|
||||
if (snd_config_get_integer(n, &list->device_output) < 0) {
|
||||
SNDERR("(%s) device_output must be an integer", buf);
|
||||
snd_error(CONTROL, "(%s) device_output must be an integer", buf);
|
||||
err = -EINVAL;
|
||||
goto __cleanup;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,13 +93,13 @@ int snd_sctl_install(snd_sctl_t *h)
|
|||
if (elem->lock) {
|
||||
err = snd_ctl_elem_lock(h->ctl, elem->id);
|
||||
if (err < 0) {
|
||||
SNDERR("Cannot lock ctl elem");
|
||||
snd_error(CONTROL, "Cannot lock ctl elem");
|
||||
return err;
|
||||
}
|
||||
}
|
||||
err = snd_ctl_elem_read(h->ctl, elem->old);
|
||||
if (err < 0) {
|
||||
SNDERR("Cannot read ctl elem");
|
||||
snd_error(CONTROL, "Cannot read ctl elem");
|
||||
return err;
|
||||
}
|
||||
count = snd_ctl_elem_info_get_count(elem->info);
|
||||
|
|
@ -166,7 +166,7 @@ int snd_sctl_install(snd_sctl_t *h)
|
|||
}
|
||||
err = snd_ctl_elem_write(h->ctl, elem->val);
|
||||
if (err < 0) {
|
||||
SNDERR("Cannot write ctl elem");
|
||||
snd_error(CONTROL, "Cannot write ctl elem");
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
|
@ -188,7 +188,7 @@ int snd_sctl_remove(snd_sctl_t *h)
|
|||
if (elem->lock) {
|
||||
err = snd_ctl_elem_unlock(h->ctl, elem->id);
|
||||
if (err < 0) {
|
||||
SNDERR("Cannot unlock ctl elem");
|
||||
snd_error(CONTROL, "Cannot unlock ctl elem");
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
|
@ -205,7 +205,7 @@ int snd_sctl_remove(snd_sctl_t *h)
|
|||
if (elem->preserve && snd_ctl_elem_value_compare(elem->val, elem->old)) {
|
||||
err = snd_ctl_elem_write(h->ctl, elem->old);
|
||||
if (err < 0) {
|
||||
SNDERR("Cannot restore ctl elem");
|
||||
snd_error(CONTROL, "Cannot restore ctl elem");
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
|
@ -235,7 +235,7 @@ static int snd_config_get_ctl_elem_enumerated(snd_config_t *n, snd_ctl_t *ctl,
|
|||
snd_ctl_elem_info_set_item(info, idx);
|
||||
err = snd_ctl_elem_info(ctl, info);
|
||||
if (err < 0) {
|
||||
SNDERR("Cannot obtain info for CTL elem");
|
||||
snd_error(CONTROL, "Cannot obtain info for CTL elem");
|
||||
return err;
|
||||
}
|
||||
if (strcmp(str, snd_ctl_elem_info_get_item_name(info)) == 0)
|
||||
|
|
@ -293,7 +293,7 @@ static int snd_config_get_ctl_elem_value(snd_config_t *conf,
|
|||
case SND_CTL_ELEM_TYPE_IEC958:
|
||||
break;
|
||||
default:
|
||||
SNDERR("Unknown control type: %d", type);
|
||||
snd_error(CONTROL, "Unknown control type: %d", type);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
|
@ -311,7 +311,7 @@ static int snd_config_get_ctl_elem_value(snd_config_t *conf,
|
|||
unsigned int idx = 0;
|
||||
if (len % 2 != 0 || len > count * 2) {
|
||||
_bad_content:
|
||||
SNDERR("bad value content");
|
||||
snd_error(CONTROL, "bad value content");
|
||||
return -EINVAL;
|
||||
}
|
||||
while (*buf) {
|
||||
|
|
@ -340,7 +340,7 @@ static int snd_config_get_ctl_elem_value(snd_config_t *conf,
|
|||
break;
|
||||
}
|
||||
if (snd_config_get_type(conf) != SND_CONFIG_TYPE_COMPOUND) {
|
||||
SNDERR("bad value type");
|
||||
snd_error(CONTROL, "bad value type");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -351,7 +351,7 @@ static int snd_config_get_ctl_elem_value(snd_config_t *conf,
|
|||
continue;
|
||||
err = safe_strtol(id, &idx);
|
||||
if (err < 0 || idx < 0 || (unsigned int) idx >= count) {
|
||||
SNDERR("bad value index");
|
||||
snd_error(CONTROL, "bad value index");
|
||||
return -EINVAL;
|
||||
}
|
||||
switch (type) {
|
||||
|
|
@ -424,11 +424,11 @@ static int add_elem(snd_sctl_t *h, snd_config_t *_conf, snd_config_t *private_da
|
|||
if (strcmp(id, "iface") == 0 || strcmp(id, "interface") == 0) {
|
||||
const char *ptr;
|
||||
if ((err = snd_config_get_string(n, &ptr)) < 0) {
|
||||
SNDERR("field %s is not a string", id);
|
||||
snd_error(CONTROL, "field %s is not a string", id);
|
||||
goto _err;
|
||||
}
|
||||
if ((err = snd_config_get_ctl_iface_ascii(ptr)) < 0) {
|
||||
SNDERR("Invalid value for '%s'", id);
|
||||
snd_error(CONTROL, "Invalid value for '%s'", id);
|
||||
goto _err;
|
||||
}
|
||||
iface = err;
|
||||
|
|
@ -436,28 +436,28 @@ static int add_elem(snd_sctl_t *h, snd_config_t *_conf, snd_config_t *private_da
|
|||
}
|
||||
if (strcmp(id, "name") == 0) {
|
||||
if ((err = snd_config_get_string(n, &name)) < 0) {
|
||||
SNDERR("field %s is not a string", id);
|
||||
snd_error(CONTROL, "field %s is not a string", id);
|
||||
goto _err;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (strcmp(id, "index") == 0) {
|
||||
if ((err = snd_config_get_integer(n, &index)) < 0) {
|
||||
SNDERR("field %s is not an integer", id);
|
||||
snd_error(CONTROL, "field %s is not an integer", id);
|
||||
goto _err;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (strcmp(id, "device") == 0) {
|
||||
if ((err = snd_config_get_integer(n, &device)) < 0) {
|
||||
SNDERR("field %s is not an integer", id);
|
||||
snd_error(CONTROL, "field %s is not an integer", id);
|
||||
goto _err;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (strcmp(id, "subdevice") == 0) {
|
||||
if ((err = snd_config_get_integer(n, &subdevice)) < 0) {
|
||||
SNDERR("field %s is not an integer", id);
|
||||
snd_error(CONTROL, "field %s is not an integer", id);
|
||||
goto _err;
|
||||
}
|
||||
continue;
|
||||
|
|
@ -498,16 +498,16 @@ static int add_elem(snd_sctl_t *h, snd_config_t *_conf, snd_config_t *private_da
|
|||
skip_rest = err;
|
||||
continue;
|
||||
}
|
||||
SNDERR("Unknown field %s", id);
|
||||
snd_error(CONTROL, "Unknown field %s", id);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (name == NULL) {
|
||||
SNDERR("Missing control name");
|
||||
snd_error(CONTROL, "Missing control name");
|
||||
err = -EINVAL;
|
||||
goto _err;
|
||||
}
|
||||
if (value == NULL) {
|
||||
SNDERR("Missing control value");
|
||||
snd_error(CONTROL, "Missing control value");
|
||||
err = -EINVAL;
|
||||
goto _err;
|
||||
}
|
||||
|
|
@ -544,7 +544,7 @@ static int add_elem(snd_sctl_t *h, snd_config_t *_conf, snd_config_t *private_da
|
|||
err = snd_ctl_elem_info(h->ctl, elem->info);
|
||||
if (err < 0) {
|
||||
if (! optional)
|
||||
SNDERR("Cannot obtain info for CTL elem (%s,'%s',%li,%li,%li): %s", snd_ctl_elem_iface_name(iface), name, index, device, subdevice, snd_strerror(err));
|
||||
snd_error(CONTROL, "Cannot obtain info for CTL elem (%s,'%s',%li,%li,%li): %s", snd_ctl_elem_iface_name(iface), name, index, device, subdevice, snd_strerror(err));
|
||||
goto _err;
|
||||
} else {
|
||||
if (skip_rest)
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ int snd_tlv_parse_dB_info(unsigned int *tlv,
|
|||
/* Validate that it is possible to read the type and size
|
||||
* without reading past the end of the buffer. */
|
||||
if (tlv_size < MIN_TLV_STREAM_LEN) {
|
||||
SNDERR("TLV stream too short");
|
||||
snd_error(CONTROL, "TLV stream too short");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ int snd_tlv_parse_dB_info(unsigned int *tlv,
|
|||
size = tlv[SNDRV_CTL_TLVO_LEN];
|
||||
tlv_size -= 2 * sizeof(int);
|
||||
if (size > tlv_size) {
|
||||
SNDERR("TLV size error");
|
||||
snd_error(CONTROL, "TLV size error");
|
||||
return -EINVAL;
|
||||
}
|
||||
switch (type) {
|
||||
|
|
@ -110,11 +110,11 @@ int snd_tlv_parse_dB_info(unsigned int *tlv,
|
|||
else
|
||||
minsize = 2 * sizeof(int);
|
||||
if (size < minsize) {
|
||||
SNDERR("Invalid dB_scale TLV size");
|
||||
snd_error(CONTROL, "Invalid dB_scale TLV size");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (size > MAX_TLV_RANGE_SIZE) {
|
||||
SNDERR("Too big dB_scale TLV size: %d", size);
|
||||
snd_error(CONTROL, "Too big dB_scale TLV size: %d", size);
|
||||
return -EINVAL;
|
||||
}
|
||||
*db_tlvp = tlv;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue