conf: namehint - add omit_noargs to the hint section

Do not list simple surround devices in the namehint function by default.

Fixes: https://github.com/alsa-project/alsa-lib/issues/27

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2020-03-01 19:57:06 +01:00
parent 27c7927842
commit 09e78da4ca
7 changed files with 11 additions and 1 deletions

View file

@ -57,5 +57,6 @@ pcm.!surround21 {
hint {
description "2.1 Surround output to Front and Subwoofer speakers"
device_output $DEV
omit_noargs true
}
}

View file

@ -55,5 +55,6 @@ pcm.!surround40 {
hint {
description "4.0 Surround output to Front and Rear speakers"
device_output $DEV
omit_noargs true
}
}

View file

@ -61,5 +61,6 @@ pcm.!surround41 {
hint {
description "4.1 Surround output to Front, Rear and Subwoofer speakers"
device_output $DEV
omit_noargs true
}
}

View file

@ -61,5 +61,6 @@ pcm.!surround50 {
hint {
description "5.0 Surround output to Front, Center and Rear speakers"
device_output $DEV
omit_noargs true
}
}

View file

@ -57,5 +57,6 @@ pcm.!surround51 {
hint {
description "5.1 Surround output to Front, Center, Rear and Subwoofer speakers"
device_output $DEV
omit_noargs true
}
}

View file

@ -59,5 +59,6 @@ pcm.!surround71 {
hint {
description "7.1 Surround output to Front, Center, Side, Rear and Woofer speakers"
device_output $DEV
omit_noargs true
}
}

View file

@ -287,6 +287,10 @@ static int try_config(snd_config_t *config,
err = -EINVAL;
goto __cleanup;
}
if (list->card < 0 &&
snd_config_search(cfg, "omit_noargs", &n) >= 0 &&
snd_config_get_bool(n) > 0)
goto __skip_add;
if (level == 1 &&
snd_config_search(cfg, "show", &n) >= 0 &&
snd_config_get_bool(n) <= 0)