Hello community, here is the log from the commit of package alsa for openSUSE:Factory checked in at 2015-01-30 11:00:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/alsa (Old) and /work/SRC/openSUSE:Factory/.alsa.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "alsa" Changes: -------- --- /work/SRC/openSUSE:Factory/alsa/alsa.changes 2014-12-09 09:16:46.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.alsa.new/alsa.changes 2015-01-30 11:00:25.000000000 +0100 @@ -1,0 +2,17 @@ +Wed Jan 28 15:50:35 CET 2015 - ti...@suse.de + +- Backport upstream fixes: new OXFW hwdep definition, chmap print + overflow fix, improvement of UCM parser, GoogleNyan UCM config, + removal of gethostbyname() usages: + 0061-hwdep-add-OXFW-driver-support.patch + 0062-pcm-fix-buffer-overflow-in-snd_pcm_chmap_print.patch + 0063-control-enable-octal-and-hexadecimal-parse.patch + 0064-autotools-fix-ucm-partial-build.patch + 0065-conf-ucm-GoogleNyan-Add-configuration.patch + 0066-ucm-add-binary-configure-file-parse.patch + 0067-Remove-unused-hostname-resolution-in-shm-plugins-and.patch +- Suppress timestamps in the generated documents for make the + package comparison easier: + alsa-docs-suppress-timestamp.patch + +------------------------------------------------------------------- New: ---- 0061-hwdep-add-OXFW-driver-support.patch 0062-pcm-fix-buffer-overflow-in-snd_pcm_chmap_print.patch 0063-control-enable-octal-and-hexadecimal-parse.patch 0064-autotools-fix-ucm-partial-build.patch 0065-conf-ucm-GoogleNyan-Add-configuration.patch 0066-ucm-add-binary-configure-file-parse.patch 0067-Remove-unused-hostname-resolution-in-shm-plugins-and.patch alsa-docs-suppress-timestamp.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ alsa.spec ++++++ --- /var/tmp/diff_new_pack.IHxNLU/_old 2015-01-30 11:00:27.000000000 +0100 +++ /var/tmp/diff_new_pack.IHxNLU/_new 2015-01-30 11:00:27.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package alsa # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -108,8 +108,17 @@ Patch58: 0058-mixer-Fix-unused-parameter-warnings.patch Patch59: 0059-ucm-Fix-uninitialized-err-in-snd_use_case_set.patch Patch60: 0060-pcm-Fix-assorted-tstamp_type-bugs-omissions.patch +Patch61: 0061-hwdep-add-OXFW-driver-support.patch +Patch62: 0062-pcm-fix-buffer-overflow-in-snd_pcm_chmap_print.patch +Patch63: 0063-control-enable-octal-and-hexadecimal-parse.patch +Patch64: 0064-autotools-fix-ucm-partial-build.patch +Patch65: 0065-conf-ucm-GoogleNyan-Add-configuration.patch +Patch66: 0066-ucm-add-binary-configure-file-parse.patch +Patch67: 0067-Remove-unused-hostname-resolution-in-shm-plugins-and.patch # rest suse patches Patch99: alsa-lib-doxygen-avoid-crash-for-11.3.diff +# suppress timestamp in documents +Patch100: alsa-docs-suppress-timestamp.patch BuildRequires: doxygen BuildRequires: libtool BuildRequires: pkg-config @@ -235,9 +244,17 @@ %patch58 -p1 %patch59 -p1 %patch60 -p1 +%patch61 -p1 +%patch62 -p1 +%patch63 -p1 +%patch64 -p1 +%patch65 -p1 +%patch66 -p1 +%patch67 -p1 %if 0%{?suse_version} == 1130 %patch99 -p1 %endif +%patch100 -p1 # hack to fix build on older distros %if 0%{?suse_version} < 1100 %ifarch %{ix86} ++++++ 0061-hwdep-add-OXFW-driver-support.patch ++++++ >From 93b0e9ca85762c2b863434b2617147f806c7e3e3 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto <o-taka...@sakamocchi.jp> Date: Sat, 29 Nov 2014 01:03:34 +0900 Subject: [PATCH] hwdep: add OXFW driver support Linux 3.19 newly support this driver. By hardware dependent interface, userspace applications can get hardware information, lock/unlock kernel streaming and receive lock status event. Signed-off-by: Takashi Sakamoto <o-taka...@sakamocchi.jp> Signed-off-by: Takashi Iwai <ti...@suse.de> --- include/hwdep.h | 3 ++- include/sound/asound.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/hwdep.h b/include/hwdep.h index ad8bb4972818..3d3c31b2f068 100644 --- a/include/hwdep.h +++ b/include/hwdep.h @@ -73,8 +73,9 @@ typedef enum _snd_hwdep_iface { SND_HWDEP_IFACE_FW_DICE, /**< TC DICE FireWire device */ SND_HWDEP_IFACE_FW_FIREWORKS, /**< Echo Audio Fireworks based device */ SND_HWDEP_IFACE_FW_BEBOB, /**< BridgeCo BeBoB based device */ + SND_HWDEP_IFACE_FW_OXFW, /**< Oxford OXFW970/971 based device */ - SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_FW_BEBOB /**< last known hwdep interface */ + SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_FW_OXFW /**< last known hwdep interface */ } snd_hwdep_iface_t; /** open for reading */ diff --git a/include/sound/asound.h b/include/sound/asound.h index 941d32f007dc..1f23cd635957 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h @@ -96,9 +96,10 @@ enum { SNDRV_HWDEP_IFACE_FW_DICE, /* TC DICE FireWire device */ SNDRV_HWDEP_IFACE_FW_FIREWORKS, /* Echo Audio Fireworks based device */ SNDRV_HWDEP_IFACE_FW_BEBOB, /* BridgeCo BeBoB based device */ + SNDRV_HWDEP_IFACE_FW_OXFW, /* Oxford OXFW970/971 based device */ /* Don't forget to change the following: */ - SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_FW_BEBOB + SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_FW_OXFW }; struct snd_hwdep_info { -- 2.2.2 ++++++ 0062-pcm-fix-buffer-overflow-in-snd_pcm_chmap_print.patch ++++++ >From b2ed0aa9f28979f125a9db0548cfd38ac2334775 Mon Sep 17 00:00:00 2001 From: Anssi Hannula <anssi.hann...@iki.fi> Date: Tue, 30 Dec 2014 20:46:11 +0200 Subject: [PATCH] pcm: fix buffer overflow in snd_pcm_chmap_print() The size argument is wrong for one of the snprintf() calls in snd_pcm_chmap_print(), allowing an overflow to happen (the user-provided buffer may be written data up to 2x its actual size). Seen in an user report here: http://trac.kodi.tv/ticket/15641 Signed-off-by: Anssi Hannula <anssi.hann...@iki.fi> Signed-off-by: Takashi Iwai <ti...@suse.de> --- src/pcm/pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c index baa47c73fa4d..e74e02fc568f 100644 --- a/src/pcm/pcm.c +++ b/src/pcm/pcm.c @@ -7621,7 +7621,7 @@ int snd_pcm_chmap_print(const snd_pcm_chmap_t *map, size_t maxlen, char *buf) return -ENOMEM; } if (map->pos[i] & SND_CHMAP_DRIVER_SPEC) - len += snprintf(buf + len, maxlen, "%d", p); + len += snprintf(buf + len, maxlen - len, "%d", p); else { const char *name = chmap_names[p]; if (name) -- 2.2.2 ++++++ 0063-control-enable-octal-and-hexadecimal-parse.patch ++++++ >From f47480af37eebe4b89020449077d731ad25abc76 Mon Sep 17 00:00:00 2001 From: "Lu, Han" <han...@intel.com> Date: Wed, 14 Jan 2015 09:08:30 +0800 Subject: [PATCH] control: enable octal and hexadecimal parse Use zero-base for strtol(), so get_integer() and get_integer64() can parse decimal, octal and hexadecimal data from input string. Signed-off-by: Lu, Han <han...@intel.com> Signed-off-by: Takashi Iwai <ti...@suse.de> --- src/control/ctlparse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/control/ctlparse.c b/src/control/ctlparse.c index 978977dbc3db..8d6c3859bec4 100644 --- a/src/control/ctlparse.c +++ b/src/control/ctlparse.c @@ -59,7 +59,7 @@ static long get_integer(const char **ptr, long min, long max) goto out; s = p; - val = strtol(s, &p, 10); + val = strtol(s, &p, 0); if (*p == '.') { p++; strtol(p, &p, 10); @@ -87,7 +87,7 @@ static long long get_integer64(const char **ptr, long long min, long long max) goto out; s = p; - val = strtol(s, &p, 10); + val = strtol(s, &p, 0); if (*p == '.') { p++; strtol(p, &p, 10); -- 2.2.2 ++++++ 0064-autotools-fix-ucm-partial-build.patch ++++++ >From 187ba1d8cde0f866d40c1503cb11c3751a8255e2 Mon Sep 17 00:00:00 2001 From: Matthieu Crapet <matthieu.cra...@ingenico.com> Date: Wed, 14 Jan 2015 15:42:45 +0100 Subject: [PATCH] autotools: fix ucm partial build When --disable-ucm configure option is specified, don't install related include file. Signed-off-by: Matthieu Crapet <matthieu.cra...@ingenico.com> Signed-off-by: Takashi Iwai <ti...@suse.de> --- include/Makefile.am | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/Makefile.am b/include/Makefile.am index 0127d5c4b200..4baa03af69e1 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -5,7 +5,7 @@ alsaincludedir = ${includedir}/alsa alsainclude_HEADERS = asoundlib.h asoundef.h \ version.h global.h input.h output.h error.h \ - conf.h control.h iatomic.h use-case.h + conf.h control.h iatomic.h if BUILD_CTL_PLUGIN_EXT alsainclude_HEADERS += control_external.h @@ -17,7 +17,7 @@ if BUILD_PCM_PLUGIN alsainclude_HEADERS += pcm_plugin.h endif if BUILD_PCM_PLUGIN_RATE -alsainclude_HEADERS += pcm_rate.h +alsainclude_HEADERS += pcm_rate.h endif if BUILD_PCM_PLUGIN_EXTPLUG alsainclude_HEADERS += pcm_external.h pcm_extplug.h @@ -46,6 +46,10 @@ if BUILD_SEQ alsainclude_HEADERS += seq_event.h seq.h seqmid.h seq_midi_event.h endif +if BUILD_UCM +alsainclude_HEADERS += use-case.h +endif + if BUILD_ALISP alsainclude_HEADERS += alisp.h endif -- 2.2.2 ++++++ 0065-conf-ucm-GoogleNyan-Add-configuration.patch ++++++ >From 3b5fac6d10c580aee14642df8f94caad15dd53f0 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso <tomeu.viz...@collabora.com> Date: Thu, 15 Jan 2015 17:27:29 +0100 Subject: [PATCH] conf/ucm: GoogleNyan: Add configuration Taken from the ChromeOS sources, this configuration should apply to all Nyan boards from Google, so far HP Chromebook 14 (nyan-blaze) and Acer Chromebook 13 (nyan-big). Signed-off-by: Tomeu Vizoso <tomeu.viz...@collabora.com> Signed-off-by: Takashi Iwai <ti...@suse.de> --- configure.ac | 1 + src/conf/ucm/GoogleNyan/GoogleNyan.conf | 5 +++ src/conf/ucm/GoogleNyan/HiFi.conf | 77 +++++++++++++++++++++++++++++++++ src/conf/ucm/GoogleNyan/Makefile.am | 4 ++ src/conf/ucm/Makefile.am | 2 +- 5 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 src/conf/ucm/GoogleNyan/GoogleNyan.conf create mode 100644 src/conf/ucm/GoogleNyan/HiFi.conf create mode 100644 src/conf/ucm/GoogleNyan/Makefile.am diff --git a/configure.ac b/configure.ac index 734163c8c321..916280b8934a 100644 --- a/configure.ac +++ b/configure.ac @@ -654,6 +654,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ src/conf/ucm/SDP4430/Makefile \ src/conf/ucm/tegraalc5632/Makefile \ src/conf/ucm/PAZ00/Makefile \ + src/conf/ucm/GoogleNyan/Makefile \ modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \ alsalisp/Makefile aserver/Makefile \ test/Makefile test/lsb/Makefile \ diff --git a/src/conf/ucm/GoogleNyan/GoogleNyan.conf b/src/conf/ucm/GoogleNyan/GoogleNyan.conf new file mode 100644 index 000000000000..efe6ad8a5c6e --- /dev/null +++ b/src/conf/ucm/GoogleNyan/GoogleNyan.conf @@ -0,0 +1,5 @@ +Comment "Nyan internal card" +SectionUseCase."HiFi" { + File "HiFi.conf" + Comment "Default" +} diff --git a/src/conf/ucm/GoogleNyan/HiFi.conf b/src/conf/ucm/GoogleNyan/HiFi.conf new file mode 100644 index 000000000000..b28fe917162d --- /dev/null +++ b/src/conf/ucm/GoogleNyan/HiFi.conf @@ -0,0 +1,77 @@ +SectionVerb { + EnableSequence [ + cdev "hw:GoogleNyan" + cset "name='Left Speaker Mixer Left DAC Switch' on" + cset "name='Right Speaker Mixer Right DAC Switch' on" + cset "name='Headphone Left Switch' on" + cset "name='Headphone Right Switch' on" + cset "name='Digital EQ 3 Band Switch' off" + cset "name='Digital EQ 5 Band Switch' off" + cset "name='Digital EQ 7 Band Switch' off" + cset "name='Biquad Switch' off" + cset "name='Filter Mode' Music" + cset "name='ADC Oversampling Rate' 0" + cset "name='DMIC Mux' DMIC" + cset "name='MIC2 Mux' IN34" + cset "name='Right ADC Mixer MIC2 Switch' on" + cset "name='Left ADC Mixer MIC2 Switch' on" + cset "name='MIC2 Volume' 10" + cset "name='MIC2 Boost Volume' 0" + cset "name='Mic Jack Switch' off" + cset "name='Int Mic Switch' on" + cset "name='ADCR Boost Volume' 4" + cset "name='ADCL Boost Volume' 4" + cset "name='ADCR Volume' 11" + cset "name='ADCL Volume' 11" + cset "name='Left Speaker Mixer Left DAC Switch' on" + cset "name='Right Speaker Mixer Right DAC Switch' on" + cset "name='Speaker Left Mixer Volume' 2" + cset "name='Speaker Right Mixer Volume' 2" + cset "name='Record Path DC Blocking' on" + cset "name='Playback Path DC Blocking' on" + cset "name='Headphone Left Switch' on" + cset "name='Headphone Right Switch' on" + cset "name='Headphones Switch' off" + cset "name='Speaker Left Switch' on" + cset "name='Speaker Right Switch' on" + cset "name='Speakers Switch' on" + ] + DisableSequence [ + ] +} + +SectionDevice."Headphone".0 { + Value { + OutputDspName "" + } + EnableSequence [ + cdev "hw:GoogleNyan" + cset "name='Speakers Switch' off" + cset "name='Headphones Switch' on" + ] + DisableSequence [ + cdev "hw:GoogleNyan" + cset "name='Headphones Switch' off" + cset "name='Speakers Switch' on" + ] +} + +SectionDevice."Mic".0 { + Value { + CaptureControl "MIC2" + } + EnableSequence [ + cdev "hw:GoogleNyan" + cset "name='Int Mic Switch' off" + cset "name='DMIC Mux' ADC" + cset "name='Mic Jack Switch' on" + cset "name='Record Path DC Blocking' on" + ] + DisableSequence [ + cdev "hw:GoogleNyan" + cset "name='Mic Jack Switch' off" + cset "name='DMIC Mux' DMIC" + cset "name='Int Mic Switch' on" + cset "name='Record Path DC Blocking' off" + ] +} diff --git a/src/conf/ucm/GoogleNyan/Makefile.am b/src/conf/ucm/GoogleNyan/Makefile.am new file mode 100644 index 000000000000..47c7fc9d7976 --- /dev/null +++ b/src/conf/ucm/GoogleNyan/Makefile.am @@ -0,0 +1,4 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/GoogleNyan +ucm_DATA = GoogleNyan.conf HiFi.conf +EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am index bde89dfea440..14fc7aee8e6c 100644 --- a/src/conf/ucm/Makefile.am +++ b/src/conf/ucm/Makefile.am @@ -1 +1 @@ -SUBDIRS=DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632 PAZ00 +SUBDIRS=DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632 PAZ00 GoogleNyan -- 2.2.2 ++++++ 0066-ucm-add-binary-configure-file-parse.patch ++++++ >From 6ea14c3624c0cbcf90e7d5859b4af629523b8d82 Mon Sep 17 00:00:00 2001 From: "Lu, Han" <han...@intel.com> Date: Thu, 22 Jan 2015 09:32:47 +0800 Subject: [PATCH] ucm: add binary configure file parse with cset command, UCM set kcontrol parameters directly: cset "name='<KCONTROL_NAME>' 1<,2,3,...>" This patch enables UCM to set kcontrol with parameters from configure file: cset-bin-file "name='<KCONTROL_NAME>' <path/to/file>" where "cset-bin-file" is a newly added keyword alongside of "cset", to indicate cset with binary data in file. The binary data in file is parameter for audio DSPs, and it's just passed by UCM/ALSA as raw data. The data type of parameter elements must be byte, and the count must matches driver definition. Signed-off-by: Lu, Han <han...@intel.com> Signed-off-by: Takashi Iwai <ti...@suse.de> --- src/ucm/main.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++--- src/ucm/parser.c | 10 +++++++++ src/ucm/ucm_local.h | 1 + 3 files changed, 73 insertions(+), 3 deletions(-) diff --git a/src/ucm/main.c b/src/ucm/main.c index 37ae4c84aa64..182f17476cbe 100644 --- a/src/ucm/main.c +++ b/src/ucm/main.c @@ -34,6 +34,7 @@ #include <ctype.h> #include <stdarg.h> #include <pthread.h> +#include <sys/stat.h> /* * misc @@ -160,11 +161,65 @@ static int open_ctl(snd_use_case_mgr_t *uc_mgr, return 0; } +static int binary_file_parse(snd_ctl_elem_value_t *dst, + snd_ctl_elem_info_t *info, + const char *filepath) +{ + int err = 0; + int fd; + struct stat st; + size_t sz; + ssize_t sz_read; + char *res; + snd_ctl_elem_type_t type; + unsigned int idx, count; + + type = snd_ctl_elem_info_get_type(info); + if (type != SND_CTL_ELEM_TYPE_BYTES) { + uc_error("only support byte type!"); + err = -EINVAL; + return err; + } + fd = open(filepath, O_RDONLY); + if (fd < 0) { + err = -errno; + return err; + } + if (stat(filepath, &st) == -1) { + err = -errno; + goto __fail; + } + sz = st.st_size; + count = snd_ctl_elem_info_get_count(info); + if (sz != count || sz > sizeof(dst->value.bytes)) { + uc_error("invalid parameter size %d!", sz); + err = -EINVAL; + goto __fail; + } + res = malloc(sz); + if (res == NULL) { + err = -ENOMEM; + goto __fail; + } + sz_read = read(fd, res, sz); + if (sz_read < 0 || (size_t)sz_read != sz) { + err = -errno; + goto __fail_read; + } + for (idx = 0; idx < sz; idx++) + snd_ctl_elem_value_set_byte(dst, idx, *(res + idx)); + __fail_read: + free(res); + __fail: + close(fd); + return err; +} + extern int __snd_ctl_ascii_elem_id_parse(snd_ctl_elem_id_t *dst, const char *str, const char **ret_ptr); -static int execute_cset(snd_ctl_t *ctl, const char *cset) +static int execute_cset(snd_ctl_t *ctl, const char *cset, unsigned int type) { const char *pos; int err; @@ -194,7 +249,10 @@ static int execute_cset(snd_ctl_t *ctl, const char *cset) err = snd_ctl_elem_info(ctl, info); if (err < 0) goto __fail; - err = snd_ctl_ascii_value_parse(ctl, value, info, pos); + if (type == SEQUENCE_ELEMENT_TYPE_CSET_BIN_FILE) + err = binary_file_parse(value, info, pos); + else + err = snd_ctl_ascii_value_parse(ctl, value, info, pos); if (err < 0) goto __fail; err = snd_ctl_elem_write(ctl, value); @@ -239,6 +297,7 @@ static int execute_sequence(snd_use_case_mgr_t *uc_mgr, goto __fail_nomem; break; case SEQUENCE_ELEMENT_TYPE_CSET: + case SEQUENCE_ELEMENT_TYPE_CSET_BIN_FILE: if (cdev == NULL) { const char *cdev1 = NULL, *cdev2 = NULL; err = get_value3(&cdev1, "PlaybackCTL", @@ -274,7 +333,7 @@ static int execute_sequence(snd_use_case_mgr_t *uc_mgr, goto __fail; } } - err = execute_cset(ctl, s->data.cset); + err = execute_cset(ctl, s->data.cset, s->type); if (err < 0) { uc_error("unable to execute cset '%s'\n", s->data.cset); goto __fail; diff --git a/src/ucm/parser.c b/src/ucm/parser.c index d7517f69e84b..9e1cb41a2862 100644 --- a/src/ucm/parser.c +++ b/src/ucm/parser.c @@ -306,6 +306,16 @@ static int parse_sequence(snd_use_case_mgr_t *uc_mgr ATTRIBUTE_UNUSED, continue; } + if (strcmp(cmd, "cset-bin-file") == 0) { + curr->type = SEQUENCE_ELEMENT_TYPE_CSET_BIN_FILE; + err = parse_string(n, &curr->data.cset); + if (err < 0) { + uc_error("error: cset-bin-file requires a string!"); + return err; + } + continue; + } + if (strcmp(cmd, "usleep") == 0) { curr->type = SEQUENCE_ELEMENT_TYPE_SLEEP; err = snd_config_get_integer(n, &curr->data.sleep); diff --git a/src/ucm/ucm_local.h b/src/ucm/ucm_local.h index 87f14a299903..c1655c70504f 100644 --- a/src/ucm/ucm_local.h +++ b/src/ucm/ucm_local.h @@ -47,6 +47,7 @@ #define SEQUENCE_ELEMENT_TYPE_CSET 2 #define SEQUENCE_ELEMENT_TYPE_SLEEP 3 #define SEQUENCE_ELEMENT_TYPE_EXEC 4 +#define SEQUENCE_ELEMENT_TYPE_CSET_BIN_FILE 5 struct ucm_value { struct list_head list; -- 2.2.2 ++++++ 0067-Remove-unused-hostname-resolution-in-shm-plugins-and.patch ++++++ >From dbb7eca6559e970bd015eaa95a9e0525660fa09e Mon Sep 17 00:00:00 2001 From: Takashi Iwai <ti...@suse.de> Date: Wed, 28 Jan 2015 16:21:14 +0100 Subject: [PATCH] Remove unused hostname resolution in shm plugins and aserver PCM and control shm plugins and aserver have some codes to resolve the host address and check whether it's a local host although the given address is never used. In addition, the code contains gethostbyname() that is known to be obsoleted. So, let's get rid of all these unused codes. The host configuration item is still accepted (but just ignored) for keeping the compatibility. Signed-off-by: Takashi Iwai <ti...@suse.de> --- aserver/aserver.c | 24 +------------------- include/aserver.h | 1 src/control/control_shm.c | 49 +---------------------------------------- src/pcm/pcm_shm.c | 53 +-------------------------------------------- src/socket.c | 54 ---------------------------------------------- 5 files changed, 6 insertions(+), 175 deletions(-) --- a/aserver/aserver.c +++ b/aserver/aserver.c @@ -1013,11 +1013,10 @@ int main(int argc, char **argv) snd_config_t *conf; snd_config_iterator_t i, next; const char *sockname = NULL; - const char *host = NULL; long port = -1; int err; char *srvname; - struct hostent *h; + command = argv[0]; while ((c = getopt_long(argc, argv, "h", long_options, 0)) != -1) { switch (c) { @@ -1055,14 +1054,8 @@ int main(int argc, char **argv) continue; if (strcmp(id, "comment") == 0) continue; - if (strcmp(id, "host") == 0) { - err = snd_config_get_string(n, &host); - if (err < 0) { - ERROR("Invalid type for %s", id); - return 1; - } + if (strcmp(id, "host") == 0) continue; - } if (strcmp(id, "socket") == 0) { err = snd_config_get_string(n, &sockname); if (err < 0) { @@ -1082,19 +1075,6 @@ int main(int argc, char **argv) ERROR("Unknown field %s", id); return 1; } - if (!host) { - ERROR("host is not defined"); - return 1; - } - h = gethostbyname(host); - if (!h) { - ERROR("Cannot resolve %s", host); - return 1; - } - if (!snd_is_local(h)) { - ERROR("%s is not the local host", host); - return 1; - } if (!sockname && port < 0) { ERROR("either socket or port need to be defined"); return 1; --- a/include/aserver.h +++ b/include/aserver.h @@ -23,7 +23,6 @@ #include "../src/control/control_local.h" int snd_receive_fd(int sock, void *data, size_t len, int *fd); -int snd_is_local(struct hostent *hent); typedef enum _snd_dev_type { SND_DEV_TYPE_PCM, --- a/src/control/control_shm.c +++ b/src/control/control_shm.c @@ -441,29 +441,6 @@ static int make_local_socket(const char return sock; } -#if 0 -static int make_inet_socket(const char *host, int port) -{ - struct sockaddr_in addr; - int sock; - struct hostent *h = gethostbyname(host); - if (!h) - return -ENOENT; - - sock = socket(PF_INET, SOCK_STREAM, 0); - if (sock < 0) - return -errno; - - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - memcpy(&addr.sin_addr, h->h_addr_list[0], sizeof(struct in_addr)); - - if (connect(sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) - return -errno; - return sock; -} -#endif - int snd_ctl_shm_open(snd_ctl_t **handlep, const char *name, const char *sockname, const char *sname, int mode) { snd_ctl_t *ctl; @@ -565,12 +542,10 @@ int _snd_ctl_shm_open(snd_ctl_t **handle const char *server = NULL; const char *ctl_name = NULL; snd_config_t *sconfig; - const char *host = NULL; const char *sockname = NULL; long port = -1; int err; - int local; - struct hostent *h; + snd_config_for_each(i, next, conf) { snd_config_t *n = snd_config_iterator_entry(i); const char *id; @@ -624,14 +599,8 @@ int _snd_ctl_shm_open(snd_ctl_t **handle continue; if (strcmp(id, "comment") == 0) continue; - if (strcmp(id, "host") == 0) { - err = snd_config_get_string(n, &host); - if (err < 0) { - SNDERR("Invalid type for %s", id); - goto _err; - } + if (strcmp(id, "host") == 0) continue; - } if (strcmp(id, "socket") == 0) { err = snd_config_get_string(n, &sockname); if (err < 0) { @@ -653,24 +622,10 @@ int _snd_ctl_shm_open(snd_ctl_t **handle goto _err; } - if (!host) { - SNDERR("host is not defined"); - goto _err; - } if (!sockname) { SNDERR("socket is not defined"); goto _err; } - h = gethostbyname(host); - if (!h) { - SNDERR("Cannot resolve %s", host); - goto _err; - } - local = snd_is_local(h); - if (!local) { - SNDERR("%s is not the local host", host); - goto _err; - } err = snd_ctl_shm_open(handlep, name, sockname, ctl_name, mode); _err: snd_config_delete(sconfig); --- a/src/pcm/pcm_shm.c +++ b/src/pcm/pcm_shm.c @@ -654,33 +654,6 @@ static int make_local_socket(const char return sock; } -#if 0 -static int make_inet_socket(const char *host, int port) -{ - struct sockaddr_in addr; - int sock; - struct hostent *h = gethostbyname(host); - if (!h) - return -ENOENT; - - sock = socket(PF_INET, SOCK_STREAM, 0); - if (sock < 0) { - SYSERR("socket failed"); - return -errno; - } - - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - memcpy(&addr.sin_addr, h->h_addr_list[0], sizeof(struct in_addr)); - - if (connect(sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) { - SYSERR("connect failed"); - return -errno; - } - return sock; -} -#endif - /** * \brief Creates a new shared memory PCM * \param pcmp Returns created PCM handle @@ -842,12 +815,10 @@ int _snd_pcm_shm_open(snd_pcm_t **pcmp, const char *server = NULL; const char *pcm_name = NULL; snd_config_t *sconfig; - const char *host = NULL; const char *sockname = NULL; long port = -1; int err; - int local; - struct hostent *h; + snd_config_for_each(i, next, conf) { snd_config_t *n = snd_config_iterator_entry(i); const char *id; @@ -898,14 +869,8 @@ int _snd_pcm_shm_open(snd_pcm_t **pcmp, continue; if (strcmp(id, "comment") == 0) continue; - if (strcmp(id, "host") == 0) { - err = snd_config_get_string(n, &host); - if (err < 0) { - SNDERR("Invalid type for %s", id); - goto _err; - } + if (strcmp(id, "host") == 0) continue; - } if (strcmp(id, "socket") == 0) { err = snd_config_get_string(n, &sockname); if (err < 0) { @@ -928,24 +893,10 @@ int _snd_pcm_shm_open(snd_pcm_t **pcmp, goto __error; } - if (!host) { - SNDERR("host is not defined"); - goto _err; - } if (!sockname) { SNDERR("socket is not defined"); goto _err; } - h = gethostbyname(host); - if (!h) { - SNDERR("Cannot resolve %s", host); - goto _err; - } - local = snd_is_local(h); - if (!local) { - SNDERR("%s is not the local host", host); - goto _err; - } err = snd_pcm_shm_open(pcmp, name, sockname, pcm_name, stream, mode); __error: snd_config_delete(sconfig); --- a/src/socket.c +++ b/src/socket.c @@ -106,58 +106,4 @@ int snd_receive_fd(int sock, void *data, *fd = *fds; return ret; } - -int snd_is_local(struct hostent *hent) -{ - int s; - int err; - struct ifconf conf; - size_t numreqs = 10; - size_t i; - struct in_addr *haddr = (struct in_addr*) hent->h_addr_list[0]; - - s = socket(PF_INET, SOCK_STREAM, 0); - if (s < 0) { - SYSERR("socket failed"); - return -errno; - } - - conf.ifc_len = numreqs * sizeof(struct ifreq); - conf.ifc_buf = malloc((unsigned int) conf.ifc_len); - if (! conf.ifc_buf) { - close(s); - return -ENOMEM; - } - while (1) { - err = ioctl(s, SIOCGIFCONF, &conf); - if (err < 0) { - SYSERR("SIOCGIFCONF failed"); - close(s); - return -errno; - } - if ((size_t)conf.ifc_len < numreqs * sizeof(struct ifreq)) - break; - numreqs *= 2; - conf.ifc_len = numreqs * sizeof(struct ifreq); - conf.ifc_buf = realloc(conf.ifc_buf, (unsigned int) conf.ifc_len); - if (! conf.ifc_buf) { - close(s); - return -ENOMEM; - } - } - numreqs = conf.ifc_len / sizeof(struct ifreq); - for (i = 0; i < numreqs; ++i) { - struct ifreq *req = &conf.ifc_req[i]; - struct sockaddr_in *s_in = (struct sockaddr_in *)&req->ifr_addr; - s_in->sin_family = AF_INET; - err = ioctl(s, SIOCGIFADDR, req); - if (err < 0) - continue; - if (haddr->s_addr == s_in->sin_addr.s_addr) - break; - } - close(s); - free(conf.ifc_buf); - return i < numreqs; -} #endif ++++++ alsa-docs-suppress-timestamp.patch ++++++ --- doc/doxygen.cfg.in | 2 ++ 1 file changed, 2 insertions(+) --- a/doc/doxygen.cfg.in +++ b/doc/doxygen.cfg.in @@ -121,3 +121,5 @@ TYPEDEF_HIDES_STRUCT = YES # needed in d #INPUT_FILTER = inputfilter #FILTER_SOURCE_FILES = YES + +HTML_TIMESTAMP = NO -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org