summaryrefslogtreecommitdiffstats
path: root/plugins/audio/audio-alsa.c
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2015-12-21 16:35:09 +0100
committerFulup Ar Foll <fulup@iot.bzh>2015-12-21 16:35:09 +0100
commite76dff6729fb9acd1638019507e7edbbd8af23f5 (patch)
treea7c3b0e35b3ac516bbaadf7f5448a0a9799c312f /plugins/audio/audio-alsa.c
parent5472e85501418302959040eacb819c57f849d63e (diff)
parent5bad34ac9278831eb65499c8aa887116aafa33b2 (diff)
Merge origin/master
Diffstat (limited to 'plugins/audio/audio-alsa.c')
-rw-r--r--plugins/audio/audio-alsa.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/audio/audio-alsa.c b/plugins/audio/audio-alsa.c
index 4ee48045..8e56e52d 100644
--- a/plugins/audio/audio-alsa.c
+++ b/plugins/audio/audio-alsa.c
@@ -58,6 +58,19 @@ PUBLIC unsigned char _alsa_init (const char *name, audioCtxHandleT *ctx) {
snd_mixer_selem_id_set_name (mixer_sid, "Master");
mixer_elm = snd_mixer_find_selem (mixer, mixer_sid);
+ if (!mixer_elm) {
+ /* no "Master" mixer ; we are probably on a board... search ! */
+ for (mixer_elm = snd_mixer_first_elem (mixer); mixer_elm != NULL;
+ mixer_elm = snd_mixer_elem_next (mixer_elm)) {
+ if (snd_mixer_elem_info (mixer_elm) < 0)
+ continue;
+ snd_mixer_selem_get_id (mixer_elm, mixer_sid);
+ if (strstr (snd_mixer_selem_id_get_name (mixer_sid), "Master") ||
+ strstr (snd_mixer_selem_id_get_name (mixer_sid), "Playback"))
+ break;
+ }
+ }
+
if (mixer_elm) {
snd_mixer_selem_get_playback_volume_range (mixer_elm, &vol_min, &vol_max);
snd_mixer_selem_get_playback_volume (mixer_elm, SND_MIXER_SCHN_FRONT_LEFT, &vol);