Skip to content

Commit

Permalink
mixer: simple: Support dB TLVs for CTL_SINGLE controls
Browse files Browse the repository at this point in the history
dB mappings do not work for controls not named "* Volume", since we do not
fall back to CTL_SINGLE in get_selem_ctl. Add that branch to make it
work.

Fixes dB ranges for e.g. controls named "* Gain".

Closes: #358
Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
  • Loading branch information
marcan authored and perexg committed Nov 7, 2023
1 parent 915a71a commit f202ec3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/mixer/simple_none.c
Original file line number Diff line number Diff line change
Expand Up @@ -1155,11 +1155,12 @@ static selem_ctl_t *get_selem_ctl(selem_none_t *s, int dir)
c = &s->ctls[CTL_CAPTURE_VOLUME];
else
return NULL;
if (! c->elem) {
if (! c->elem)
c = &s->ctls[CTL_GLOBAL_VOLUME];
if (! c->elem)
return NULL;
}
if (! c->elem)
c = &s->ctls[CTL_SINGLE];
if (! c->elem)
return NULL;
if (c->type != SND_CTL_ELEM_TYPE_INTEGER)
return NULL;
return c;
Expand Down

0 comments on commit f202ec3

Please sign in to comment.