From 4cfefef8cd6d8861c6094d87aaa1903a326d53d600edf404cc0f6bf7a2f21987 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 17 Sep 2007 15:07:16 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/alsa-utils?expand=0&rev=7 --- alsa-utils-alsamixer-capture-enum-fix.diff | 99 ++++++++++++++++++++++ alsa-utils.changes | 5 ++ alsa-utils.spec | 10 ++- 3 files changed, 111 insertions(+), 3 deletions(-) create mode 100644 alsa-utils-alsamixer-capture-enum-fix.diff diff --git a/alsa-utils-alsamixer-capture-enum-fix.diff b/alsa-utils-alsamixer-capture-enum-fix.diff new file mode 100644 index 0000000..5874eba --- /dev/null +++ b/alsa-utils-alsamixer-capture-enum-fix.diff @@ -0,0 +1,99 @@ +# HG changeset patch +# User tiwai +# Date 1188391795 -7200 +# Node ID 803dbe88476f8a1065ce85d9efe7f61df71cf32f +# Parent b230fef1ea76192e8cfaba252beaaca369ab085b +alsamixer - Handle capture enums separately + +The capture enum controls should appear only in capture and all views. +This is a fix for Input Source enum controls. + +diff -r b230fef1ea76 -r 803dbe88476f alsamixer/alsamixer.c +--- a/alsamixer/alsamixer.c Wed Aug 15 15:38:01 2007 +0200 ++++ b/alsamixer/alsamixer.c Wed Aug 29 14:49:55 2007 +0200 +@@ -210,7 +210,7 @@ enum { + MIXER_ELEM_FRONT, MIXER_ELEM_REAR, + MIXER_ELEM_CENTER, MIXER_ELEM_WOOFER, + MIXER_ELEM_CAPTURE, +- MIXER_ELEM_ENUM, ++ MIXER_ELEM_ENUM, MIXER_ELEM_CAPTURE_ENUM, + MIXER_ELEM_END + }; + +@@ -702,7 +702,7 @@ mixer_write_cbar (int elem_index) + + /* enum list + */ +- if (type == MIXER_ELEM_ENUM) { ++ if (type == MIXER_ELEM_ENUM || type == MIXER_ELEM_CAPTURE_ENUM) { + if (mixer_volume_delta[MIXER_CHN_LEFT]) + update_enum_list(elem, MIXER_CHN_LEFT, mixer_volume_delta[MIXER_CHN_LEFT]); + if (mixer_volume_delta[MIXER_CHN_RIGHT]) +@@ -983,7 +983,7 @@ mixer_update_cbar (int elem_index) + snd_mixer_selem_get_playback_switch(elem, chn_right, &swr); + extra_info = !swl && !swr ? " [Off]" : ""; + } +- if (type == MIXER_ELEM_ENUM) { ++ if (type == MIXER_ELEM_ENUM || type == MIXER_ELEM_CAPTURE_ENUM) { + /* FIXME: should show the item names of secondary and later channels... */ + unsigned int eidx, length; + tmp[0]=' '; +@@ -1049,7 +1049,7 @@ mixer_update_cbar (int elem_index) + y--; + + /* enum list? */ +- if (type == MIXER_ELEM_ENUM) { ++ if (type == MIXER_ELEM_ENUM || type == MIXER_ELEM_CAPTURE_ENUM) { + display_enum_list(elem, y, x); + return; /* no more to display */ + } +@@ -1752,7 +1752,7 @@ __again: + if (elem == NULL) + CHECK_ABORT (ERR_FCN, "snd_mixer_find_selem()", -EINVAL); + if ( (mixer_view == VIEW_PLAYBACK) || (mixer_view == VIEW_CHANNELS) ) { +- for (i = 0; i < MIXER_ELEM_CAPTURE; i++) { ++ for (i = MIXER_ELEM_FRONT; i <= MIXER_ELEM_WOOFER; i++) { + int ok; + for (j = ok = 0; j < 2; j++) { + if (mixer_changed_state) +@@ -1764,6 +1764,9 @@ __again: + sid = (snd_mixer_selem_id_t *)(((char *)mixer_sid) + snd_mixer_selem_id_sizeof() * idx); + mixer_grpidx[elem_index] = idx; + if (snd_mixer_selem_is_enumerated(elem)) { ++ if (mixer_view == VIEW_PLAYBACK && ++ snd_mixer_selem_is_enum_capture(elem)) ++ continue; + mixer_type[elem_index] = MIXER_ELEM_ENUM; + } else { + mixer_type[elem_index] = i; +@@ -1795,15 +1798,23 @@ __again: + (nelems_added == 0 && snd_mixer_selem_has_capture_switch(elem)) && + (mixer_view == VIEW_CAPTURE || !snd_mixer_selem_has_common_switch(elem))) + do_add = 1; ++ if (!do_add && ++ mixer_view == VIEW_CAPTURE && snd_mixer_selem_is_enum_capture(elem)) ++ do_add = 1; ++ + if (do_add) { + mixer_grpidx[elem_index] = idx; +- mixer_type[elem_index] = MIXER_ELEM_CAPTURE; +- if (nelems_added == 0 && snd_mixer_selem_has_capture_switch(elem)) +- mixer_type[elem_index] |= MIXER_ELEM_CAPTURE_SWITCH; +- if (nelems_added) +- mixer_type[elem_index] |= MIXER_ELEM_CAPTURE_SUFFIX; +- if (snd_mixer_selem_has_capture_volume(elem)) +- mixer_type[elem_index] |= MIXER_ELEM_HAS_VOLUME; ++ if (snd_mixer_selem_is_enum_capture(elem)) ++ mixer_type[elem_index] = MIXER_ELEM_CAPTURE_ENUM; ++ else { ++ mixer_type[elem_index] = MIXER_ELEM_CAPTURE; ++ if (nelems_added == 0 && snd_mixer_selem_has_capture_switch(elem)) ++ mixer_type[elem_index] |= MIXER_ELEM_CAPTURE_SWITCH; ++ if (nelems_added) ++ mixer_type[elem_index] |= MIXER_ELEM_CAPTURE_SUFFIX; ++ if (snd_mixer_selem_has_capture_volume(elem)) ++ mixer_type[elem_index] |= MIXER_ELEM_HAS_VOLUME; ++ } + elem_index++; + if (elem_index >= mixer_n_elems) + break; diff --git a/alsa-utils.changes b/alsa-utils.changes index 7f8d7dd..893977e 100644 --- a/alsa-utils.changes +++ b/alsa-utils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Sep 17 16:13:15 CEST 2007 - tiwai@suse.de + +- fix the handling of capture enum elements in alsamixer (#325677) + ------------------------------------------------------------------- Tue Aug 14 16:31:30 CEST 2007 - tiwai@suse.de diff --git a/alsa-utils.spec b/alsa-utils.spec index 859dfa2..b87dc46 100644 --- a/alsa-utils.spec +++ b/alsa-utils.spec @@ -17,13 +17,14 @@ License: GPL v2 or later Group: Productivity/Multimedia/Sound/Players Provides: alsa-conf Requires: dialog pciutils -Autoreqprov: on +AutoReqProv: on Summary: Advanced Linux Sound Architecture Utilities Version: 1.0.14 -Release: 17 +Release: 24 Source: ftp://ftp.alsa-project.org/pub/util/alsa-utils-%{package_version}.tar.bz2 Patch: alsa-utils-hg-fixes.diff -URL: http://www.alsa-project.org/ +Patch1: alsa-utils-alsamixer-capture-enum-fix.diff +Url: http://www.alsa-project.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -40,6 +41,7 @@ Authors: %prep %setup -q -n %{name}-%{package_version} %patch -p1 +%patch1 -p1 mv alsamixer/README alsamixer/README-alsamixer %{?suse_update_config:%{suse_update_config -f .}} @@ -69,6 +71,8 @@ make DESTDIR=$RPM_BUILD_ROOT install %{_datadir}/alsa %changelog +* Mon Sep 17 2007 - tiwai@suse.de +- fix the handling of capture enum elements in alsamixer (#325677) * Tue Aug 14 2007 - tiwai@suse.de - amixer - Allow to pass enum item string for cset, too - aplay - Include missing time.h for time()