Hello community,
here is the log from the commit of package alsa for openSUSE:Factory
checked in at Thu May 28 22:53:56 CEST 2009.
--------
--- alsa/alsa.changes 2009-05-06 18:05:53.000000000 +0200
+++ alsa/alsa.changes 2009-05-28 15:39:02.000000000 +0200
@@ -1,0 +2,10 @@
+Thu May 28 15:37:47 CEST 2009 - tiwai@suse.de
+
+- adjust more volumes in set_default_volume script
+
+-------------------------------------------------------------------
+Wed May 20 10:22:40 CEST 2009 - tiwai@suse.de
+
+- extend snd_card_get_index() to accept the device path name
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
New:
----
alsa-lib-git-fixes.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ alsa.spec ++++++
--- /var/tmp/diff_new_pack.Z28628/_old 2009-05-28 22:52:52.000000000 +0200
+++ /var/tmp/diff_new_pack.Z28628/_new 2009-05-28 22:52:52.000000000 +0200
@@ -34,7 +34,7 @@
#
Summary: Advanced Linux Sound Architecture
Version: 1.0.20
-Release: 1
+Release: 2
Source: ftp://ftp.alsa-project.org/pub/lib/alsa-lib-%{package_version}.tar.bz2
Source8: 40-alsa.rules
Source11: alsasound
@@ -50,7 +50,7 @@
Source32: all_notes_off.mid
Source33: alsa-info.sh
Source34: alsa-init.sh
-# Patch: alsa-lib-git-fixes.diff
+Patch: alsa-lib-git-fixes.diff
Url: http://www.alsa-project.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -122,7 +122,7 @@
%prep
%setup -q -n alsa-lib-%{package_version}
-# %patch -p1
+%patch -p1
# hack to fix build on older distros
%if %suse_version < 1100
%ifarch %ix86
@@ -251,6 +251,10 @@
%{_datadir}/alsa
%changelog
+* Thu May 28 2009 tiwai@suse.de
+- adjust more volumes in set_default_volume script
+* Wed May 20 2009 tiwai@suse.de
+- extend snd_card_get_index() to accept the device path name
* Wed May 06 2009 tiwai@suse.de
- updated alsa-lib to version 1.0.20:
* including previous fixes
++++++ alsa-lib-git-fixes.diff ++++++
diff --git a/src/control/cards.c b/src/control/cards.c
index 4d2c739..6208c73 100644
--- a/src/control/cards.c
+++ b/src/control/cards.c
@@ -39,27 +39,40 @@
#define SND_FILE_LOAD ALOAD_DEVICE_DIRECTORY "aloadC%i"
#endif
-static int snd_card_load1(int card)
+static int snd_card_load2(const char *control)
{
int open_dev;
+ snd_ctl_card_info_t info;
+
+ open_dev = snd_open_device(control, O_RDONLY);
+ if (open_dev >= 0) {
+ if (ioctl(open_dev, SNDRV_CTL_IOCTL_CARD_INFO, &info) < 0) {
+ int err = -errno;
+ close(open_dev);
+ return err;
+ }
+ close(open_dev);
+ return info.card;
+ } else {
+ return -errno;
+ }
+}
+
+static int snd_card_load1(int card)
+{
+ int res;
char control[sizeof(SND_FILE_CONTROL) + 10];
sprintf(control, SND_FILE_CONTROL, card);
-
- open_dev = snd_open_device(control, O_RDONLY);
+ res = snd_card_load2(control);
#ifdef SUPPORT_ALOAD
- if (open_dev < 0) {
+ if (res < 0) {
char aload[sizeof(SND_FILE_LOAD) + 10];
sprintf(aload, SND_FILE_LOAD, card);
- open_dev = snd_open_device(aload, O_RDONLY);
+ res = snd_card_load2(aload);
}
#endif
- if (open_dev >= 0) {
- close (open_dev);
- return 0;
- } else {
- return -errno;
- }
+ return res;
}
/**
@@ -107,6 +120,7 @@ int snd_card_next(int *rcard)
*
* The accepted format is an integer value in ASCII representation
* or the card identifier (the id parameter for sound-card drivers).
+ * The control device name like /dev/snd/controlC0 is accepted, too.
*/
int snd_card_get_index(const char *string)
{
@@ -127,6 +141,8 @@ int snd_card_get_index(const char *string)
return card;
return err;
}
+ if (string[0] == '/') /* device name */
+ return snd_card_load2(string);
for (card = 0; card < 32; card++) {
#ifdef SUPPORT_ALOAD
if (! snd_card_load(card))
++++++ set_default_volume ++++++
--- /var/tmp/diff_new_pack.Z28628/_old 2009-05-28 22:52:52.000000000 +0200
+++ /var/tmp/diff_new_pack.Z28628/_new 2009-05-28 22:52:52.000000000 +0200
@@ -23,6 +23,8 @@
*)
card="-D $1";;
esac
+else
+ card="-D hw"
fi
amixer -q -s $card <