Expose sun mixer master knobs in the top-level group.

This allows the same master knobs to be available no matter
if sndiod is running or net.
This commit is contained in:
Alexandre Ratchov 2020-02-08 15:50:56 +01:00
parent 9bec976a73
commit b62a7eef6f
2 changed files with 4 additions and 5 deletions

View File

@ -224,7 +224,6 @@ scanvol(struct sioctl_sun_hdl *hdl, struct volume *vol)
int i, val;
memset(&desc, 0, sizeof(struct sioctl_desc));
strlcpy(desc.group, "hw", SIOCTL_NAMEMAX);
if (vol->level_idx >= 0) {
ctrl.dev = vol->level_idx;
ctrl.type = AUDIO_MIXER_VALUE;

View File

@ -51,8 +51,7 @@ struct fileops dev_sioctl_ops = {
void
dev_sioctl_ondesc(void *arg, struct sioctl_desc *desc, int val)
{
#define GROUP_PREFIX "dev"
#define GROUP_PREFIX_LEN (sizeof(GROUP_PREFIX))
#define GROUP_PREFIX "hw"
char group_buf[CTL_NAMEMAX], *group;
struct dev *d = arg;
size_t len;
@ -64,13 +63,14 @@ dev_sioctl_ondesc(void *arg, struct sioctl_desc *desc, int val)
dev_rmctl(d, addr);
/*
* prefix group names we use (top-level and "app") with "dev."
* prefix group names we use (top-level and "app") with "hw."
* to ensure that all controls have unique names when multiple
* sndiod's are chained
*/
if (desc->group[0] == 0)
group = GROUP_PREFIX;
else if (strcmp(desc->group, "app") == 0) {
else if (strcmp(desc->group, GROUP_PREFIX) == 0 ||
strcmp(desc->group, "app") == 0) {
group = group_buf;
len = snprintf(group_buf, CTL_NAMEMAX,
GROUP_PREFIX ".%s", desc->group);