diff options
author | Fulup Ar Foll <fulup@iot.bzh> | 2015-12-21 16:35:09 +0100 |
---|---|---|
committer | Fulup Ar Foll <fulup@iot.bzh> | 2015-12-21 16:35:09 +0100 |
commit | e76dff6729fb9acd1638019507e7edbbd8af23f5 (patch) | |
tree | a7c3b0e35b3ac516bbaadf7f5448a0a9799c312f /plugins/audio | |
parent | 5472e85501418302959040eacb819c57f849d63e (diff) | |
parent | 5bad34ac9278831eb65499c8aa887116aafa33b2 (diff) |
Merge origin/master
Diffstat (limited to 'plugins/audio')
-rw-r--r-- | plugins/audio/CMakeLists.txt | 4 | ||||
-rw-r--r-- | plugins/audio/audio-alsa.c | 13 |
2 files changed, 15 insertions, 2 deletions
diff --git a/plugins/audio/CMakeLists.txt b/plugins/audio/CMakeLists.txt index b5adc643..7fa1f75f 100644 --- a/plugins/audio/CMakeLists.txt +++ b/plugins/audio/CMakeLists.txt @@ -1,9 +1,9 @@ IF(alsa_FOUND) - INCLUDE_DIRECTORIES(${include_dirs}) - ADD_LIBRARY(audio-api MODULE audio-api.c audio-alsa.c) SET_TARGET_PROPERTIES(audio-api PROPERTIES PREFIX "") + TARGET_LINK_LIBRARIES(audio-api ${link_libraries}) + INCLUDE_DIRECTORIES(${include_dirs}) INSTALL(TARGETS audio-api LIBRARY DESTINATION ${plugin_install_dir}) 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); |